Projects
Mega:24.09
ksh
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
_service:tar_scm:ksh.spec
Changed
@@ -1,5 +1,5 @@ Name: ksh -Version: 1.0.8 +Version: 1.0.9 Release: 1 Summary: The Original ATT Korn Shell License: EPL-2.0 @@ -115,6 +115,12 @@ %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %changelog +* Sun Jul 28 2024 dillon chen <dillon.chen@gmail.com> - 2:1.0.9-1 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:update version to 1.0.9 + * Mon Feb 5 2024 wangyuhang <wangyuhang27@huawei.com> - 2:1.0.8-1 - Type:bugfix - CVE:NA
View file
_service:tar_scm:ksh-1.0.8.tar.gz/bin/Mamfile_indent
Deleted
@@ -1,32 +0,0 @@ -IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches -let() { return $((!($1))); } - -# Automatically (re-)indent make...done blocks in a Mamfile. -# Usage: Mamfile_indent <Mamfile >Mamfile.new -# -# Should work on all current POSIX compliant shells. -# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain. - -# Spacing per indentation level. Edit to change style. -indent=' ' # one tab - -# Remove existing indentation, add new indentation. -indentlvl=0 -sed 's/^:space:*//' \ -| while read -r line -do case $line in - '') continue ;; - done*) let "indentlvl -= 1" ;; - esac - - spc= - i=0 - while let "(i += 1) <= indentlvl" - do spc=$indent$spc - done - printf '%s\n' $spc$line - - case $line in - make*) let "indentlvl += 1" ;; - esac -done
View file
_service:tar_scm:ksh-1.0.8.tar.gz/bin/Mamfile_rm_unused_vars
Deleted
@@ -1,29 +0,0 @@ -IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches -CCn=' -' # newline -let() { return $((!($1))); } - -# Remove unused variable definitions from a Mamfile. -# Usage: Mamfile_rm_unused_vars <Mamfile >Mamfile.new -# -# Should work on all current POSIX compliant shells. -# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain. -# -# All variables are declared with 'setv' and they are used if an expansion -# of the form ${varname} exists (the braces are mandatory in Mamfiles). - -mamfile=$(let $# && cat "$1" || cat) -vars=$(printf '%s\n' $mamfile | awk '$1 == "setv" { print $2; }') -rm_unused_ere= -IFS=$CCn; for varname in $vars; do IFS= - case $mamfile in - *"\${$varname}"* ) - ;; - * ) # add with '|' separator for Extended Regular Expression - rm_unused_ere="${rm_unused_ere:+$rm_unused_ere|}setv:blank:+$varname(:blank:|$)" ;; - esac -done -case $rm_unused_ere in -'') printf '%s\n' $mamfile ;; -*) printf '%s\n' $mamfile | grep -vE $rm_unused_ere ;; -esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/bin/mamprobe
Deleted
@@ -1,257 +0,0 @@ -######################################################################## -# # -# This software is part of the ast package # -# Copyright (c) 1994-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # -# and is licensed under the # -# Eclipse Public License, Version 2.0 # -# # -# A copy of the License is available at # -# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # -# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # -# # -# Glenn Fowler <gsf@research.att.com> # -# Martijn Dekker <martijn@inlv.org> # -# # -######################################################################## -### this script contains archaic constructs that work with all sh variants ### -# mamprobe - generate MAM cc probe info -# Glenn Fowler <gsf@research.att.com> - -(command set -o posix) 2>/dev/null && set -o posix - -command=mamprobe - -bins=` - ( - userPATH=$PATH - PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH - getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH" - ) | sed 's/:/ /g' -` || exit - -# check the options - -opt= - -case `(getopts '-123:xyz' opt --xyz; echo 0$opt) 2>/dev/null` in -0123) USAGE=$' --? -@(#)$Id: mamprobe (ksh 93u+m) 2022-10-26 $ - -+NAME?mamprobe - generate MAM cc probe info -+DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) - probe information for use by \bmamake\b(1). \acc-path\a is the - absolute path of the probed compiler and \ainfo-file\a is where - the information is placed. \ainfo-file\a is usually - \b$INSTALLROOT/lib/probe/C/mam/\b\ahash\a, where \ahash\a is a hash - of \acc-path\a. Any \ainfo-file\a directories are created if needed. - If \ainfo-file\a is \b-\b then the probe information is written to - the standard output. -+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of - \bpackage\b(1) installation before \bnmake\b(1) is built. The - probed variable names are the \bnmake\b(1) names with a \bmam_\b - prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. - Additional variables are:{ - +_hosttype_?the \bpackage\b(1) host type - +mam_cc_L?\b-L\b\adir\a supported - +STDCAT?command to execute for \bcat\b(1) - +STDCHMOD?command to execute for \bchmod\b(1) - +STDCMP?command to execute for \bcmp\b(1) - +STDCP?command to execute for \bcp\b(1) - +STDED?command to execute for \bed\b(1) or \bex\b(1) - +STDEDFLAGS?flags for \bSTDED\b - +STDLN?command to execute for \bln\b(1) - +STDMV?command to execute for \bmv\b(1) - +STDRM?command to execute for \brm\b(1) -} -d:debug?Enable probe script debug trace. - -info-file cc-path - -+SEE ALSO?\bpackage\b(1), \bmamake\b(1), \bnmake\b(1), \bprobe\b(1) -' - while getopts -a "$command" "$USAGE" OPT - do case $OPT in - d) opt=-d ;; - esac - done - shift `expr $OPTIND - 1` - ;; -*) while : - do case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - -) break - ;; - -d) opt=-d - ;; - -*) echo $command: $1: unknown option >&2 - ;; - *) break - ;; - esac - set '' - break - done - ;; -esac - -# check the args - -case $1 in --) ;; -/*) ;; -*) set '' ;; -esac -case $2 in -/*) ;; -*) set '' ;; -esac -case $# in -0|1) echo "Usage: $command info-file cc-path" >&2; exit 2 ;; -esac -info=$1 -shift -cc=$* - -# find the make probe script - -ifs=${IFS-' - '} -IFS=: -set $PATH -IFS=$ifs -script=lib/probe/C/make/probe -while : -do case $# in - 0) echo "$0: ../$script: probe script not found on PATH" >&2 - exit 1 - ;; - esac - case $1 in - '') continue ;; - esac - makeprobe=`echo $1 | sed 's,^/*$,'$script,` - if test -x $makeprobe - then break - fi - shift -done - -# create the info dir if necessary - -case $info in -/*) i=X$info - ifs=${IFS-' - '} - IFS=/ - set $i - IFS=$ifs - while : - do i=$1 - shift - case $i in - X) break ;; - esac - done - case $info in - //*) path=/ ;; - *) path= ;; - esac - while : - do case $# in - 0|1) break ;; - esac - comp=$1 - shift - case $comp in - '') continue ;; - esac - path=$path/$comp - if test ! -d $path - then mkdir $path || exit - fi - done - ;; -esac - -# generate info in a tmp file and rename when finished - -case $info in --) ;; -*) tmp=${TMPDIR:-/tmp}/mam$$ - trap "exec >/dev/null; rm -f $tmp" 0 1 2 3 15 - exec > $tmp - echo "probing C language processor $cc for mam information" >&2 - ;; -esac - -echo "note generated by $0 for $cc" - -( - set '' $opt $cc - shift - . $makeprobe "$@" - - case " $CC_DIALECT " in - *" -L "*) echo "CC.L = 1" ;; - esac - -) | sed \ - -e '/^CC\./!d' \ - -e 's/^CC./setv mam_cc_/' \ - -e 's/^\(^=.*\)\./\1_/' \ - -e 's/^\(^=.*\)\./\1_/' \ - -e 's/ =//' \ - -e 's/\$("\(^"*\)")/\1/g' \ - -e 's/\$(\(^)*\))/${\1}/g' \ - -e 's/\${CC\./${mam_cc_}/g' - -echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' - -# STD* are standard commands/flags - -if ( -ed <<! -q -! -) < /dev/null > /dev/null 2>&1 -then STDED=ed -else STDED=ex -fi -STDEDFLAGS=- -set STDCAT cat STDCHMOD chmod STDCMP cmp STDCP cp STDLN ln STDMV mv STDRM rm -while : -do case $# in - 0|1) break ;; - esac - p=$2 - for d in $bins - do if test -x $d/$p - then p=$d/$p - break - fi - done - eval $1=\$p - shift - shift -done -for n in STDCAT STDCHMOD STDCMP STDCP STDED STDEDFLAGS STDLN STDMV STDRM -do eval echo setv \$n \$$n -done - -# all done - -case $info in --) ;; -*) exec >/dev/null - test -f "$info" && rm -f "$info" - cp "$tmp" "$info" - chmod -w "$info" - ;; -esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/hosttype.tst
Deleted
@@ -1,6 +0,0 @@ -hp.pa hostname 9000/730 hp9000s700 HP-UX hostname A.09.01 A -linux-aout.i386 hostname i586 i386 linux hostname 1.1.59 #1 -sgi.mips2 hostname.domain IP22 mips IRIX hostname 5.2 02282016 -osf.alpha hostname.domain alpha alpha OSF1 hostname.domain V3.2 62 -sun4 hostname.domain sun4 sparc SunOS hostname.domain 4.1.1 1 sun4c -sol.sun4 hostname.domain sun4 sparc SunOS hostname.domain 5.4 Generic_101945-13
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/package.sh
Deleted
@@ -1,3345 +0,0 @@ -######################################################################## -# # -# This software is part of the ast package # -# Copyright (c) 1994-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # -# and is licensed under the # -# Eclipse Public License, Version 2.0 # -# # -# A copy of the License is available at # -# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # -# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # -# # -# Glenn Fowler <gsf@research.att.com> # -# Martijn Dekker <martijn@inlv.org> # -# Trey Valenta <t@trey.net> # -# Johnothan King <johnothanking@protonmail.com> # -# Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> # -# Chase <nicetrynsa@protonmail.ch> # -# Anuradha Weeraman <anuradha@debian.org> # -# # -######################################################################## -### this sh script is POSIX compliant and compatible with shell bugs ### -# KornShell 93u+m build system, main control script # -# based on AST 'package' by Glenn Fowler <gsf@research.att.com> # -# simplified and rewritten by Martijn Dekker <martijn@inlv.org> # -######################################################################## - -# Escape from a non-POSIX shell -min_posix=/if/this/is/csh/ignore/the/error/message || exec sh $0:q $argv:q -# ('test X -ef Y' is technically non-POSIX, but practically universal) -min_posix='test / -ef / && path=Bad && case $PATH in (Bad) exit 1;; esac && '\ -'PWD=Bad && cd -P -- / && case $PWD in (/) ;; (*) exit 1;; esac && '\ -'! { ! case x in ( x ) : ${0##*/} || : $( : ) ;; esac; } && '\ -'trap "exit 0" 0 && exit 1' -if (eval "$min_posix") 2>/dev/null -then : good shell -else "$SHELL" -c "$min_posix" 2>/dev/null && exec "$SHELL" -- "$0" ${1+"$@"} - sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} - DEFPATH=`getconf PATH` 2>/dev/null || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin - PATH=$DEFPATH:$PATH - export PATH - sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} - echo "$0: Can't escape from obsolete or broken shell. Run me with a POSIX shell." >&2 - exit 128 -fi -readonly min_posix # use for checksh() - -# Set standards compliance mode -(command set -o posix) 2>/dev/null && set -o posix - -# As this code heavily uses field splitting of unquoted variable expansions, -# turn off global pathname expansion for safety (turn on locally in subshells) -set -o noglob - -# Sanitize 'cd' -unset CDPATH - -# Make the package root the current working directory -# This makes it possible to run '/my/path/package make' without cd'ing first -# (for all its featuritis, the AT&T version never could manage this) -case $0 in -0123456789+-*) - echo "dodgy \$0: $0" >&2 - exit 128 ;; -*/*) - me=$0 ;; -*) - me=$(command -v "$0") || exit 128 ;; -esac -me=$(dirname "$me") -cd "$me" || exit -unset -v me -case $PWD in -*/arch/*/*/bin) - cd .. ;; -*/arch/*/bin) - cd ../../.. ;; -*/bin) - cd .. ;; -*) - echo "this script must live in bin/" >&2 - exit 1 ;; -esac || exit - -# shell checks -checksh() -{ - "$1" -c "$min_posix" 2>/dev/null || return 1 -} - -LC_ALL=C -export LC_ALL - -TMPDIR=${TMPDIR:-/tmp} -export TMPDIR - -src="cmd contrib etc lib" -use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" -usr="/home" -lib="" # need /usr/local/lib /usr/local/shlib -ccs="/usr/kvm /usr/ccs/bin" -org="gnu GNU" -makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile -env="HOSTTYPE PACKAGEROOT INSTALLROOT PATH FPATH MANPATH" - -package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' - -CROSS=0 - -MAKESKIP=${MAKESKIP:-"*-.*"} - -all_types='*.*|sun4' # all but sun4 match *.* - -command=${0##*/} -case $(getopts '-123:xyz' opt --xyz 2>/dev/null; echo 0$opt) in -0123) USAGE=$' --? -@(#)$Id: '$command$' (ksh 93u+m) 2023-06-18 $ - --author?Glenn Fowler <gsf@research.att.com> --author?Contributors to https://github.com/ksh93/ksh --copyright?(c) 1994-2012 AT&T Intellectual Property --copyright?(c) 2020-2023 Contributors to ksh 93u+m --license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html -+NAME?'$command$' - build, test and install ksh 93u+m -+DESCRIPTION?The \b'$command$'\b command is the main control script - for building and installing KornShell 93u+m. - It is a POSIX \bsh\b(1) script coded for maximal portability. - A POSIX shell and C compiler installation are the only requirements. - All package files are in the \b$PACKAGEROOT\b directory tree. - Binary package files are in the \b$INSTALLROOT\b - (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where - \ahosttype\a=$(\bbin/package host type\b). - See \bDETAILS\b for more information. -+?Note that no environment variables need be set by the user; - \b'$command$'\b determines the environment based on the current working - directory. The \buse\b action starts a \bsh\b(1) with the environment - initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set - by explicit command argument assignments to override the defaults. -+?The command arguments are composed of a sequence of words: zero or - more \aqualifiers\a, one \aaction\a, and zero or more action-specific - \aarguments\a, and zero or more \aname=value\a definitions. - \boptget\b(3) documentation options such as \b--man\b, \b--html\b - and \b--nroff\b are also supported. - The default with no arguments is \bhost type\b. -+?The qualifiers are: - { - +debug|environment?Show environment and actions but do not - execute. - +flat?With the \bmake\b action, create a flat view by linking all - files from \b$INSTALLROOT\b, minus \b*.old\b files, - onto their corresponding path under \b$PACKAGEROOT\b. - Subsequent \bmake\b actions will update an existing flat view - whether or not \bflat\b is specified. - Only one architecture can have a flat view. - If \bflat\b is specified with the \bclean\b action, then - only clean up this flat view and do not delete \b$INSTALLROOT\b. - +force?Force the action to override saved state. - +never?Run make -N and show other actions. - +only?Only operate on the specified packages. - +quiet?Do not list captured action output. - +show?Run make -n and show other actions. - +verbose?Provide detailed action output. - +DEBUG?Trace the package script actions in detail. - } -+?The actions are: - { - +clean | clobber?Clean up the flat view, if any. - Then, unless \bflat\b was given, - delete the \barch/\b\aHOSTTYPE\a hierarchy; this - deletes all generated files and directories for \aHOSTTYPE\a. - The hierarchy can be rebuilt by \b'$command$' make\b. - +export\b \avariable\a ...?List \aname\a=\avalue\a for - \avariable\a, one per line. If the \bonly\b attribute is - specified then only the variable values are listed. If no - variables are specified then \b'$env$'\b are assumed. - +help\b \aaction\a ?Display help text on the standard - error (standard output for \aaction\a). - +host\b \aattribute\a ... ?List - architecture/implementation dependent host information on the - standard output. \btype\b is listed if no attributes are - specified. Information is listed on a single line in - \aattribute\a order. The attributes are: - { - +canon \aname\a?An external host type name to be - converted to \b'$command$'\b syntax. - +cpu?The number of CPUs; 1 if the host is not a - multiprocessor. - +name?The host name. - +type?The host type, usually in the form - \avendor\a.\aarchitecture\a, with an optional trailing - -\aversion\a. The main theme is that type names within - a family of architectures are named in a similar, - predictable style. OS point release information is - avoided as much as possible, but vendor resistance to - release incompatibilities has for the most part been - futile. - } - +install\b \adest_dir\a \acommand\a ... ?Install commands - from the \b$INSTALLROOT\b tree - into appropriate subdirectories of \adest_dir\a. - If \adest_dir\a does not exist, - then it and any necessary subdirectories are created. - \adest_dir\a can be a directory like \a/usr/local\a - to install the \acommand\as directly, - or a temporary directory like \a/tmp/pkgtree/usr\a - to prepare for packaging with operating system-specific tools. - If no \acommand\a is specified, - then \aksh\a and \ashcomp\a are assumed. - +make\b \apackage\a \aoption\a ... \atarget\a ... ?Build - and install. The default \atarget\a is \binstall\b, which makes - and installs \apackage\a. If the standard output is a terminal - then the output is also captured in - \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in - the \b$INSTALLROOT\b directory tree viewpathed on top of the - \b$PACKAGEROOT\b directory tree. Leaf directory names matching the - \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The - \bview\b action is done before making. \aoption\a operands are - passed to the underlying make command. - +results\b \bfailed\b \bpath\b \bold\b \bmake\b | \btest\b | \bwrite\b ?List - results and interesting messages captured by the most recent - \bmake\b (default), \btest\b or \bwrite\b action. \bold\b - specifies the previous results, if any (current and previous - results are retained). \b$HOME/.pkgresults\b, if it exists, - must contain an \begrep\b(1) expression of result lines to be - ignored. \bfailed\b lists failures only and \bpath\b lists the - results file path name only. - +test\b \b\adir\a\b \b?Run all available default regression tests. - If the optional \adir\a argument (such as \bsrc/cmd/ksh93\b) is given, - only the tests in that directory are run. - If the standard output is a terminal then the - output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b. - Programs must be made before they can be tested. - For \bksh\b, a separate \bshtests\b command is available that allows - passing arguments to select and tune the regression tests. - See \bbin/shtests --man\b for more information. - +use\b \auid\a | \apackage\a | . | - command ... ?Run - \acommand\a, or an interactive shell if \acommand\a is omitted, - with the environment initialized for using the package. If - \auid\a or \apackage\a or \a.\a is specified then it is used - to determine a \b$PACKAGEROOT\b, possibly different from - the current directory. For example, to try out bozo'\'$'s package: - \bpackage use bozo\b. The \buse\b action may be run from any - directory. If the file \b$INSTALLROOT/lib/package/profile\b is - readable then it is sourced to initialize the environment. - +view\b?Initialize the architecture specific viewpath - hierarchy. The \bmake\b action implicitly calls this action. - } -+DETAILS?The package directory hierarchy is rooted at - \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two - level viewpath is used to separate source and binaries. The top view is - architecture specific, the bottom view is shared source. All building - is done in the architecture specific view; no source view files are - intentionally changed. This means that many different binary - architectures can be made from a single copy of the source. -+?Independent \b$PACKAGEROOT\b hierarchies can be combined by - appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The - \bVPATH\b viewing order is from left to right. -+?\b$HOSTTYPE\b names the current binary architecture and is determined - by the output of \b'$command$'\b (no arguments). The \b$HOSTTYPE\b naming - scheme is used to separate incompatible executable and object formats. - All architecture specific binaries are placed under \b$INSTALLROOT\b - (\b$PACKAGEROOT/arch/$HOSTTYPE\b). There are a few places that match - against \b$HOSTTYPE\b when making binaries; these are limited to - makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b - then turn off the optimizer for these objects. All other architecture - dependent logic is handled either by the \bAST\b \biffe\b(1) command or - by component specific configure scripts. Explicit \b$HOSTTYPE\b - values matching *,*cc*,-*,... optionally set the default \bCC\b and - \bCCFLAGS\b. This is handy for build farms that support different - compilers on the same architecture. -+?Each component contains a \bMAM\b (make abstract machine) - file (\bMamfile\b). A Mamfile contains a portable makefile description - written in a simple dependency tree language using indented - \bmake\b...\bdone\b blocks. -+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b - relative pathnames (via the \bAST\b \bpathpath\b(3) function); there - are no embedded absolute pathnames. This means that binaries generated - under \b$PACKAGEROOT\b may be copied to a different root; users need - only change their \b$PATH\b variable to reference the new installation - root \bbin\b directory. \b'$command$' install\b installs binary packages in - a new \b$INSTALLROOT\b. - - qualifier ... action arg ... n=v ... - -+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexpmake\b(1), - \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bpax\b(1), - \bpkgadd\b(1), \bpkgmk\b(1), \brpm\b(1), - \bsh\b(1), \btar\b(1), \boptget\b(3) -' - case $* in - help) set -- --man ;; - esac - while getopts -a "$command" "$USAGE" OPT - do : - done - shift $((OPTIND-1)) - ;; -esac - -# check the args - -case $AR in -'') AR=ar ;; -esac -case $CC in -'') CC=cc ;; -esac -case $LD in -'') LD=ld ;; -esac -case $NM in -'') NM=nm ;; -esac - -action= -bit= -exec= -flat=0 -force=0 -global= -hi= -ifs=${IFS-' - '} -lo= -make= -makeflags='-K' -nl=" -" -noexec= -only=0 -output= -quiet=0 -show=: -tab=" " -verbose=0 -AUTHORIZE= -DEBUG= - -unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true - -while : -do case $# in - 0) set host type ;; - esac - case $1 in - clean|clobber|export|host|install|make|results|test|use|view) - action=$1 - shift - break - ;; - debug|environment) - exec=echo make=echo show=echo - ;; - flat) flat=1 - ;; - force) force=1 - ;; - never) exec=echo noexec=-N - ;; - only) only=1 - ;; - quiet) quiet=1 - ;; - show) exec=echo noexec=-n - ;; - verbose)verbose=1 - ;; - DEBUG) DEBUG=1 - PS4='+$LINENO:$SECONDS+ ' - set -x - ;; - help|HELP|html|man|--?m*) - case $1 in - help) code=0 - case $2 in - '') exec 1>&2 ;; - esac - ;; - html) code=0 html=1 - echo "<html><title>$command help</title><body><h1><code>$command</code> help</h1><pre>" - ;; - *) code=2 - exec 1>&2 - ;; - esac - # Plain-text fallback. Regenerate with: - # ksh -c 'COLUMNS=80 bin/package --man' 2>&1 | sed "s/'/'\\\\''/g; 1s/^/echo '/; \$s/\$/'/" - echo 'NAME - package - build, test and install ksh 93u+m - -SYNOPSIS - package options qualifier ... action arg ... n=v ... - -DESCRIPTION - The package command is the main control script for building and installing - KornShell 93u+m. It is a POSIX sh(1) script coded for maximal portability. A - POSIX shell and C compiler installation are the only requirements. All - package files are in the $PACKAGEROOT directory tree. Binary package files - are in the $INSTALLROOT ($PACKAGEROOT/arch/hosttype) tree, where - hosttype=$(bin/package host type). See DETAILS for more information. - - Note that no environment variables need be set by the user; package - determines the environment based on the current working directory. The use - action starts a sh(1) with the environment initialized. CC, CCFLAGS, HOSTTYPE - and SHELL may be set by explicit command argument assignments to override the - defaults. - - The command arguments are composed of a sequence of words: zero or more - qualifiers, one action, and zero or more action-specific arguments, and zero - or more name=value definitions. optget(3) documentation options such as - --man, --html and --nroff are also supported. The default with no arguments - is host type. - - The qualifiers are: - debug|environment - Show environment and actions but do not execute. - flat With the make action, create a flat view by linking all files from - $INSTALLROOT, minus *.old files, onto their corresponding path under - $PACKAGEROOT. Subsequent make actions will update an existing flat - view whether or not flat is specified. Only one architecture can have - a flat view. If flat is specified with the clean action, then only - clean up this flat view and do not delete $INSTALLROOT. - force Force the action to override saved state. - never Run make -N and show other actions. - only Only operate on the specified packages. - quiet Do not list captured action output. - show Run make -n and show other actions. - verbose - Provide detailed action output. - DEBUG Trace the package script actions in detail. - - The actions are: - clean | clobber - Clean up the flat view, if any. Then, unless flat was given, delete - the arch/HOSTTYPE hierarchy; this deletes all generated files and - directories for HOSTTYPE. The hierarchy can be rebuilt by package - make. - export variable ... - List name=value for variable, one per line. If the only attribute is - specified then only the variable values are listed. If no variables - are specified then HOSTTYPE PACKAGEROOT INSTALLROOT PATH FPATH - MANPATH are assumed. - help action - Display help text on the standard error (standard output for action). - host attribute ... - List architecture/implementation dependent host information on the - standard output. type is listed if no attributes are specified. - Information is listed on a single line in attribute order. The - attributes are: - canon name - An external host type name to be converted to package syntax. - cpu The number of CPUs; 1 if the host is not a multiprocessor. - name The host name. - type The host type, usually in the form vendor.architecture, with - an optional trailing -version. The main theme is that type - names within a family of architectures are named in a - similar, predictable style. OS point release information is - avoided as much as possible, but vendor resistance to release - incompatibilities has for the most part been futile. - install dest_dir command ... - Install commands from the $INSTALLROOT tree into appropriate - subdirectories of dest_dir. If dest_dir does not exist, then it and - any necessary subdirectories are created. dest_dir can be a directory - like /usr/local to install the commands directly, or a temporary - directory like /tmp/pkgtree/usr to prepare for packaging with - operating system-specific tools. If no command is specified, then ksh - and shcomp are assumed. - make package option ... target ... - Build and install. The default target is install, which makes and - installs package. If the standard output is a terminal then the - output is also captured in $INSTALLROOT/lib/package/gen/make.out. The - build is done in the $INSTALLROOT directory tree viewpathed on top of - the $PACKAGEROOT directory tree. Leaf directory names matching the - |-separated shell pattern $MAKESKIP are ignored. The view action is - done before making. option operands are passed to the underlying make - command. - results failed path old make | test | write - List results and interesting messages captured by the most recent - make (default), test or write action. old specifies the previous - results, if any (current and previous results are retained). - $HOME/.pkgresults, if it exists, must contain an egrep(1) expression - of result lines to be ignored. failed lists failures only and path - lists the results file path name only. - test dir - Run all available default regression tests. If the optional dir - argument (such as src/cmd/ksh93) is given, only the tests in that - directory are run. If the standard output is a terminal then the - output is also captured in $INSTALLROOT/lib/package/gen/test.out. - Programs must be made before they can be tested. For ksh, a separate - shtests command is available that allows passing arguments to select - and tune the regression tests. See bin/shtests --man for more - information. - use uid | package | . | - command ... - Run command, or an interactive shell if command is omitted, with the - environment initialized for using the package. If uid or package or . - is specified then it is used to determine a $PACKAGEROOT, possibly - different from the current directory. For example, to try out bozo'\''s - package: package use bozo. The use action may be run from any - directory. If the file $INSTALLROOT/lib/package/profile is readable - then it is sourced to initialize the environment. - view Initialize the architecture specific viewpath hierarchy. The make - action implicitly calls this action. - -DETAILS - The package directory hierarchy is rooted at $PACKAGEROOT. All source and - binaries reside under this tree. A two level viewpath is used to separate - source and binaries. The top view is architecture specific, the bottom view - is shared source. All building is done in the architecture specific view; no - source view files are intentionally changed. This means that many different - binary architectures can be made from a single copy of the source. - - Independent $PACKAGEROOT hierarchies can be combined by appending - $INSTALLROOT:$PACKAGEROOT pairs to VPATH. The VPATH viewing order is from - left to right. - - $HOSTTYPE names the current binary architecture and is determined by the - output of package (no arguments). The $HOSTTYPE naming scheme is used to - separate incompatible executable and object formats. All architecture - specific binaries are placed under $INSTALLROOT - ($PACKAGEROOT/arch/$HOSTTYPE). There are a few places that match against - $HOSTTYPE when making binaries; these are limited to makefile compiler - workarounds, e.g., if $HOSTTYPE matches hp.* then turn off the optimizer for - these objects. All other architecture dependent logic is handled either by - the AST iffe(1) command or by component specific configure scripts. Explicit - $HOSTTYPE values matching *,*cc*,-*,... optionally set the default CC and - CCFLAGS. This is handy for build farms that support different compilers on - the same architecture. - - Each component contains a MAM (make abstract machine) file (Mamfile). A - Mamfile contains a portable makefile description written in a simple - dependency tree language using indented make...done blocks. - - All scripts and commands under $PACKAGEROOT use $PATH relative pathnames (via - the AST pathpath(3) function); there are no embedded absolute pathnames. This - means that binaries generated under $PACKAGEROOT may be copied to a different - root; users need only change their $PATH variable to reference the new - installation root bin directory. package install installs binary packages in - a new $INSTALLROOT. - -SEE ALSO - autoconfig(1), cksum(1), expmake(1), gzip(1), make(1), mamake(1), pax(1), - pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) - -IMPLEMENTATION - version package (ksh 93u+m) 2023-06-18 - author Glenn Fowler <gsf@research.att.com> - author Contributors to https://github.com/ksh93/ksh - copyright (c) 1994-2012 AT&T Intellectual Property - copyright (c) 2020-2023 Contributors to ksh 93u+m - license https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html' - case $1 in - html) echo "</pre></body></html>" ;; - esac - exit $code - ;; - *=*) set DEFAULT host type "$@" - ;; - *) # simulate AST getopt(3) usage output - echo "Usage: $command options qualifier ... action arg ... n=v ... " >&2 - echo " Help: $command --help | --man 2>&1" >&2 - exit 2 - ;; - esac - global="$global $1" - shift -done - -# gather HOSTTYPE *,* options -# ,*cc*,-*,... set CC and CCFLAGS - -hostopts() -{ - _ifs_=$IFS - IFS=, - set -- $HOSTTYPE - IFS=$_ifs_ - while : - do case $# in - 0|1) break ;; - esac - shift - case $1 in - *cc*) CC=$1 - while : - do case $# in - 0|1) break ;; - esac - case $2 in - -*) case $assign_CCFLAGS in - ?*) assign_CCFLAGS="$assign_CCFLAGS " ;; - esac - assign_CCFLAGS="$assign_CCFLAGS$2" - shift - ;; - *) break - ;; - esac - done - ;; - esac - done -} - -# collect command line targets and definitions - -case $_PACKAGE_HOSTTYPE_ in -?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_ - KEEP_HOSTTYPE=1 - ;; -*) KEEP_HOSTTYPE=0 - ;; -esac -KEEP_PACKAGEROOT=0 -KEEP_SHELL=0 # set to 1 if SHELL is a known-good system shell, 2 if SHELL supplied by user -USER_VPATH= -args= -assign= -assign_CCFLAGS= -for i -do case $i in - *:*=*) args="$args $i" - continue - ;; - *=*) n=${i%%=*} v=${i#*=} - ;; - esac - case $i in - AR=*|LD=*|NM=*) - assign="$assign $n='$v'" - eval $n='$'v - ;; - CC=*) eval $n='$'v - ;; - CCFLAGS=*) - eval $n='$'v - assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\"" - ;; - HOSTTYPE=*) - eval $n='$'v - case $HOSTTYPE in - ?*) KEEP_HOSTTYPE=1 ;; - esac - ;; - PACKAGEROOT=*) - eval $n='$'v - case $PACKAGEROOT in - ?*) KEEP_PACKAGEROOT=1 ;; - esac - ;; - SHELL=*)eval $n='$'v - case $SHELL in - ?*) KEEP_SHELL=2 ;; - esac - ;; - VPATH=*)eval USER_$n='$'v - ;; - 'debug=1') - makeflags="$makeflags --debug-symbols" - ;; - 'strip=1') - makeflags="$makeflags --strip-symbols" - ;; - *=*) assign="$assign $n='$v'" - ;; - *) args="$args $i" - ;; - esac -done -case $HOSTTYPE in -*,*) hostopts $HOSTTYPE ;; -esac -case $assign_CCFLAGS in -?*) assign="$assign $assign_CCFLAGS" -esac -case $CC in -''|cc) ;; -*) export CC ;; -esac - -# grab action specific args - -case $action in -use) case $1 in - .) shift - PACKAGEROOT=$PWD - $show export PACKAGEROOT - esac - ;; -esac - -# true if arg is a valid PACKAGEROOT - -packageroot() # dir -{ - test -d "$1/lib/$command" || test -x "$1/bin/$command" -} - -# true if arg is executable - -executable() # ! command -{ - case $1 in - '!') test ! -x "$2" && test ! -x "$2.exe" ;; - *) test -x "$1" || test -x "$1.exe" ;; - esac -} - -# true if arg is executable command on $PATH - -onpath() # command -{ - _onpath_b=$1 - case $_onpath_b in - /*) if executable $_onpath_b - then _onpath_=$_onpath_b - return 0 - fi - return 1 - ;; - esac - IFS=':' - set -- $PATH - IFS=$ifs - for _onpath_d - do case $_onpath_d in - '') _onpath_d=. ;; - esac - if executable "$_onpath_d/$_onpath_b" - then _onpath_=$_onpath_d/$_onpath_b - return 0 - fi - done - return 1 -} - -# determine local host attributes - -hostinfo() # attribute ... -{ - case $DEBUG in - 1) set -x ;; - esac - map= - something= - path=$PATH - for i in $ccs - do PATH=$PATH:$i - done - for i in $use - do for j in $org - do PATH=$PATH:$i/$j/bin - done - PATH=$PATH:$i/bin - done - case $PACKAGE_PATH in - ?*) for i in $(echo "$PACKAGE_PATH" | sed 's,:, ,g') - do PATH=$PATH:$i/bin - done - ;; - esac - - # validate the args - - canon= - cc=$CC - for info - do case $canon in - -) canon=$info - ;; - *) case $info in - */*|*cCcC) - cc=$info - ;; - canon) canon=- - something=1 - ;; - cpu|name|type) - something=1 - ;; - *) err_out "$action: $info: unknown attribute" - ;; - esac - ;; - esac - done - case $canon in - -) err_out "$action: canon: host type name expected" - ;; - esac - case $something in - "") set "$@" type ;; - esac - case $DEBUG in - '') exec 9>&2 - exec 2>/dev/null - ;; - esac - - # compute the info - - _hostinfo_= - for info - do - case $info in - cpu) cpu=$(sysctl -n hw.ncpu) - case $cpu in - 123456789*) - _hostinfo_="$_hostinfo_ $cpu" - continue - ;; - esac - cpu=$(grep -ic '^processor *: *0123456789' /proc/cpuinfo) - case $cpu in - 123456789*) - _hostinfo_="$_hostinfo_ $cpu" - continue - ;; - esac - cpu=1 - # exact match - set \ - hinv '^Processor 0123456789' \ - psrinfo 'on-line' \ - 'cat /reg/LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ - 'cat /proc/registry/HKEY_LOCAL_MACHINE/Hardware/Description/System/CentralProcessor' '.' \ - - while : - do case $# in - 0) break ;; - esac - i=$($1 2>/dev/null | grep -c "$2") - case $i in - 123456789*) - cpu=$i - break - ;; - esac - shift;shift - done - case $cpu in - 0|1) set \ - /bin/mpstat - - while : - do case $# in - 0) break ;; - esac - if executable $1 - then case $($1 | grep -ic '^cpu ') in - 1) cpu=$($1 | grep -ic '^ *01234567890123456789* ') - break - ;; - esac - fi - shift - done - ;; - esac - case $cpu in - 0|1) # token match - set \ - /usr/kvm/mpstat 'cpu0123456789' \ - /usr/etc/cpustatus 'enable' \ - /usr/alliant/showsched 'CE' \ - 'ls /config/hw/system/cpu' 'cpu' \ - prtconf 'cpu-unit' \ - - while : - do case $# in - 0) break ;; - esac - i=$($1 2>/dev/null | tr ' ' ' - -' | grep -c "^$2") - case $i in - 123456789*) - cpu=$i - break - ;; - esac - shift;shift - done - ;; - esac - case $cpu in - 0|1) # special match - set \ - \ - hinv \ - '/^01234567890123456789* .* Processors*$/' \ - '/ .*//' \ - \ - /usr/bin/hostinfo \ - '/^01234567890123456789* .* physically available\.*$/' \ - '/ .*//' \ - - while : - do case $# in - 0) break ;; - esac - i=$($1 2>/dev/null | sed -e "${2}!d" -e "s${3}") - case $i in - 123456789*) - cpu=$i - break - ;; - esac - shift;shift;shift - done - ;; - esac - case $cpu in - 0|1) cpu=$( - cd "$TMPDIR" - tmp=hi$$ - trap 'set +o noglob; exec rm -f $tmp.*' 0 1 2 - cat > $tmp.c <<! -#include <stdio.h> -#include <pthread.h> -int main(void) -{ - printf("%d\n", pthread_num_processors_np()); - return 0; -} -! - for o in -lpthread '' - do if $CC $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 || - gcc $o -O -o $tmp.exe $tmp.c $o >/dev/null 2>&1 - then ./$tmp.exe - break - fi - done - ) - case $cpu in - 0123456789*) ;; - *) cpu=1 ;; - esac - ;; - esac - _hostinfo_="$_hostinfo_ $cpu" - ;; - name) _name_=$(hostname || uname -n || cat /etc/whoami || echo local) - _hostinfo_="$_hostinfo_ $_name_" - ;; - type|canon) - case $CROSS:$canon in - 0:) case $cc in - cc) case $KEEP_HOSTTYPE:$HOSTTYPE in - 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE - then KEEP_HOSTTYPE=1 - fi - ;; - esac - ;; - esac - case $KEEP_HOSTTYPE in - 1) _hostinfo_="$_hostinfo_ $HOSTTYPE" - continue - ;; - esac - ;; - esac - a=$($cc -dumpmachine $CCFLAGS 2>/dev/null) - case $a in - '') case $CCFLAGS in - ?*) a=$($cc -dumpmachine 2>/dev/null) ;; - esac - ;; - esac - case $a in - ''|*' '*|*/*:*) - ;; - *.*-*) _hostinfo_="$_hostinfo_ $a" - continue - ;; - *-*-*) case $canon in - '') canon=$a ;; - esac - ;; - *-*) case $canon in - '') canon=${a%-*}-unknown-${a#*-} ;; - esac - ;; - *) _hostinfo_="$_hostinfo_ $a" - continue - ;; - esac - IFS=: - set /$IFS$PATH - IFS=$ifs - shift - f=../lib/hostinfo/typemap - for i - do case $i in - "") i=. ;; - esac - case $canon in - '') case $cc in - /*|cc) ;; - *) if executable $i/$cc - then a=$($i/$cc -dumpmachine $CCFLAGS 2>/dev/null) - case $a in - '') case $CCFLAGS in - ?*) a=$($cc -dumpmachine 2>/dev/null) ;; - esac - ;; - esac - case $a in - ''|*' '*|*/*:*) - ;; - *-*) canon=$a - ;; - *) _hostinfo_="$_hostinfo_ $a" - continue 2 - ;; - esac - fi - ;; - esac - ;; - esac - if test -f "$i/$f" - then map="$(grep -v '^#' $i/$f) $map" - fi - done - - # inconsistent -dumpmachine filtered here - - case $canon in - *-*-linux-gnu* | *-*-linux-musl*) - ;; - *-linux-gnu* | *-linux-musl*) - # fix missing machine field, e.g. aarch64-linux-gnu => aarch64-unknown-linux-gnu - canon=${canon%%-*}-unknown-${canon#*-} ;; - esac - case -${canon}- in - --|*-powerpc-*) - h=$(hostname || uname -n || cat /etc/whoami) - case $h in - '') h=local ;; - esac - a=$(arch || uname -m || att uname -m || uname -s || att uname -s) - case $a in - *\ \ *) a=$(echo $a | sed "s/ /-/g") ;; - esac - case $a in - '') a=unknown ;; - esac - m=$(mach || machine || uname -p || att uname -p) - case $m in - *\ \ *) m=$(echo $m | sed "s/ /-/g") ;; - esac - case $m in - '') m=unknown ;; - esac - x=$(uname -a || att uname -a) - case $x in - '') x="unknown $host unknown unknown unknown unknown unknown" ;; - esac - set "" $h $a $m $x - expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8 - ;; - *) case $canon in - *-*) IFS=- - set "" $canon - shift - IFS=$ifs - case $# in - 2) host= mach= arch=$1 os=$2 sys= rel= ;; - *) host= mach=$2 arch=$1 os=$3 sys= rel= ;; - esac - case $os in - abcdefghijklmnopqrstuvwxyz*0123456789) - eval $(echo $os | sed -e 's/^\(^0123456789.*\)\.*\(.*\)/os=\1 rel=\2/') - ;; - esac - ;; - *) arch=$canon mach= os= sys= rel= - ;; - esac - ;; - esac - type=unknown - case $host in - *.*) host=$(echo $host | sed -e 's/\..*//') ;; - esac - case $arch in - aarch64) - # some call it aarch64, some arm64 -- let's stick to one - arch=arm64 - ;; - esac - case $mach in - unknown) - mach= - ;; - Rr0123012345678901234567890123456789) - mach=mips1 - ;; - Rr4012345678901234567890123456789) - mach=mips2 - ;; - Rr56789012345678901234567890123456789|Rr1234567890123456789012345678901234567890123456789) - mach=mips4 - ;; - pc) arch=i386 - mach= - ;; - PpOoWwEeRrPpCc) - arch=ppc - mach= - ;; - *) case $arch in - 3401234567890123456789) - os=ncr - arch=i386 - ;; - esac - ;; - esac - case $canon in - '') set \ - \ - /NextDeveloper -d next - \ - /config/hw/system/cpu -d tandem mach \ - - while : - do case $# in - 0) break ;; - esac - if test $2 $1 - then os=$3 - case $4 in - arch) mach=$arch ;; - mach) arch=$mach ;; - esac - break - fi - shift;shift;shift;shift - done - ;; - esac - case $os in - AIX*|aix*) - type=ibm.risc - ;; - HP-UX) case $arch in - 9000/78*) - type=hp.pa - ;; - */*) type=hp.$(echo $arch | sed 's,/,_,g') - ;; - *) type=hp.$arch - ;; - esac - ;; - IiRrIiXx*) - set xx $(hinv | sed -e '/^CPU:/!d' -e 's/CPU: *\(^ *\) *\(^ *\).*/\1 \2/' -e q | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - shift - type=$1 - n= - case $2 in - r0123012345678901234567890123456789) - n=1 - ;; - r4012301234567890123456789) - n=2 - ;; - r445678901234567890123456789|r5012345678901234567890123456789) - n=3 - ;; - r6789012345678901234567890123456789|r1234567890123456789012345678901234567890123456789) - n=4 - ;; - esac - case $rel in - 01234.*|5.012|5.012.*) - case $n in - 1) ;; - *) n=2 ;; - esac - ;; - 5.*) case $n in - 2) n=3 ;; - esac - ;; - esac - if executable $cc - then a=$cc - else IFS=: - set /$IFS$PATH - IFS=$ifs - shift - for i - do a=$i/$cc - if executable $a - then break - fi - done - fi - split=' -' - a=$(strings $a < /dev/null | sed -e 's/^abcdefghijklmnopqrstuvwxyz0123456789/ /g' -e 's/ */\'"$split"'/g' | sed -e "/^${type}0123456789$/!d" -e "s/^${type}//" -e q) - case $a in - 0123456789) n=$a ;; - esac - case $n in - 4) a=$($cc -${type}3 2>&1) - case $a in - *unknown*|*install*|*conflict*) - ;; - *) n=3 - ;; - esac - ;; - esac - a=$($cc -show F0oB@r.c 2>&1) - case $n:$a in - !2:*mips2*) n=2 ;; - !23:*mips3*) n=3 ;; - !234:*mips4*) n=4 ;; - esac - case $n:$a in - !2:*Oo32*) abi=-o32 ;; - !3:*Nn32*) abi=-n32 ;; - esac - mach=${type}$n - type=sgi.$mach - ;; - OSx*|SMP*|pyramid) - type=pyr - ;; - OS/390) type=mvs.390 - ;; - SsCcOo*) - type=sco - ;; - Ssol*) - v=$(echo $rel | sed -e 's/^25\.//' -e 's/\.^.*$//') - case $v in - 6789|1-90-9) - ;; - *) v= - ;; - esac - case $arch in - '') case $mach in - '') arch=sun4 ;; - *) arch=$mach ;; - esac - ;; - esac - case $arch in - sparc) arch=sun4 ;; - esac - type=sol$v.$arch - ;; - Ssun*)type=$(echo $arch | sed -e 's/\(sun.\).*/\1/') - case $type in - sparc) type=sun4 ;; - esac - case $rel in - 01234*) - ;; - '') case $os in - *OoSs) - ;; - *) type=sol.$type - ;; - esac - ;; - *) case $type in - '') case $mach in - sparc*) type=sun4 ;; - *) type=$mach ;; - esac - ;; - esac - v=$(echo $rel | sed -e 's/^25\.//' -e 's/\.^.*$//') - case $v in - 6789|1-90-9) - ;; - *) v= - ;; - esac - type=sol$v.$type - ;; - esac - case $type in - sun*|*.*) - ;; - *) type=sun.$type - ;; - esac - ;; - UuNnIiXx_SsVv) - type=unixware - ;; - UTS*|uts*) - if test -x /bin/u370 || test -x /bin/u390 - then type=uts.390 - else case $arch in - '') arch=$mach ;; - esac - type=uts.$arch - fi - ;; - $host) type=$arch - case $type in - *.*|*0123456789*86|*68*) - ;; - *) case $mach in - *0123456789*86|*68*|mips) - type=$type.$mach - ;; - esac - ;; - esac - ;; - unknown) - case $arch in - ?*) case $arch in - sun*) mach= ;; - esac - type=$arch - case $mach in - ?*) type=$type.$mach ;; - esac - ;; - esac - ;; - *) case $ver in - FTX*|ftx*) - case $mach in - *0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*) - mach=$(echo $mach | sed -e 's/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*$//') - ;; - esac - type=stratus.$mach - ;; - *) case $arch in - OoSs-/.2) - type=os2 - arch=$rel - ;; - *) type=$(echo $os | sed -e 's/0123456789.*//' -e 's/^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789..*//') - ;; - esac - case $type in - CcYyGgWwIiNn_*) - type=cygwin - ;; - UuWwIiNn*|Wwindows_01234567890123456789|Wwindows_NnTt) - type=win32 - arch=$(echo $arch | sed -e 's/_^_*$//') - ;; - esac - case $arch in - '') case $mach in - ?*) type=$type.$mach ;; - esac - ;; - *) type=$type.$arch ;; - esac - ;; - esac - esac - case $type in - 0123456789*) - case $mach in - ?*) type=$mach ;; - esac - case $type in - */MC) type=ncr.$type ;; - esac - ;; - *.*) ;; - *0123456789*86|*68*) - case $rel in - 34.0123456789*) - type=att.$type - ;; - esac - ;; - abcdefghijklmnopqrstuvwxyz*0123456789) - ;; - abcdefghijklmnopqrstuvwxyz*) case $mach in - $type) case $ver in - Fault*|fault*|FAULT*) - type=ft.$type - ;; - esac - ;; - ?*) case $arch in - '') type=$type.$mach ;; - *) type=$type.$arch ;; - esac - ;; - esac - ;; - esac - case $type in - *-_32|*-_64|*-_128) - bits=$(echo $type | sed 's,.*-_,,') - type=$(echo $type | sed 's,-_0-9*$,,') - ;; - *) bits= - ;; - esac - type=$(echo $type | sed -e 's%-+/.*%%' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) - case $type in - *.*) lhs=$(echo $type | sed -e 's/\..*//') - rhs=$(echo $type | sed -e 's/.*\.//') - case $rhs in - x0123456789*86) rhs=i$rhs ;; - 68*) rhs=m$rhs ;; - esac - case $rhs in - ix2345678986|i?x2345678986|*86pc) - rhs=i386 ;; - powerpc) rhs=ppc ;; - s0123456789*0123456789x) - rhs=$(echo $rhs | sed -e 's/x$/-64/') ;; - esac - case $rhs in - armabcdefghijklmnopqrstuvwxyz_0123456789*) - rhs=arm ;; - hppa) rhs=pa ;; - esac - case $lhs in - ?*coff|?*dwarf|?*elf) - case $lhs in - ?*coff) x=coff ;; - ?*dwarf)x=coff ;; - ?*elf) x=elf ;; - esac - lhs=$(echo ${lhs}XXX | sed -e "s/${x}XXX//") - ;; - esac - case $lhs in - bsdi) lhs=bsd ;; - darwin) case $(/usr/bin/cc --version) in - *'(GCC)'*) case $rel in - '' | 0-9.* | 10.*) - lhs=darwin07 ;; - *) lhs=darwin11 ;; - esac ;; - esac - ;; - freebsd) case $rel in - 01234.*) lhs=${lhs}4 ;; - 123456789*.*) lhs=${lhs}$(echo $rel | sed -e 's/\..*//') ;; - esac - ;; - hpux) lhs=hp ;; - mvs) rhs=390 ;; - esac - case $lhs in - '') type=$rhs ;; - $rhs) type=$lhs ;; - *) type=$lhs.$rhs ;; - esac - ;; - esac - case $type in - sgi.mips*) - case $mach in - mips2) type=sgi.$mach - abi=-o32 - ;; - mips3) type=sgi.$mach - abi=-n32 - ;; - mips456789) - type=sgi.$mach - case $abi in - *-n32) ;; - *) abi=-64 ;; - esac - ;; - *) pwd=$PWD - cd "$TMPDIR" - tmp=hi$$ - trap 'set +o noglob; rm -rf $tmp.*' 0 1 2 - cat > $tmp.a.c <<! -extern int b(void); -int main(void) { return b(); } -! - cat > $tmp.b.c <<! -int b(void) { return 0; } -! - abi= - if $cc -c $tmp.a.c - then for i in -n32 -o32 -64 - do if $cc $i -c $tmp.b.c && - $cc -o $tmp.exe $tmp.a.o $tmp.b.o - then abi=$i - for i in 2 3 4 5 6 7 8 9 - do case $i:$abi in - 2:-n32|2:-64|3:-64) - continue - ;; - esac - if $cc $abi -mips$i -c $tmp.b.c && - $cc -o $tmp.exe $tmp.a.o $tmp.b.o - then type=$(echo $type | sed -e 's/.$//')$i - break - fi - done - break - fi - done - fi </dev/null >/dev/null 2>&1 - (set +o noglob; rm -rf $tmp.*) - trap - 0 1 2 - cd $pwd - ;; - esac - case $type$abi in - sgi.mips2-o32) - ;; - sgi.mips3) - type=$type-o32 - ;; - sgi.mips3-n32) - ;; - sgi.mips4) - type=$type-o32 - ;; - sgi.mips456789-64) - ;; - *) type=$type$abi - ;; - esac - ;; - *) case $bits in - '') bits=$( set -e - cd "$TMPDIR" - tmp=hi$$ - trap 'set +o noglob; exec rm -rf "$tmp".*' 0 1 2 - echo 'int main(void) { return 0; }' > $tmp.a.c - checkcc - $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1 - file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ) - case $bits in - *\ 64-bit* | *\ 64\ bit* | *\ 64bit*) - bits=64 ;; - *) bits= ;; - esac - ;; - esac - ;; - esac - case $bits in - 32) case $type in - *.i386) bits= ;; - esac - ;; - esac - case $bits in - ?*) type=$type-$bits ;; - esac - - # last chance mapping - - set "" "" $map - while : - do case $# in - 012) break ;; - esac - shift;shift - eval " case \$type in - $1) type=\$2; break ;; - esac" - done - _hostinfo_="$_hostinfo_ $type" - ;; - esac - done - set -- $_hostinfo_ - _hostinfo_=$* - - # restore the global state - - PATH=$path - case $DEBUG in - '') exec 2>&9 - exec 9>&- - ;; - esac -} - -# info message - -note() # message ... -{ - printf "$command: %s\\n" "$@" >&2 -} - -err_out() -{ - note "$@" - exit 1 -} - -trace() -( - PS4="${action}: executing: " - exec 2>&1 # trace to standard output - set -o xtrace - "$@" -) - -# cc checks -# -# CC: compiler base name name -# cc: full path, empty if not found - -checkcc() -{ - cc= - if onpath $CC - then cc=$_onpath_ - else case $CC in - cc) if onpath clang - then CC=clang - cc=$_onpath_ - elif onpath gcc - then CC=gcc - cc=$_onpath_ - fi - ;; - esac - fi - case $cc in - '') case $action in - make|test) err_out "$CC: not found" ;; - *) note "warning: $CC: not found" ;; - esac - ;; - esac -} - -# some actions have their own PACKAGEROOT or kick out early - -case $action in -host) eval u=$package_use - case $u in - $PACKAGE_USE) - ;; - *) if onpath $0 - then case $_onpath_ in - */arch/$HOSTTYPE/bin/package) - KEEP_HOSTTYPE=1 - ;; - *) KEEP_HOSTTYPE=0 - ;; - esac - else KEEP_HOSTTYPE=0 - fi - ;; - esac - hostinfo $args - echo $_hostinfo_ - exit 0 - ;; -export|setup|use) - x= - ;; -*) x= - eval u=$package_use - case $u in - $PACKAGE_USE) - case :$PATH: in - *:$INSTALLROOT/bin:*) - case $LIBPATH: in - $INSTALLROOT/bin:$INSTALLROOT/lib:*) - case $SHLIB_PATH: in - $INSTALLROOT/lib:*) - x=1 - ;; - esac - ;; - esac - ;; - esac - ;; - esac - ;; -esac -run=- -case $x in -1) : accept the current package use environment - INITROOT=$PACKAGEROOT/src/cmd/INIT - checkcc - ;; -*) hosttype= - case $KEEP_PACKAGEROOT in - 0) case $action in - use) PACKAGEROOT= - case $show in - echo) exec=echo make=echo show=echo ;; - esac - set -- $args - case $# in - 0) ;; - *) case $1 in - -|.) ;; - /*) PACKAGEROOT=$1 - ;; - *) i=$(echo ~$1) - if packageroot $i - then PACKAGEROOT=$i - else for i in $(echo $HOME | sed -e 's,/^/*$,,') $usr $use - do if packageroot $i/$1 - then PACKAGEROOT=$i/$1 - break - fi - done - case $PACKAGEROOT in - '') hosttype=$1 ;; - esac - fi - ;; - esac - shift - ;; - esac - run="$@" - ;; - esac - case $PACKAGEROOT in - '') PACKAGEROOT=$PWD ;; - esac - - # . must be within the PACKAGEROOT tree - - i=X$PACKAGEROOT - IFS=/ - set $i - IFS=$ifs - while : - do i=$1 - shift - case $i in - X) break ;; - esac - done - case $PACKAGEROOT in - //*) d=/ ;; - *) d= ;; - esac - case $1 in - home) k=1 ;; - *) k=0 ;; - esac - for i - do case $i in - '') continue ;; - esac - d=$d/$i - case $k in - 2) k=1 - ;; - 1) k=0 - ;; - 0) case $i in - arch) k=2 - ;; - *) if packageroot $d - then PACKAGEROOT=$d - fi - ;; - esac - ;; - esac - done - ;; - esac - INITROOT=$PACKAGEROOT/src/cmd/INIT - $show PACKAGEROOT=$PACKAGEROOT - $show export PACKAGEROOT - export PACKAGEROOT - - # initialize the architecture environment - - case $KEEP_HOSTTYPE in - 0) hostinfo type - HOSTTYPE=$_hostinfo_ - ;; - 1) _PACKAGE_HOSTTYPE_=$HOSTTYPE - export _PACKAGE_HOSTTYPE_ - ;; - esac - $show HOSTTYPE=$HOSTTYPE - $show export HOSTTYPE - export HOSTTYPE - INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE - case $action in - install|make|test|view) - ;; - *) if test ! -d $INSTALLROOT - then INSTALLROOT=$PACKAGEROOT - fi - ;; - esac - $show INSTALLROOT=$INSTALLROOT - $show export INSTALLROOT - export INSTALLROOT - - # check the basic package hierarchy - - case $action in - export|use) - packageroot $PACKAGEROOT || err_out "$PACKAGEROOT: invalid package root directory" - case $KEEP_HOSTTYPE:$hosttype in - 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype - then KEEP_HOSTTYPE=1 - HOSTTYPE=$hosttype - else err_out "$hosttype: package root not found" - fi - ;; - esac - ;; - *) packageroot $PACKAGEROOT || { - case $KEEP_PACKAGEROOT in - 1) ;; - *) err_out "$PACKAGEROOT: must be in the package root directory tree" - ;; - esac - } - - for i in arch arch/$HOSTTYPE - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - for i in lib - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - - # no $INITROOT means INIT already installed elsewhere - - if test -d $INITROOT - then - # update the basic package commands - - for i in mamprobe - do test -h $PACKAGEROOT/bin/$i 2>/dev/null || - case $(ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null) in - "$INITROOT/$i.sh"*) - note "update $PACKAGEROOT/bin/$i" - $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit - $exec chmod +x $PACKAGEROOT/bin/$i || exit - ;; - esac - done - fi - ;; - esac - path=$PATH - PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH - checkcc - PATH=$path - case $cc in - ?*) if test -f $INITROOT/hello.c - then - # check if $CC (full path $cc) is a cross compiler - - ( - cd "$TMPDIR" || exit 3 - cp $INITROOT/hello.c pkg$$.c || exit 3 - $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { - if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 - then err_out "${warn}$CC: must be a C compiler (not C++)" - else cat pkg$$.e - err_out "${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" - fi - } - if ./pkg$$.exe >/dev/null 2>&1 - then code=0 - else code=1 - fi - (set +o noglob; rm -f pkg$$.*) - exit $code - ) - code=$? - case $code in - 1) CROSS=1 ;; - esac - fi - ;; - esac - EXECTYPE=$HOSTTYPE - EXECROOT=$INSTALLROOT - case $CROSS in - 0) # dll hackery -- why is this so complicated? - - abi= - case $HOSTTYPE in - sgi.mips0123456789*) - x=rld - if executable /lib32/$x || executable /lib64/$x - then case $INSTALLROOT in - */sgi.mips0123456789*) - u=$(echo $INSTALLROOT | sed -e 's,-^-/*$,,' -e 's,.$,,') - ;; - *) u= - ;; - esac - for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64" - do eval $a - case $v in - N32) case $n:$HOSTTYPE in - *-n32:*-n32) ;; - *-n32:*) continue ;; - *:*-n32) continue ;; - esac - ;; - esac - case $l in - ?*) if executable ! /$l/$x - then continue - fi - ;; - esac - case $u in - '') case $HOSTTYPE in - sgi.mips$n|sgi.mips$n-*) - abi="$abi 'd=$INSTALLROOT v=$v'" - ;; - *) continue - ;; - esac - ;; - *) if test -d $u$n - then abi="$abi 'd=$u$n v=$v'" - fi - ;; - esac - done - fi - ;; - esac - case $abi in - '') abi="'d=$INSTALLROOT v='" ;; - esac - p=0 - eval " - for a in $abi - do eval \$a - eval \" - case \\\$LD_LIBRARY\${v}_PATH: in - \\\$d/lib:*) - ;; - *) x=\\\$LD_LIBRARY\${v}_PATH - case \\\$x in - ''|:*) ;; - *) x=:\\\$x ;; - esac - LD_LIBRARY\${v}_PATH=\$d/lib\\\$x - export LD_LIBRARY\${v}_PATH - p=1 - ;; - esac - \" - done - " - case $LD_LIBRARY_PATH in - '') ;; - *) for d in $lib - do case $HOSTTYPE in - *64) if test -d ${d}64 - then d=${d}64 - fi - ;; - esac - case :$LD_LIBRARY_PATH: in - *:$d:*) ;; - *) if test -d $d - then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d - p=1 - fi - ;; - esac - done - ;; - esac - case $p in - 1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH - $show export LD_LIBRARY_PATH - export LD_LIBRARY_PATH - ;; - esac - case $LIBPATH: in - $INSTALLROOT/bin:$INSTALLROOT/lib:*) - ;; - *) case $LIBPATH in - '') LIBPATH=/usr/lib:/lib ;; - esac - LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH - $show LIBPATH=$LIBPATH - $show export LIBPATH - export LIBPATH - ;; - esac - case $SHLIB_PATH: in - $INSTALLROOT/lib:*) - ;; - *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} - $show SHLIB_PATH=$SHLIB_PATH - $show export SHLIB_PATH - export SHLIB_PATH - ;; - esac - case $DYLD_LIBRARY_PATH: in - $INSTALLROOT/lib:*) - ;; - *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} - $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH - $show export DYLD_LIBRARY_PATH - export DYLD_LIBRARY_PATH - ;; - esac - case $_RLD_ROOT in - $INSTALLROOT/arch*) ;; - ':') _RLD_ROOT=$INSTALLROOT/arch:/ ;; - /|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;; - *) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;; - esac - $show _RLD_ROOT=$_RLD_ROOT - $show export _RLD_ROOT - export _RLD_ROOT - - # now set up PATH - # - # NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations - - case $PATH: in - $PACKAGEROOT/bin:*) - ;; - *) PATH=$PACKAGEROOT/bin:$PATH - ;; - esac - case $PATH: in - $INSTALLROOT/bin:*) - ;; - *) PATH=$INSTALLROOT/bin:$PATH - test -n "${MANPATH+s}" && MANPATH=$INSTALLROOT/man:$MANPATH - ;; - esac - case $FPATH: in - $INSTALLROOT/fun:*) - ;; - *) FPATH=$INSTALLROOT/fun${FPATH:+:$FPATH} - ;; - esac - $show "export PATH=$PATH" - export PATH - $show "export FPATH=$FPATH" - export FPATH - if test -n "${MANPATH+s}" - then export MANPATH - $show "export MANPATH=$PATH" - fi - ;; - *) for i in package - do if onpath $i - then EXECROOT=$(echo $_onpath_ | sed -e 's,//*^/*//*^/*$,,') - EXECTYPE=$(echo $EXECROOT | sed -e 's,.*/,,') - break - fi - done - case $HOSTTYPE in - $EXECTYPE) - OCC=$CC - CC=cc - hostinfo type - EXECTYPE=$_hostinfo_ - case $HOSTTYPE in - $EXECTYPE) - err_out "$CC seems to be a cross-compiler." \ - "Set HOSTTYPE to something other than the native $EXECTYPE." \ - "If not, your $TMPDIR directory may be mounted without execute permission." \ - "Try exporting TMPDIR as a directory where you can execute binary files." - ;; - esac - ;; - esac - $show EXECTYPE=$EXECTYPE - $show export EXECTYPE - export EXECTYPE - ;; - esac - $show EXECROOT=$EXECROOT - $show export EXECROOT - export EXECROOT - - # grab a decent default shell - - case $KEEP_SHELL in - 0) save_PATH=$PATH - if PATH=$(getconf PATH 2>/dev/null) - then PATH=$PATH:$path - else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path - fi - for i in ksh ksh93 mksh yash bash sh - do if onpath "$i" && checksh "$_onpath_" - then SHELL=$_onpath_ - KEEP_SHELL=1 - break - fi - done - PATH=$save_PATH - unset save_PATH - case $KEEP_SHELL in - 0) err_out "Cannot find a good default shell; please supply SHELL=/path/to/shell" - ;; - esac - ;; - esac - export SHELL - $show SHELL=$SHELL - $show export SHELL - - # tame the environment - - case $action in - use) ;; - *) ENV= - ERROR_OPTIONS= - export ENV ERROR_OPTIONS - ;; - esac - - # finalize the views - - case $USER_VPATH in - '') case $VPATH in - ?*) IFS=':' - set -- $VPATH - IFS=$ifs - USER_VPATH= - for i - do case $i in - */arch/$HOSTTYPE) ;; - */arch/*/*) ;; - */arch/*) continue ;; - esac - if packageroot $i - then case $USER_VPATH in - '') USER_VPATH=$i ;; - ?*) USER_VPATH=$USER_VPATH:$i ;; - esac - fi - done - esac - ;; - esac - case $USER_VPATH in - ?*) IFS=':' - set -- $USER_VPATH - IFS=$ifs - USER_VPATH= - USER_VPATH_CHAIN= - p=$PACKAGEROOT - for i - do case $i in - ''|$PACKAGEROOT|$INSTALLROOT) - ;; - ?*) USER_VPATH=$USER_VPATH:$i - USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" - p=$i - ;; - esac - done - ;; - esac - ;; -esac - -PACKAGEBIN=$INSTALLROOT/lib/package -case $action:$run in -use:-) set -- $args - case $# in - 0) ;; - *) shift ;; - esac - run="$@" - ;; -esac - -# HOSTTYPE specific package profile - -if test -r $INSTALLROOT/lib/package/profile -then . $INSTALLROOT/lib/package/profile -fi - -# more Cygwin hassles - -case $HOSTTYPE in -cygwin.*) - lose= - case $CYGWIN in - *nontsec*) - lose=ntsec - ;; - *ntsec*);; - *) exe=$TMPDIR/pkg$$.exe - rm -f "$exe" - : > "$exe" - if test -x "$exe" - then lose=ntsec - fi - ;; - esac - case $CYGWIN in - *nobinmode*) - case $lose in - '') lose=binmode ;; - *) lose="$lose binmode" ;; - esac - ;; - esac - case $lose in - ?*) err_out "$HOSTTYPE: export '$lose' in CYGWIN or languish in Windows" - ;; - esac - ;; -esac - -# set up the view state - -VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT" -VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH -$show VPATH=$VPATH -$show export VPATH -export VPATH -IFS=':' -set -- $VPATH -IFS=$ifs -for i -do case $i in - */arch/*/*) - VIEW_src="$VIEW_src $i" - ;; - */arch/*) - VIEW_bin="$VIEW_bin $i" - ;; - *) - VIEW_src="$VIEW_src $i" - ;; - esac - VIEW_all="$VIEW_all $i" -done - -# return 0 if arg in src|bin|all view - -view() # test -|type src|bin|all file -{ - case $1 in - -dfsx)_view_T_=$1; shift ;; - *) _view_T_=-f ;; - esac - case $1 in - -) _view_t_= ;; - *) _view_t_=$1 ;; - esac - shift - case $1 in - all) shift; _view_v_=$VIEW_all ;; - bin) shift; _view_v_=$VIEW_bin ;; - src) shift; _view_v_=$VIEW_src ;; - *) _view_v_=$VIEW_all ;; - esac - case $1 in - /*) if test $_view_T_ $1 - then _view_=$1 - return 0 - fi - ;; - *) for _view_d_ in $_view_v_ - do if test $_view_T_ $_view_d_/$1 - then _view_=$_view_d_/$1 - return 0 - fi - done - ;; - esac - _view_= - case $_view_t_ in - ?*) note "$1: $_view_t_ not found" ;; - esac - return 1 -} - -# determine the package and targets - -case $action in -*) package= - target= - set -- $args - while test "$#" -gt 0 - do case $1 in - ''|-) target="$target $package" - package= - ;; - *) if view - src "lib/package/$1.pkg" - then package="$package $1" - else target="$target $package $1" - package= - fi - ;; - esac - shift - done - ;; -esac - -# check that cmd args are up to date a.out's - -checkaout() # cmd ... -{ - case $cc in - '') _PACKAGE_cc=0 - ;; - *) _PACKAGE_cc=1 - test -f "$INITROOT/hello.c" && test -f "$INITROOT/p.c" || { - note "$INITROOT: INIT package source not found" - return 1 - } - - for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return - done - ;; - esac - case $_PACKAGE_cc in - '') case $cc in - '') _PACKAGE_cc=0 ;; - *) _PACKAGE_cc=1 ;; - esac - ;; - esac - for i - do eval j=\$_PACKAGE_AOUT_$i - case $j in - '') eval _PACKAGE_AOUT_$i=1 ;; - *) continue ;; - esac - k=$_PACKAGE_cc - if test -f $INITROOT/$i.c - then k=${k}1 - else k=${k}0 - fi - if executable $EXECROOT/bin/$i - then k=${k}1 - else k=${k}0 - fi - : $k : compiler : source : binary : - case $k in - *00) view - bin/$i && continue ;; - esac - case $k in - 000) note "$i: not found: download the INIT package $HOSTTYPE binary to continue" - return 1 - ;; - 010) note "$i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" - return 1 - ;; - 100) note "$i: not found: download the INIT package source or $HOSTTYPE binary to continue" - return 1 - ;; - 110) case $CROSS in - 1) note "$i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" - return 1 - ;; - esac - ;; - ?01) : accept binary - continue - ;; - 011) : accept binary - continue - ;; - ??1) case $CROSS in - 1) continue ;; - esac - ;; - esac - case $(ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null) in - "$INITROOT/$i.c"*) - note "update $INSTALLROOT/bin/$i" - if test ! -d $INSTALLROOT/bin - then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return - done - fi - $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return - test -f $i.o && $exec rm -f $i.o - i=$PATH - PATH=/bin - PATH=$i - ;; - esac - done - return 0 -} - - -# capture command output - -capture() # file command ... -{ - tee_pid= - case $make:$noexec in - :) case $action in - install|make|view) - o=$action - ;; - *) case $package in - ''|*' '*) - o=$action - ;; - *) o=$package - ;; - esac - ;; - esac - d=$PACKAGEBIN/gen - test -d $d || $exec mkdir $d - o=$d/$o - case $o in - $output)o=$o.out - s= - ;; - *) output=$o - if test -f $o.old - then mv $o.old $o.out.1 - if test -f $o.out - then mv $o.out $o.out.2 - fi - elif test -f $o.out - then for i in $(set +o noglob; ls -t $o.out.? 2>/dev/null) - do break - done - case $i in - *.1) i=2 ;; - *.2) i=3 ;; - *.3) i=4 ;; - *.4) i=5 ;; - *.5) i=6 ;; - *.6) i=7 ;; - *.7) i=8 ;; - *.8) i=9 ;; - *) i=1 ;; - esac - mv $o.out $o.out.$i - fi - o=$o.out - : > $o - note "$action output captured in $o" - s="$command: $action start at $(date) in $INSTALLROOT" - cmd='case $error_status in 0) r=done;; *) r=failed;; esac;' - cmd=$cmd' echo "$command: $action $r at $(date) in $INSTALLROOT"' - case $quiet in - 0) cmd="$cmd 2>&1 | tee -a $o" ;; - *) cmd="$cmd >> $o" ;; - esac - trap "$cmd" 0 - trap "error_status=1; $cmd; trap 1 0; kill -1 $$" 1 - trap "error_status=1; $cmd; trap 2 0; kill -2 $$" 2 - ;; - esac - case $quiet in - 0) # Connect 'tee' to a FIFO instead of a pipe, so that we can obtain - # the build's exit status and use it for $error_status - rm -f $o.fifo - mkfifo -m 600 $o.fifo || exit - ( - sleep 1 - # unlink early - exec rm $o.fifo - ) & - tee -a $o < $o.fifo & - tee_pid=$! - o=$o.fifo - ;; - esac - { - case $s in - ?*) echo "$s" ;; - esac - case $action in - '' | make) - # list main environment values - for i in CC SHELL $env - do case $i in - FPATH | MANPATH) - continue ;; # not relevant for building - esac - eval "echo \"$i=\$$i\"" - done - ;; - esac - "$@" - } < /dev/null > $o 2>&1 - ;; - *) $make "$@" - ;; - esac - exit_status=$? - if test "$exit_status" -gt "$error_status" - then error_status=$exit_status - fi - case $tee_pid in - ?*) # allow 'tee' to catch up before returning to prompt - wait "$tee_pid" - ;; - esac -} - -make_recurse() # dir -{ - for _make_recurse_j in $makefiles - do if view - $1/$_make_recurse_j - then return - fi - done -} - -do_install() # dir command ... -{ - cd "$INSTALLROOT" - printf 'install: installing from %s\n' "$PWD" - dd=$1 - shift - case $dd in - '' | !/*) - err_out "ERROR: destination directory '$dd' must begin with a /" ;; - /) - # avoid //foo - dd='' ;; - esac - # commands to install by default - test "$#" -eq 0 && set -- ksh shcomp - for f - do test -f "bin/$f" || err_out "Not found: $f" "Build first? Run $0 make" - done - # set install directories - bindir=$dd/bin - man1dir=${dd:-/usr}/share/man/man1 - fundir=${dd:-/usr}/share/fun - # and off we go - trace mkdir -p "$bindir" "$man1dir" || exit - for f - do # install executable - trace cp "bin/$f" "$bindir/" || exit - # install manual and autoloadable functions - case $f in - ksh) trace cp "$PACKAGEROOT/src/cmd/ksh93/sh.1" "$man1dir/ksh.1" || exit - trace mkdir -p "$fundir" || exit - (set +o noglob; trace cp "$PACKAGEROOT"/src/cmd/ksh93/fun/* "$fundir/") || exit - ;; - *) # AT&T --man, etc. is a glorified error message: writes to stderr and exits with status 2 :-/ - # So we cannot reliably check for success; must check the result, too. - manfile=$man1dir/${f##*/}.1 - bin/ksh -c '"$@" 2>&1' _ "bin/$f" --\?\?nroff >$manfile - if test "$?" -eq 2 && - read -r magic < "$manfile" && - test "X$magic" = 'X.\" format with nroff|troff|groff -man' # string from optget.c - then printf '%s: executing: %s --\\?\\?nroff > %s\n' "$action" "bin/$f" "$manfile" - else rm "$manfile" - fi - ;; - esac - done -} - -error_status=0 - -case $action in - -clean|clobber) - cd "$PACKAGEROOT" || exit - note "cleaning up flat view" - # clean up all links with arch dir except bin/package - $exec find "arch/$HOSTTYPE" -path "arch/$HOSTTYPE/bin/package" -o -type f -exec "$SHELL" -c ' - first=y - for h # loop through the PPs - do case $first in - y) set -- # clear PPs ("for" uses a copy) - first=n ;; - esac - p=${h#"arch/$HOSTTYPE/"} # get flat view path - if test "$p" -ef "$h" # is it part of the flat view? - then set -- "$@" "$p" # add to new PPs - fi - done - exec rm -f -- "$@" # rm all at once: fast - ' "$0" {} + - case $flat in - 0) note "deleting arch/$HOSTTYPE" - $exec rm -rf arch/$HOSTTYPE - ;; - esac - note "removing empty directories" - $exec find . -depth -type d -exec rmdir {} + 2>/dev/null - ;; - -export) case $INSTALLROOT in - $PACKAGEROOT) - INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE - ;; - esac - case $only in - 0) v='$i=' ;; - *) v= ;; - esac - set -- $target $package - test "$#" -eq 0 && set -- $env - while test "$#" -gt 0 - do i=$1 - eval "echo \"$v\$$i\"" - shift - done - ;; - -install)cd $PACKAGEROOT - # TODO: breaks on directories with spaces or glob characters; make arguments handling robust - test -n "$args" || err_out "Usage: $0 install ROOTDIR COMMANDNAME ... " - capture do_install $args - ;; - -make|view) - cd $PACKAGEROOT - - # check for some required commands - - must="$AR" - warn="$NM" - test="$must $warn" - have= - IFS=: - set /$IFS$PATH - IFS=$ifs - shift - for t in $test - do if executable $t - then have="$have $t" - fi - done - for d - do for t in $test - do case " $have " in - *" $t "*) - ;; - *) if executable $d/$t - then have="$have $t" - fi - ;; - esac - done - done - for t in $test - do case " $have " in - *" $t "*) - ;; - *) case " $must " in - *" $t "*) - err_out "$t: not found -- must be on PATH to $action" - ;; - *) note "warning: $t: not found -- some $action actions may fail" - ;; - esac - ;; - esac - done - - # verify the top view - - if test ! -d $PACKAGEROOT/src - then note "no source packages to make" - exit 0 - elif test ! -d $INSTALLROOT/src - then note "initialize the $INSTALLROOT view" - fi - for i in arch arch/$HOSTTYPE - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - for i in bin bin/ok bin/ok/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8 - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - make_recurse src - o= k= - for i in $makefiles - do case $o in - ?*) o="$o -o" k="$k|" ;; - esac - o="$o -name $i" - k="$k$i" - done - o="( $o ) -print" - for d in $src - do i=src/$d - if test -d $i - then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - make_recurse $i - for j in $(cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/^/*$,,' | sort -u) - do case $j in - $k|$MAKESKIP) continue ;; - esac - test -d $INSTALLROOT/$i/$j || - $exec mkdir -p $INSTALLROOT/$i/$j || exit - done - fi - done - - # check $CC and { ar cc ld ldd } intercepts - - h="${HOSTTYPE} ${HOSTTYPE}.*" - case $HOSTTYPE in - *.*) t=$(echo $HOSTTYPE | sed 's/.^.*//') - h="$h $t" - ;; - *) t=$HOSTTYPE - ;; - esac - case $t in - *0123456789) - t=$(echo $t | sed 's/0123456789*$//') - h="$h $t" - ;; - esac - case $CC in - cc) c=cc - b=$INSTALLROOT/bin/$c - t=$INSTALLROOT/lib/package/gen/$c.tim - intercept=0 - for k in $h - do for s in $INITROOT/$c.$k - do test -x "$s" || continue - if cmp -s "$s" "$b" >/dev/null 2>&1 - then intercept=1 - break 2 - fi - case $(ls -t "$t" "$b" "$s" 2>/dev/null) in - $t*) ;; - $b*) cc=$b - ;; - $s*) $exec cd $INSTALLROOT/lib/package/gen - tmp=pkg$$ - $exec eval "echo 'int main(void){return 0;}' > $tmp.c" - if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && - test -x $tmp.exe - then case $HOSTTYPE in - *.mips*)$s -version >/dev/null 2>&1 || s= ;; - esac - case $s in - ?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit - $exec chmod +x "$b" || exit - cc=$b - intercept=1 - note "update $b" - ;; - esac - fi - (set +o noglob; $exec rm -rf $tmp.*) - $exec touch "$t" - cd $PACKAGEROOT - ;; - esac - break 2 - done - done - case $intercept in - 1) c=ld - b=$INSTALLROOT/bin/$c - for k in $h - do for s in $INITROOT/$c.$k - do test -x "$s" || continue - case $(ls -t "$b" "$s" 2>/dev/null) in - $b*) ;; - $s*) $exec cp "$s" "$b" - note "update $b" - ;; - esac - done - done - ;; - esac - ;; - esac - c=ldd - b=$INSTALLROOT/bin/$c - for t in $h - do s=$INITROOT/$c.$t - test -x "$s" || continue - onpath $c || - case $(ls -t "$b" "$s" 2>/dev/null) in - $b*) ;; - $s*) $exec cp "$s" "$b" - note "update $b" - ;; - esac - done - c=ar - b=$INSTALLROOT/bin/$c - for t in $h - do s=$INITROOT/$c.$t - test -x "$s" || continue - case $(ls -t "$b" "$s" 2>/dev/null) in - $b*) ;; - $s*) $exec cp "$s" "$b" - note "update $b" - ;; - esac - done - case $cc in - /*) ;; - *) err_out "$CC: not found -- set CC=C-compiler" - ;; - esac - case $exec in - '') cd $INSTALLROOT/lib/package/gen - tmp=pkg$$ - echo 'int main(void){return 0;}' > $tmp.c - if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && - test -x $tmp.exe - then : ok - else note "$CC: failed to compile this program:" - cat $tmp.c >&2 - if test -s $tmp.err - then cat $tmp.err >&2 - else note "$CC: not a C compiler" - fi - (set +o noglob; rm -rf $tmp.*) - exit 1 - fi - (set +o noglob; rm -rf $tmp.*) - cd $PACKAGEROOT - ;; - esac - - # remember the default $CC - - case $CC in - cc) ;; - *) if test -x $INSTALLROOT/bin/cc - then case $(sed 1q $INSTALLROOT/bin/cc) in - ": $CC :") - CC=cc - export CC - ;; - *) assign="$assign CC=\"\$CC\"" - ;; - esac - else case $CROSS in - 1) assign="$assign CC=\"\$CC\"" - ;; - *) case $exec in - '') { - echo ": $CC :" - echo "$CC \"\$@\"" - } > $INSTALLROOT/bin/cc - chmod +x $INSTALLROOT/bin/cc - ;; - *) note "generate a $INSTALLROOT/bin/cc wrapper for $CC" - ;; - esac - CC=cc - export CC - ;; - esac - fi - ;; - esac - - # no $INITROOT means INIT already installed elsewhere - - if test -d $INITROOT - then - # update probe scripts - - for i in lib/probe lib/probe/C lib/probe/C/make - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - i=$INSTALLROOT/lib/probe/C/make/probe - j=$INITROOT/C+probe - k=$INITROOT/make.probe - case $(ls -t $i $j $k 2>/dev/null) in - $i*) ;; - *) if test -f "$j" && test -f "$k" - then note "update $i" - case $exec in - '') cat $j $k > $i || exit - ;; - *) echo "cat $j $k > $i" - ;; - esac - $exec chmod +x $i || exit - fi - ;; - esac - fi - - # initialize mamake - - checkaout mamake || exit - - case $action in - view) exit 0 ;; - esac - - # check against previous compiler and flags - - err= - for var in CC CCFLAGS CCLDFLAGS LDFLAGS - do store=$INSTALLROOT/lib/package/gen/$var - eval "new=\$$var" - if test -f $store - then old=$(cat $store) - case $old in - "$new") ;; - *) case $old in - '') old="(none)" ;; - *) old="'$old'" ;; - esac - case $new in - '') new="(none)" ;; - *) new="'$new'" ;; - esac - note "$var changed from $old to $new" - err=y ;; - esac - else test -d $INSTALLROOT/lib/package/gen && case $new in - '') ;; - *) echo "$new" ;; - esac > $store - fi - done - case $err,${FORCE_FLAGS+f} in - y,) err_out "This would likely break the build. Restore the flag(s)," \ - "or delete the build directory and rebuild from scratch." - ;; - esac - unset err var store old new - - # all work under $INSTALLROOT/src - - $make cd $INSTALLROOT/src - - # record the build host name - - case $exec in - '') hostinfo name - echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host - ;; - esac - - # separate flags from target list - - case $target in - *-*) a= - for t in $target - do case $t in - -*) makeflags="$makeflags $t" - ;; - *) a="$a $t" - ;; - esac - done - target=$a - ;; - esac - - # mamprobe data should have been generated by this point - - case $exec in - '') if test ! -f "$INSTALLROOT/bin/.paths" || test -w "$INSTALLROOT/bin/.paths" - then N=' -' - b= f= h= n= p= u= B= L= - if test -f $INSTALLROOT/bin/.paths - then exec < $INSTALLROOT/bin/.paths - while read x - do case $x in - '#'?*) case $h in - '') h=$x ;; - esac - ;; - *BUILTIN_LIB=*) b=$x - ;; - *FPATH=*) f=$x - ;; - *PLUGIN_LIB=*) p=$x - ;; - *) case $u in - ?*) u=$u$N ;; - esac - u=$u$x - ;; - esac - done - fi - ifs=$IFS - m= - case $p in - ?*) b= - ;; - esac - case $b in - ?*) IFS='=' - set $b - IFS=$ifs - shift - p="PLUGIN_LIB=$*" - case $b in - NnOo*) p=no$p ;; - esac - m=1 - ;; - esac - case $f in - '') f="FPATH=../fun" - m=1 - ;; - esac - case $h in - '') h='# use { no NO } prefix to permanently disable #' ;; - esac - case $p in - '') p="PLUGIN_LIB=cmd" - if ( set +o noglob - grep '^setv mam_cc_DIALECT .* EXPORT=ADLL' "$INSTALLROOT"/lib/probe/C/mam/* - ) >/dev/null 2>&1 - then p=no$p - fi - m=1 - ;; - esac - case $m in - 1) case $u in - ?*) u=$N$u ;; - esac - echo "$h$N$p$N$f$N$u" > $INSTALLROOT/bin/.paths - ;; - esac - fi - ;; - esac - - # run from separate copies since ksh may be rebuilt - - case $EXECROOT in - $INSTALLROOT) - $make cd $INSTALLROOT/bin - if executable /bin/cp - then cp=/bin/cp - else cp=cp - fi - if executable /bin/mv - then mv=/bin/mv - else mv=mv - fi - if executable /bin/rm - then rm=/bin/rm - else rm=rm - fi - for i in \ - ksh tee cp ln mv rm \ - *ast*.dll *cmd*.dll *dll*.dll *shell*.dll - do executable $i && { - cmp -s $i ok/$i 2>/dev/null || { - test -f ok/$i && - $exec $rm ok/$i </dev/null - test -f ok/$i && - $exec $mv ok/$i ok/$i.old </dev/null - test -f ok/$i && - case $exec:$i in - :ksh) - err_out "ok/$i: cannot update may be in use by a running process remove manually and try again" - ;; - esac - $exec $cp $i ok/$i - } - } - done - if test "$KEEP_SHELL" -eq 0 && executable ok/ksh - then SHELL=$INSTALLROOT/bin/ok/ksh - export SHELL - fi - case :$PATH: in - *:$INSTALLROOT/bin/ok:*) - ;; - *) PATH=$INSTALLROOT/bin/ok:$PATH - export PATH - ;; - esac - $make cd $INSTALLROOT/src - ;; - esac - - # build with mamake - - note "make with mamake" - case $target in - '') target="install" ;; - esac - eval capture mamake \$makeflags \$noexec \$target $assign - - case $HOSTTYPE in - darwin.*) - # clean up macOS .dSYM bundles belonging to deleted temps - cd "$PACKAGEROOT" || exit - $exec find "arch/$HOSTTYPE" -type d -name '*.dSYM' -exec "$SHELL" -c ' - first=y - for d # loop through the PPs - do case $first in - y) set -- # clear PPs ("for" uses a copy) - first=n ;; - esac - e=${d%.dSYM} # get exe name - if ! test -f "$e" # nonexistent? - then set -- "$@" "$d" # add to new PPs - fi - done - exec rm -rf -- "$@" # rm all at once: fast - ' "$0" {} + - ;; - esac - - if test -d "$PACKAGEROOT/lib/package/gen" - then a='updating' - flat=1 - else a='creating' - fi - case $flat in - 1) note "$a flat view" - cd "$PACKAGEROOT" || exit - $exec find "arch/$HOSTTYPE" -type f ! -name '*.old' -exec "$SHELL" -c ' - for h - do p=${h#"arch/$HOSTTYPE/"} - test "$h" -ef "$p" && continue # already created - d=${p%/*} - test -d "$d" || mkdir -p "$d" || exit - ln -f "$h" "$p" 2>/dev/null || ln -sf "$INSTALLROOT/$p" "$p" || exit - done - ' "$0" {} + - ;; - esac - ;; - -results)set -- $target - def=make - dir=$PACKAGEBIN/gen - case $verbose in - 0) filter=yes ;; - *) filter=cat ;; - esac - path=0 - suf=out - on= - while : - do case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - error*|fail*) - filter=errors - ;; - make|test|view) - def=$1 - ;; - old) suf=old - ;; - on) case $# in - 1) err_out "$action: $1: host pattern argument expected" - ;; - esac - shift - case $on in - ?*) on="$on|" ;; - esac - on="$on$1" - ;; - path) path=1 - ;; - test) def=test - ;; - *) break - ;; - esac - shift - done - case $dir in - */admin)case $on in - '') on="*" ;; - *) on="@($on)" ;; - esac - def=$def.log/$on - ;; - esac - case $# in - 0) set "$def" ;; - esac - m= - t= - for i - do k=0 - eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf - - shift - for j - do case $j in - -) case $k in - 1) continue 2 ;; - esac - ;; - *) if test -f $j - then k=1 - case /$j in - */test.*) t="$t $j" ;; - *) m="$m $j" ;; - esac - fi - ;; - esac - done - err_out "$i action output not found" - done - sep= - case $t in - ?*) case $path in - 0) for j in $t - do echo "$sep==> $j <==" - sep=$nl - case $filter in - cat) $exec cat $j - ;; - errors) $exec grep -E -i '\*\*\*|FAILES|^TEST.* 1234567890123456789* error|core.*dump' $j | sed -e '/^TEST.\//s,/^ */,,' - ;; - *) $exec grep -E -i '^TEST|FAIL' $j - ;; - esac - done - ;; - 1) echo $t - ;; - esac - ;; - esac - case $m in - ?*) case $path in - 0) case $filter in - cat) cat $m - ;; - *) if test -f $HOME/.pkgresults - then i=$(cat $HOME/.pkgresults) - case $i in - '|'*) ;; - *) i="|$i" ;; - esac - else i= - fi - for j in $m - do echo "$sep==> $j <==" - sep=$nl - case $filter in - errors) $exeg grep -E '^pax:|\*\*\*' $j - ;; - *) $exec grep -E -iv '^($||\+\|cc^-:|kill |make.*(file system time|has been replaced)|so|0123456789+ error|uncrate |0123456789+ block|ar: creat|iffe: test: |conf: (check|generate|test)|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|0123456789*$|(checking|creating|touch) /abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789)| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | - $exec grep : - ;; - esac - done - ;; - esac - ;; - 1) echo $m - ;; - esac - esac - ;; - -test) # run all available default regression tests, using our newly compiled shell unless overridden - - cd "$INSTALLROOT" || err_out "run '$0 make' first" - if test "$KEEP_SHELL" -lt 2 - then executable bin/ksh || err_out "build ksh first, or supply a SHELL=/path/to/ksh argument" - SHELL=$INSTALLROOT/bin/ksh - fi - export SHELL - set -f - set -- ${args:-src} - cd "$1" || exit - capture mamake test - ;; - -use) # finalize the environment - - if test "$KEEP_SHELL" -lt 2 && executable "$INSTALLROOT/bin/ksh" - then SHELL=$INSTALLROOT/bin/ksh - fi - x=:.. - for d in $(set +o noglob; cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/^/*$,,' | sort -u) - do x=$x:$INSTALLROOT/$d - done - x=$x:$INSTALLROOT - case $CDPATH: in - $x:*) ;; - *) CDPATH=$x:$CDPATH - $show CDPATH=$CDPATH - $show export CDPATH - export CDPATH - ;; - esac - eval PACKAGE_USE=$package_use - export PACKAGE_USE - unset LC_ALL # respect the user's locale again; avoids multibyte corruption - - # run the command - - case $run in - '') note "You are now entering a new environment set up to use the package in:" \ - " $INSTALLROOT" \ - "You're using the shell:" \ - " $SHELL" \ - "Type 'exit' to leave and go back to normal." - case $show in - ':') $exec exec $SHELL ;; - esac - ;; - *) $exec exec $SHELL -c "$run" - ;; - esac - ;; - -*) err_out "$action: internal error" - ;; - -esac - -exit "$error_status"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/ttys
Deleted
@@ -1,3 +0,0 @@ -hdr termios,termio,sgtty -sys termios,termio,ioctl,bsdtty,nttyio,filio -lib tcgetattr,tcgetpgrp termios.h
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/mamexec
Deleted
@@ -1,307 +0,0 @@ -: -# -# Glenn Fowler -# AT&T Bell Laboratories -# -# make abstract machine executor with state -# -# @(#)mamexec (gsf@research.att.com) 07/17/94 -# -# mamexec -dfins target ... < mamfile -# -# NOTE: variables defined in this script may conflict with -# mamfile variables -# - -_command_=mamexec -_debug_=: -_diff_=. -_error_='exit 1' -_exec_=eval -_force_= -_list_= -_same_=. -_set_= -_silent_= -_state_list_=MAMlist -_state_time_=MAMtime -_tmp_=/tmp/mam.$$.mam - -trap 'rm -f $_tmp_' 0 -trap 'exit 2' 1 2 -while : -do case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - -*) case $1 in - -*abceghjklmopqrtuvwxyz_A-Z0-9*) # !... not portable - echo "Usage: $_command_ -dfins target ... < mamfile" >&2; exit 2 - ;; - *) case $1 in - *d*) _debug_="eval echo $_command_: debug: >&2" ;; - esac - case $1 in - *f*) _force_=1 ;; - esac - case $1 in - *i*) _error_=: ;; - esac - case $1 in - *n*) _exec_=echo ;; - esac - case $1 in - *s*) _silent_=1 ;; - esac - ;; - esac - ;; - *) break - ;; - esac - shift -done -_select_= -while : -do case $# in - 0) break ;; - esac - case $1 in - *=*) eval $1 - ;; - *) case $_select_ in - "") _select_=$1 ;; - *) _select_="$_select_|$1" ;; - esac - ;; - esac - shift -done -case $_select_ in -"") _select_="*" ;; -esac -(set -e; false || true) && _set_=e || echo $_command_: command errors ignored because of shell botch >&2 -case $_silent_ in -"") _set_=x$_set_ - ;; -*) case $_exec_ in - "echo") _exec_=: ;; - esac - ;; -esac -case $_exec_ in -"eval") _begin_="(" - _end_=") </dev/null" - case $_set_ in - ?*) _set_="set -$_set_;" ;; - esac - ;; -*) _set_= - ;; -esac - -if test -f $_state_list_ -a -f $_state_time_ -then mamstate $_state_list_ < $_state_list_ | sort > $_tmp_ - for _i_ in `comm -12 $_state_time_ $_tmp_ | sed 's/ .*//'` - do case $_same_ in - .) _same_=$_i_ ;; - *) _same_="$_same_|$_i_" ;; - esac - done -fi - -_index_=_ -_match_= -case `(echo ok | (read -r a; echo $a) 2>/dev/null)` in -ok) _read_='read -r' - ;; -*) # read strips \ -- thanks a lot - # tmp file avoids char at a time read - _read_=read - sed 's/\\/\\\\/g' > $_tmp_ - exec < $_tmp_ - rm -f $_tmp_ - ;; -esac -_old_=1 -_ifs_=$IFS -while IFS=' '; $_read_ _op_ _arg_ _val_ -do IFS=$_ifs_ - case $_op_ in - "note") continue - ;; - "info") case $_arg_ in - "mam") _old_= ;; - esac - continue - ;; - "setv") eval _data_='$'$_arg_ - case $_index_:$_data_ in - __*:*|*:) - case $_exec_ in - "eval") ;; - *) echo "$_arg_=$_val_" ;; - esac - eval $_arg_="$_val_" "</dev/null" - ;; - esac - case $_arg_:$mam_cc_L in - "CC:") ( - set - - mkdir /tmp/mam$$ - cd /tmp/mam$$ - echo 'main(void){return 0;}' > main.c - code=1 - if $CC -c main.c 2>/dev/null - then if $CC -L. main.o -lc 2>/dev/null - then $CC -L. main.o -lc > libc.a 2>/dev/null || code=0 - fi - fi - cd /tmp - rm -rf /tmp/mam$$ - exit $code - ) </dev/null && mam_cc_L=' ' - ;; - esac - continue - ;; - "make") eval _name_$_index_=$_name_ - eval _prev_$_index_=$_prev_ - eval _cmds_$_index_='"$_cmds_"' - eval _attr_$_index_=$_attr_ - eval _name_=$_arg_ - _prev_=$_index_ - case " $_val_ " in - *" metarule "*) _attr_=m$_attr_ ;; - esac - _cmds_= - eval " case \"$_name_\" in - $_select_) - case \"$_select_\" in - \"*\") _select_=$_name_ ;; - esac - _match_=1 - _attr_=x$_attr_ - ;; - esac" - case $_force_ in - "") eval " case \"$_name_\" in - $_diff_)_attr_=u$_attr_ ;; - $_same_);; - *) _attr_=u$_attr_ ;; - esac" - ;; - *) _attr_=u$_attr_ - ;; - esac - case $_attr_ in - *u*) case $_diff_ in - .) _diff_=$_name_ ;; - *) _diff_="$_diff_|$_name_" ;; - esac - ;; - esac - _index_=_$_index_ - eval _name_$_index_=$_name_ - eval _prev_$_index_=$_prev_ - eval _cmds_$_index_=$_cmds_ - eval _attr_$_index_=$_attr_ - eval _list_='"'"$_list_"' -'$_name_'"' - continue - ;; - "prev") case $_force_ in - "") eval " case \"$_arg_\" in - $_diff_)_attr_=u$_attr_ ;; - $_same_) ;; - *) _attr_=u$_attr_ ;; - esac" - ;; - *) _attr_=u$_attr_ - ;; - esac - continue - ;; - esac - case $_index_ in - _) echo $_op_: missing make op >&2; continue ;; - esac - case $_op_ in - "attr") case $_val_ in - "meta"|"suff") _attr_=m$_attr_ ;; - esac - ;; - "exec"|"....") - case $_old_ in - "") _arg_=$_val_ - ;; - *) case $_val_ in - ?*) _arg_="$_arg_ $_val_" ;; - esac - ;; - esac - case $_cmds_ in - "") _cmds_=$_arg_ - ;; - *) _cmds_="$_cmds_ -$_arg_" - ;; - esac - ;; - "done") eval _arg_=$_arg_ - _prop_= - case $_arg_ in - $_name_)case $_attr_ in - *m*) ;; - *x*u*|*u*x*) - case $_cmds_ in - "") case $_attr_ in - *u*) _prop_=u ;; - esac - ;; - *) $_exec_ "$_begin_$_set_$_cmds_$_end_" || - { - _code_=$? - case $_set_ in - *-*e*) ;; - *) case $_cmds_ in - *if*then*fi*|"||") _code_=0 ;; - esac - ;; - esac - case $_code_ in - 0) ;; - *) echo "*** exit code $_code_ making $_name_" >&2 - $_error_ - ;; - esac - } - _prop_=u - ;; - esac - ;; - esac - _index_=$_prev_ - eval _name_='$'_name_$_index_ - eval _prev_='$'_prev_$_index_ - eval _cmds_='$'_cmds_$_index_ - eval _attr_=$_prop_'$'_attr_$_index_ - ;; - *) echo $_val_: $_op_ $_name_ expected >&2 - ;; - esac - ;; - esac -done -IFS=$_ifs_ -case $_match_ in -"") echo "$_command_: don't know how to make $_select_" >&2; $_error_ ;; -esac -case $_exec_ in -"eval") echo "$_list_" > $_state_list_ - mamstate $_state_list_ < $_state_list_ | sort > $_state_time_ - ;; -esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/mamstate.c
Deleted
@@ -1,70 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* David Korn <dgk@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -#pragma clang diagnostic ignored "-Wparentheses" -/* - * AT&T Bell Laboratories - * make abstract machine file state support - * - * mamstate reference file ... | <files - * - * stdout is list of <file,delta> pairs where delta - * is diff between reference and file times - * non-existent files are not listed - */ - -#if !lint -static char id = "\n@(#)$Id: mamstate (AT&T Bell Laboratories) 1989-06-26 $\0\n"; -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> - -int main(int argc, char **argv) -{ - char* s; - int c; - long ref; - struct stat st; - char buf1024; - - if (!(s = *++argv) || stat(s, &st)) - { - fprintf(stderr, "Usage: mamstate reference file ... | <files \n"); - exit(1); - } - ref = (long)st.st_mtime; - if (s = *++argv) do - { - if (!stat(s, &st)) - printf("%s %ld\n", s, (long)st.st_mtime - ref); - } while (s = *++argv); - else do - { - s = buf; - while ((c = getchar()) != EOF && c != ' ' && c != '\n') - if (s < buf + sizeof(buf) - 1) *s++ = c; - if (s > buf) - { - *s = 0; - if (!stat(buf, &st)) - printf("%s %ld\n", buf, (long)st.st_mtime - ref); - } - } while (c != EOF); - exit(0); -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/select.sh
Deleted
@@ -1,53 +0,0 @@ -######################################################################## -# # -# This software is part of the ast package # -# Copyright (c) 1982-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # -# and is licensed under the # -# Eclipse Public License, Version 2.0 # -# # -# A copy of the License is available at # -# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # -# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # -# # -# David Korn <dgk@research.att.com> # -# Martijn Dekker <martijn@inlv.org> # -# # -######################################################################## - -. "${SHTESTS_COMMON:-${0%/*}/_common}" - -PS3='ABC ' - -cat > $tmp/1 <<\! -1) foo -2) bar -3) bam -! - -select i in foo bar bam -do case $i in - foo) break;; - *) err_exit "select 1 not working" - break;; - esac -done 2> /dev/null <<! -1 -! - -unset i -select i in foo bar bam -do case $i in - foo) err_exit "select foo not working" 2>&3 - break;; - *) if $REPLY != foo - then err_exit "select REPLY not correct" 2>&3 - fi - ( set -u; : $i ) || err_exit "select: i not set to null" 2>&3 - break;; - esac -done 3>&2 2> $tmp/2 <<! -foo -! - -exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/atexit.c
Deleted
@@ -1,108 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* Johnothan King <johnothanking@protonmail.com> * -* * -***********************************************************************/ - -/* - * ANSI C atexit() - * arrange for func to be called LIFO on exit() - */ - -#include <ast.h> - -#if _lib_atexit - -NoN(atexit) - -#else - -#if _lib_onexit - -extern int onexit(void(*)(void)); - -int -atexit(void (*func)(void)) -{ - return onexit(func); -} - -#else - -struct list -{ - struct list* next; - void (*func)(void); -}; - -static struct list* funclist; - -extern void _exit(int); - -int -atexit(void (*func)(void)) -{ - struct list* p; - - if (!(p = newof(0, struct list, 1, 0))) return -1; - p->func = func; - p->next = funclist; - funclist = p; - return 0; -} - -void -_ast_atexit(void) -{ - struct list* p; - - while (p = funclist) - { - funclist = p->next; - (*p->func)(); - } -} - -#if _std_cleanup - -#if _lib__cleanup -extern void _cleanup(void); -#endif - -void -exit(int code) -{ - _ast_atexit(); -#if _lib__cleanup - _cleanup(); -#endif - _exit(code); -} - -#else - -void -_cleanup(void) -{ - _ast_atexit(); -} - -#endif - -#endif - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/basename.c
Deleted
@@ -1,47 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * basename(3) implementation - */ - -#include <ast_std.h> - -extern char *basename(char *pathname) -{ - char *first, *last; - for(first=last=pathname; *last; last++); - /* back over trailing '/' */ - if(last>first) - while(*--last=='/' && last > first); - if(last==first && *last=='/') - { - /* all '/' or "" */ - if(*first=='/') - if(*++last=='/') /* keep leading // */ - last++; - } - else - { - for(first=last++;first>pathname && *first!='/';first--); - if(*first=='/') - first++; - } - *last = 0; - return first; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/closelog.c
Deleted
@@ -1,47 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * closelog implementation - */ - -#include <ast.h> - -#if _lib_syslog - -NoN(closelog) - -#else - -#include "sysloglib.h" - -void -closelog(void) -{ - if (log.fd >= 0) - { - close(log.fd); - log.fd = -1; - } - log.facility = 0; - log.flags = 0; - log.mask = ~0; - log.attempt = 0; -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/fakelink.h
Deleted
@@ -1,30 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * AT&T Bell Laboratories - * - * fake symbolic link private interface - */ - -#ifndef _FAKELINK_H -#define _FAKELINK_H - -#define FAKELINK_MAGIC "!<symlink>" - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/openlog.c
Deleted
@@ -1,54 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * openlog implementation - */ - -#include <ast.h> - -#if _lib_syslog - -NoN(openlog) - -#else - -#include "sysloglib.h" - -void -openlog(const char* ident, int flags, int facility) -{ - int n; - - if (ident) - { - n = strlen(ident); - if (n >= sizeof(log.ident)) - n = sizeof(log.ident) - 1; - memcpy(log.ident, ident, n); - log.identn = 0; - } - else - log.ident0 = 0; - log.facility = facility; - log.flags = flags; - if (!(log.flags & LOG_ODELAY)) - sendlog(NULL); -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/readlink.c
Deleted
@@ -1,53 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#include <ast.h> - -#if _lib_readlink - -NoN(readlink) - -#else - -#include "fakelink.h" - -#include <error.h> - -int -readlink(const char* path, char* buf, int siz) -{ - int fd; - int n; - - if (siz > sizeof(FAKELINK_MAGIC)) - { - if ((fd = open(path, O_RDONLY|O_cloexec)) < 0) - return -1; - if (read(fd, buf, sizeof(FAKELINK_MAGIC)) == sizeof(FAKELINK_MAGIC) && !strcmp(buf, FAKELINK_MAGIC) && (n = read(fd, buf, siz)) > 0 && !bufn - 1) - { - close(fd); - return n; - } - close(fd); - } - errno = ENOSYS; - return -1; -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/realpath.c
Deleted
@@ -1,46 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* Johnothan King <johnothanking@protonmail.com> * -* * -***********************************************************************/ -/* - * realpath implementation - */ - -#define realpath ______realpath -#define resolvepath ______resolvepath - -#include <ast.h> - -#undef realpath -#undef resolvepath - -#undef _def_map_ast -#include <ast_map.h> - -extern int resolvepath(const char*, char*, size_t); - -extern char* -realpath(const char* file, char* path) -{ - /* @lkoutsofios: path may be NULL */ - if (!path) { - if (!(path = malloc (PATH_MAX))) - return NULL; - } - return resolvepath(file, path, PATH_MAX) > 0 ? path : NULL; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/setlogmask.c
Deleted
@@ -1,44 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * syslog implementation - */ - -#include <ast.h> - -#if _lib_syslog - -NoN(setlogmask) - -#else - -#include "sysloglib.h" - -int -setlogmask(int mask) -{ - int old_mask; - - old_mask = log.mask; - if (mask) - log.mask = mask; - return old_mask; -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strchr.c
Deleted
@@ -1,53 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#include <ast.h> - -#if _lib_strchr - -NoN(strchr) - -#else - -#undef strchr - -#if _lib_index - -#undef index - -extern char* index(const char*, int); - -char* -strchr(const char* s, int c) -{ - return index(s, c); -} - -#else - -char* -strchr(const char* s, int c) -{ - do if (*s == c) return (char*)s; while(*s++); - return NULL; -} - -#endif - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strrchr.c
Deleted
@@ -1,56 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#include <ast.h> - -#if _lib_strrchr - -NoN(strrchr) - -#else - -#undef strrchr - -#if _lib_rindex - -#undef rindex - -extern char* rindex(const char*, int); - -char* -strrchr(const char* s, int c) -{ - return rindex(s, c); -} - -#else - -char* -strrchr(const char* s, int c) -{ - const char* r; - - r = 0; - do if (*s == c) r = s; while(*s++); - return (char*)r; -} - -#endif - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strstr.c
Deleted
@@ -1,60 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#define strstr ______strstr - -#include <ast.h> - -#undef strstr - -#if _lib_strstr - -NoN(strstr) - -#else - -extern char* -strstr(const char* s1, const char* s2) -{ - int c1; - int c2; - const char* t1; - const char* t2; - - if (s2) - { - if (!*s2) - return (char*)s1; - c2 = *s2++; - while (c1 = *s1++) - if (c1 == c2) - { - t1 = s1; - t2 = s2; - do - { - if (!*t2) - return (char*)s1 - 1; - } while (*t1++ == *t2++); - } - } - return NULL; -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/symlink.c
Deleted
@@ -1,51 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#include <ast.h> - -#if _lib_symlink - -NoN(symlink) - -#else - -#include "fakelink.h" - -#include <error.h> - -int -symlink(const char* a, char* b) -{ - if (*a == '/' && (*(a + 1) == 'd' || *(a + 1) == 'p' || *(a + 1) == 'n') && (!strncmp(a, "/dev/tcp/", 9) || !strncmp(a, "/dev/udp/", 9) || !strncmp(a, "/proc/", 6) || !strncmp(a, "/n/", 3))) - { - int n; - int fd; - - if ((fd = open(b, O_CREAT|O_TRUNC|O_WRONLY|O_cloexec, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0) - return -1; - n = strlen(a) + 1; - n = (write(fd, FAKELINK_MAGIC, sizeof(FAKELINK_MAGIC)) != sizeof(FAKELINK_MAGIC) || write(fd, a, n) != n) ? -1 : 0; - close(fd); - return n; - } - errno = ENOSYS; - return -1; -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/syslog.c
Deleted
@@ -1,207 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * syslog implementation - */ - -#include <ast.h> - -#if _lib_syslog - -NoN(syslog) - -#else - -#define LOG_TABLES - -#include "sysloglib.h" - -#include <error.h> -#include <tm.h> - -Syslog_state_t log = { LOG_USER, -1, 0, ~0 }; - -static const Namval_t attempt = -{ - "/dev/log", 0, - "var/log/syslog", 0, - "lib/syslog/log", 0, - "/dev/console", LOG_CONS, -}; - -const Namval_t log_facility = -{ - "default", 0, - "user", LOG_USER, - "kernel", LOG_KERN, - "mail", LOG_MAIL, - "daemon", LOG_DAEMON, - "security", LOG_AUTH, - "syslog", LOG_SYSLOG, - "lpr", LOG_LPR, - "news", LOG_NEWS, - "uucp", LOG_UUCP, - "cron", LOG_CRON, - "audit", LOG_AUDIT, - "logalert", LOG_LFMT, -#ifdef LOG_SYSTEM2 - "system2", LOG_SYSTEM2, -#endif -#ifdef LOG_SYSTEM1 - "system1", LOG_SYSTEM1, -#endif -#ifdef LOG_SYSTEM0 - "system0", LOG_SYSTEM0, -#endif - 0, 0 -}; - -const Namval_t log_severity = -{ - "panic", LOG_EMERG, - "alert", LOG_ALERT, - "critical", LOG_CRIT, - "error", LOG_ERR, - "warning", LOG_WARNING, - "notice", LOG_NOTICE, - "info", LOG_INFO, - "debug", LOG_DEBUG, - 0, 0 -}; - -void -sendlog(const char* msg) -{ - char* s; - Namval_t* p; - int n; - - n = msg ? strlen(msg) : 0; - for (;;) - { - if (log.fd < 0) - { - char bufPATH_MAX; - - if (log.attempt >= elementsof(attempt)) - break; - p = (Namval_t*)&attemptlog.attempt++; - if (p->value && !(p->value & log.flags)) - continue; - if (*(s = p->name) != '/' && !(s = pathpath(buf, s, "", PATH_REGULAR|PATH_READ, sizeof(buf)))) - continue; - if ((log.fd = open(s, O_WRONLY|O_APPEND|O_NOCTTY|O_cloexec)) < 0) - continue; -#if !O_cloexec - fcntl(log.fd, F_SETFD, FD_CLOEXEC); -#endif - } - if (!n || write(log.fd, msg, n) > 0) - break; - close(log.fd); - log.fd = -1; - } - if (n && (log.flags & LOG_PERROR)) - write(2, msg, n); -} - -static int -extend(Sfio_t* sp, void* vp, Sffmt_t* dp) -{ - if (dp->fmt == 'm') - { - dp->flags |= SFFMT_VALUE; - dp->fmt = 's'; - dp->size = -1; - *((char**)vp) = fmterror(errno); - } - return 0; -} - -void -vsyslog(int priority, const char* format, va_list ap) -{ - int c; - char* s; - Sfio_t* sp; - Sffmt_t fmt; - char buf16; - - if (!LOG_FACILITY(priority)) - priority |= log.facility; - if (!(priority & log.mask)) - return; - if (sp = sfstropen()) - { - sfputr(sp, fmttime("%b %d %H:%M:%S", time(NULL)), -1); - if (log.flags & LOG_LEVEL) - { - if ((c = LOG_SEVERITY(priority)) < elementsof(log_severity)) - s = (char*)log_severityc.name; - else - sfsprintf(s = buf, sizeof(buf), "debug%d", c); - sfprintf(sp, " %-8s ", s); - if ((c = LOG_FACILITY(priority)) < elementsof(log_facility)) - s = (char*)log_facilityc.name; - else - sfsprintf(s = buf, sizeof(buf), "local%d", c); - sfprintf(sp, " %-8s ", s); - } -#if _lib_gethostname - if (!*log.host && gethostname(log.host, sizeof(log.host)-1)) - strcpy(log.host, "localhost"); - sfprintf(sp, " %s", log.host); -#endif - if (*log.ident) - sfprintf(sp, " %s", log.ident); - if (log.flags & LOG_PID) - { - if (!*log.ident) - sfprintf(sp, " "); - sfprintf(sp, "%d", getpid()); - } - if (format) - { - sfprintf(sp, ": "); - memset(&fmt, 0, sizeof(fmt)); - fmt.version = SFIO_VERSION; - fmt.form = (char*)format; - fmt.extf = extend; - va_copy(fmt.args, ap); - sfprintf(sp, "%!", &fmt); - } - if ((s = sfstrseek(sp, 0, SEEK_CUR)) && *(s - 1) != '\n') - sfputc(sp, '\n'); - if (s = sfstruse(sp)) - sendlog(s); - sfstrclose(sp); - } -} - -void -syslog(int priority, const char* format, ...) -{ - va_list ap; - - va_start(ap, format); - vsyslog(priority, format, ap); - va_end(ap); -} - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/syslog.h
Deleted
@@ -1,114 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* Johnothan King <johnothanking@protonmail.com> * -* * -***********************************************************************/ -/* - * POSIX syslog interface definitions - */ - -#ifndef _SYSLOG_H -#define _SYSLOG_H - -#include <stdarg.h> - -#define LOG_PRIBITS 3 /* priority bits */ -#define LOG_FACBITS 7 /* facility bits */ - -#define LOG_PRIMASK ((1<<LOG_PRIBITS)-1) -#define LOG_FACMASK (((1<<LOG_FACBITS)-1)<<LOG_PRIBITS) - -#define LOG_PRI(p) ((p)&((1<<LOG_PRIBITS)-1)) -#define LOG_FAC(p) (((p)>>LOG_PRIBITS)&((1<<LOG_FACBITS)-1)) - -#define LOG_MAKEPRI(f,p) (((f)<<LOG_PRIBITS)|(p)) - -/* syslog priority severity levels */ - -#define LOG_EMERG 0 /* panic condition */ -#define LOG_ALERT 1 /* should be corrected immediately */ -#define LOG_CRIT 2 /* critical condition */ -#define LOG_ERR 3 /* error condition */ -#define LOG_WARNING 4 /* warning condition */ -#define LOG_NOTICE 5 /* no error but may need intervention */ -#define LOG_INFO 6 /* informational message */ -#define LOG_DEBUG 7 /* debug message */ - -/* setlogmask masks */ - -#define LOG_MASK(s) (1<<(s)) /* individual severity s */ -#define LOG_UPTO(s) ((1<<((s)+1))-1)/* up to and including s */ - -/* syslog facilities */ - -#define LOG_KERN (0<<LOG_PRIBITS) /* kernel */ -#define LOG_USER (1<<LOG_PRIBITS) /* user process -- default */ -#define LOG_MAIL (2<<LOG_PRIBITS) /* mail */ -#define LOG_DAEMON (3<<LOG_PRIBITS) /* daemon */ -#define LOG_AUTH (4<<LOG_PRIBITS) /* security/authorization */ -#define LOG_SYSLOG (5<<LOG_PRIBITS) /* syslog internal */ -#define LOG_LPR (6<<LOG_PRIBITS) /* line printer */ -#define LOG_NEWS (7<<LOG_PRIBITS) /* network news */ -#define LOG_UUCP (8<<LOG_PRIBITS) /* uucp */ -#define LOG_CRON (9<<LOG_PRIBITS) /* cron */ -#define LOG_AUDIT (13<<LOG_PRIBITS) /* audit daemon */ -#define LOG_LFMT (14<<LOG_PRIBITS) /* logalert */ -#define LOG_LOCAL0 (16<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL1 (17<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL2 (18<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL3 (19<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL4 (20<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL5 (21<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL6 (22<<LOG_PRIBITS) /* reserved for local use */ -#define LOG_LOCAL7 (23<<LOG_PRIBITS) /* reserved for local use */ - -#define LOG_NFACILITIES 24 - -/* openlog flags */ - -#define LOG_PID 0x01 /* log the PID with each message */ -#define LOG_CONS 0x02 /* log to console if errors in sending */ -#define LOG_NDELAY 0x08 /* open right now */ -#define LOG_ODELAY 0x04 /* delay open until syslog() is called */ -#define LOG_NOWAIT 0x10 /* don't wait() for any child processes */ -#define LOG_PERROR 0x20 /* log to stderr too */ -#define LOG_LEVEL 0x40 /* tag messages with facility/level */ - -#ifdef LOG_TABLES - -/* encoding support */ - -#include <ast_namval.h> - -#define log_facility _log_facility -#define log_severity _log_severity - -#define LOG_FACILITY(p) LOG_FAC(p) /* get facility index from pri */ -#define LOG_SEVERITY(p) LOG_PRI(p) /* get severity from pri */ - -extern const Namval_t log_facility; -extern const Namval_t log_severity; - -#endif - -extern void closelog(void); -extern void openlog(const char*, int, int); -extern int setlogmask(int); -extern void syslog(int, const char*, ...); -extern void vsyslog(int, const char*, va_list); - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/sysloglib.h
Deleted
@@ -1,51 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* Johnothan King <johnothanking@protonmail.com> * -* * -***********************************************************************/ -/* - * POSIX syslog implementation definitions - */ - -#ifndef _SYSLOGLIB_H -#define _SYSLOGLIB_H - -#include <syslog.h> - -#define log _log_info_ -#define sendlog _log_send_ - -/* - * NOTE: syslog() has a static initializer for Syslog_state_t log - */ - -typedef struct -{ - int facility; /* openlog facility */ - int fd; /* log to this fd */ - int flags; /* openlog flags */ - unsigned int mask; /* setlogmask mask */ - int attempt; /* logfile attempt state */ - char ident64; /* openlog ident */ - char host64; /* openlog host name */ -} Syslog_state_t; - -extern Syslog_state_t log; - -extern void sendlog(const char*); - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/stack.h
Deleted
@@ -1,73 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Research - * - * homogeneous stack routine definitions - */ - -#ifndef _STACK_H -#define _STACK_H - -typedef struct stacktable* STACK; /* stack pointer */ -typedef struct stackposition STACKPOS; /* stack position */ - -struct stackblock /* stack block cell */ -{ - void** stack; /* actual stack */ - struct stackblock* prev; /* previous block in list */ - struct stackblock* next; /* next block in list */ -}; - -struct stackposition /* stack position */ -{ - struct stackblock* block; /* current block pointer */ - int index; /* index within current block */ -}; - -struct stacktable /* stack information */ -{ - struct stackblock* blocks; /* stack table blocks */ - void* error; /* error return value */ - int size; /* size of each block */ - STACKPOS position; /* current stack position */ -}; - -/* - * map old names to new - */ - -#define mkstack stackalloc -#define rmstack stackfree -#define clrstack stackclear -#define getstack stackget -#define pushstack stackpush -#define popstack stackpop -#define posstack stacktell - -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*); - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/vecargs.h
Deleted
@@ -1,35 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Research - * - * vector argument interface definitions - */ - -#ifndef _VECARGS_H -#define _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*); - -#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/vecargs.3
Deleted
@@ -1,126 +0,0 @@ -.fp 5 CW -.de Af -.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2 -.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" -.. -.de aF -.ie \\$3 .ft \\$1 -.el \{\ -.ds ;G \& -.nr ;G \\n(.f -.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" -\\*(;G -.ft \\n(;G \} -.. -.de L -.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" -.. -.de LR -.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" -.. -.de RL -.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" -.. -.de EX \" start example -.ta 1i 2i 3i 4i 5i 6i -.PP -.RS -.PD 0 -.ft 5 -.nf -.. -.de EE \" end example -.fi -.ft -.PD -.RE -.PP -.. -.TH VECARGS 3 -.SH NAME -vecargs \- command argument vector insertion routines -.SH SYNOPSIS -.L "#include <vecargs.h>" -.sp -.L "char** vecload(char* string);" -.L "char** vecfile(const char* path);" -.L "char** vecstring(const char* string);" -.L "void vecfree(char**, int);" -.L "int vecargs(char** vec, int* argcp, char*** argvp);" -.SH DESCRIPTION -.L vecload -loads a string vector from lines in -.LR string . -.L string -may be modified upon return. -Each line in -.L string -is treated as a new vector element. -Lines with -.L # -as the first character are comments. -.I \enewline -joins consecutive lines. -A string vector pointer is returned, 0 on error. -.PP -.L vecfile -constructs a string vector by calling -.L vecload -on the contents of the file named by -.LR path . -The string vector pointer is returned, 0 on error. -.PP -.L vecstring -constructs a string vector by calling -.L vecload -on a copy of -.LR string . -The string vector pointer is returned, 0 on error. -.PP -.L vecfree -frees a string vector allocated by -.LR vecfile , -.L vecload -or -.LR vecstring . -.PP -.L vecargs -inserts the string vector -.L vec -(as returned by -.LR vecfile , -.L vecload -or -.LR vecstring ) -between -.L "(*argvp)0" -and -.LR "(*argvp)1" , -sliding -.L "(*argvp)1 ..." -over. -NULL and empty string args in -.L vec -are not copied. -.L "vecfree(vec)" -is called before the return. -.L \-1 -is returned if the insertion failed. -.SH EXAMPLES -.L vecargs -is commonly used to modify command -.L argv -from fixed files. -For example, -.IR make (1) -checks for the files -.L ./Makeargs -and -.L ./makeargs -to modify its arguments on startup. -Its a handy way to override default options on a directory by directory basis -without modify the standard control files -(\f3Makefile\fP in this case). -.SH CAVEATS -This paradigm is not recommended for all commands; only a few exceptions -make sense.
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/stack.c
Deleted
@@ -1,168 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * pointer stack routines - */ - -static const char id_stack = "\n@(#)$Id: stack (AT&T Bell Laboratories) 1984-05-01 $\0\n"; - -#include <ast.h> -#include <stack.h> - -/* - * create a new stack - */ - -STACK -stackalloc(int size, void* error) -{ - STACK stack; - struct stackblock *b; - - if (size <= 0) size = 100; - if (!(stack = newof(0, struct stacktable, 1, 0))) return NULL; - if (!(b = newof(0, struct stackblock, 1, 0))) - { - free(stack); - return NULL; - } - if (!(b->stack = newof(0, void*, size, 0))) - { - free(b); - free(stack); - return NULL; - } - stack->blocks = b; - stack->size = size; - stack->error = error; - stack->position.block = b; - stack->position.index = -1; - b->next = 0; - b->prev = 0; - return stack; -} - -/* - * remove a stack - */ - -void -stackfree(STACK stack) -{ - struct stackblock* b; - struct stackblock* p; - - b = stack->blocks; - while (p = b) - { - b = p->next; - free(p->stack); - free(p); - } - free(stack); -} - -/* - * clear stack - */ - -void -stackclear(STACK stack) -{ - stack->position.block = stack->blocks; - stack->position.index = -1; -} - -/* - * get value on top of stack - */ - -void* -stackget(STACK stack) -{ - if (stack->position.index < 0) return stack->error; - else return stack->position.block->stackstack->position.index; -} - -/* - * push value on to stack - */ - -int -stackpush(STACK stack, void* value) -{ - struct stackblock *b; - - if (++stack->position.index >= stack->size) - { - b = stack->position.block; - if (b->next) b = b->next; - else - { - if (!(b->next = newof(0, struct stackblock, 1, 0))) - return -1; - b = b->next; - if (!(b->stack = newof(0, void*, stack->size, 0))) - return -1; - b->prev = stack->position.block; - b->next = 0; - } - stack->position.block = b; - stack->position.index = 0; - } - stack->position.block->stackstack->position.index = value; - return 0; -} - -/* - * pop value off stack - */ - -int -stackpop(STACK stack) -{ - /* - * return: - * - * -1 if stack empty before pop - * 0 if stack empty after pop - * 1 if stack not empty before & after pop - */ - - if (stack->position.index < 0) return -1; - else if (--stack->position.index < 0) - { - if (!stack->position.block->prev) return 0; - stack->position.block = stack->position.block->prev; - stack->position.index = stack->size - 1; - return 1; - } - else return 1; -} - -/* - * set|get stack position - */ - -void -stacktell(STACK stack, int set, STACKPOS* position) -{ - if (set) stack->position = *position; - else *position = stack->position; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/putchar.c
Deleted
@@ -1,22 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ - -#include "stdhdr.h" - -NoN(putchar)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/string/fmtbase.c
Deleted
@@ -1,48 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Bell Laboratories - * - * return base b representation for n - * if p!=0 then base prefix is included - * otherwise if n==0 or b==0 then output is signed base 10 - */ - -#include <ast.h> - -char* -fmtbase(intmax_t n, int b, int p) -{ - char* buf; - int z; - - if (!p) - { - if (!n) - return "0"; - if (!b) - return fmtint(n, 0); - if (b == 10) - return fmtint(n, 1); - } - buf = fmtbuf(z = 72); - sfsprintf(buf, z, p ? "%#..*I*u" : "%..*I*u", b, sizeof(n), n); - return buf; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec
Deleted
-(directory)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec/vecargs.c
Deleted
@@ -1,72 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Bell Laboratories - * - * string vector argv insertion - */ - -#include <ast.h> -#include <vecargs.h> -#include <ctype.h> - -/* - * insert the string vector vec between - * (*argvp)0 and (*argvp)1, sliding (*argvp)1 ... over - * null and blank args are deleted - * - * vecfree always called - * - * -1 returned if insertion failed - */ - -int -vecargs(char** vec, int* argcp, char*** argvp) -{ - char** argv; - char** oargv; - char** ovec; - char* s; - int num; - - if (!vec) return -1; - if ((num = (char**)(*(vec - 1)) - vec) > 0) - { - if (!(argv = newof(0, char*, num + *argcp + 1, 0))) - { - vecfree(vec, 0); - return -1; - } - oargv = *argvp; - *argvp = argv; - *argv++ = *oargv++; - ovec = vec; - while (s = *argv = *vec++) - { - while (isspace(*s)) s++; - if (*s) argv++; - } - vecfree(ovec, 1); - while (*argv = *oargv++) argv++; - *argcp = argv - *argvp; - } - else vecfree(vec, 0); - return 0; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec/vecfile.c
Deleted
@@ -1,58 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Research - * - * string vector load support - */ - -#include <ast.h> -#include <ls.h> -#include <vecargs.h> - -/* - * load a string vector from lines in file - */ - -char** -vecfile(const char* file) -{ - int n; - char* buf; - char** vec; - int fd; - struct stat st; - - vec = 0; - if ((fd = open(file, O_RDONLY|O_cloexec)) >= 0) - { - if (!fstat(fd, &st) && S_ISREG(st.st_mode) && (n = st.st_size) > 0 && (buf = newof(0, char, n + 1, 0))) - { - if (read(fd, buf, n) == n) - { - bufn = 0; - vec = vecload(buf); - } - if (!vec) free(buf); - } - close(fd); - } - return vec; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec/vecfree.c
Deleted
@@ -1,44 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Bell Laboratories - * - * file to string vector support - */ - -#include <ast.h> -#include <vecargs.h> - -/* - * free a string vector generated by vecload() - * - * retain!=0 frees the string pointers but retains the string data - * in this case the data is permanently allocated - */ - -void -vecfree(char** vec, int retain) -{ - if (vec) - { - if (*(vec -= 2) && !retain) free(*vec); - free(vec); - } -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec/vecload.c
Deleted
@@ -1,92 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Bell Laboratories - * - * string vector load support - */ - -#include <ast.h> -#include <vecargs.h> - -/* - * load a string vector from lines in buf - * buf may be modified on return - * - * each line in buf is treated as a new vector element - * lines with # as first char are comments - * \ as the last char joins consecutive lines - * - * the vector ends with a 0 sentinel - * - * the string array pointer is returned - */ - -char** -vecload(char* buf) -{ - char* s; - int n; - char** p; - char** vec; - - vec = 0; - n = (*buf == '#') ? -1 : 0; - for (s = buf;; s++) - { - if (*s == '\n') - { - if (s > buf && *(s - 1) == '\\') *(s - 1) = *s = ' '; - else - { - *s = 0; - if (*(s + 1) != '#') - { - n++; - if (!*(s + 1)) break; - } - } - } - else if (!*s) - { - n++; - break; - } - } - if (n < 0) n = 0; - if (p = newof(0, char*, n + 3, 0)) - { - *p++ = s = buf; - vec = ++p; - if (n > 0) for (;;) - { - if (*s != '#') - { - *p++ = s; - if (--n <= 0) break; - } - while (*s) s++; - s++; - } - *p = 0; - *(vec - 1) = (char*)p; - } - return vec; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vec/vecstring.c
Deleted
@@ -1,42 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * -* and is licensed under the * -* Eclipse Public License, Version 2.0 * -* * -* A copy of the License is available at * -* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * -* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * -* * -* Glenn Fowler <gsf@research.att.com> * -* David Korn <dgk@research.att.com> * -* Phong Vo <kpv@research.att.com> * -* Martijn Dekker <martijn@inlv.org> * -* * -***********************************************************************/ -/* - * Glenn Fowler - * AT&T Bell Laboratories - * - * string vector load support - */ - -#include <ast.h> -#include <vecargs.h> - -/* - * load a string vector from lines in str - */ - -char** -vecstring(const char* str) -{ - char* buf; - char** vec; - - if (!str || !*str || !(buf = strdup(str))) vec = 0; - else if (!(vec = vecload(buf))) free(buf); - return vec; -}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/.gitignore -> _service:tar_scm:ksh-1.0.9.tar.gz/.gitignore
Changed
@@ -48,6 +48,7 @@ /src/lib/libdll/dlldefs.h # Miscellaneous artefacts +*.stackdump *.dSYM/ *.bak *.sav
View file
_service:tar_scm:ksh-1.0.8.tar.gz/ANNOUNCE -> _service:tar_scm:ksh-1.0.9.tar.gz/ANNOUNCE
Changed
@@ -1,10 +1,12 @@ -Announcing: KornShell 93u+m/1.0.8 +Announcing: KornShell 93u+m/1.0.9 https://github.com/ksh93/ksh -Here is the eighth ksh 93u+m/1.0 bugfix release. It fixes a bug that caused -an incorrect default exit status for 'exit' within a trap action, as well as -a race condition (introduced in 1.0.7) occurring on some systems when -running an external command with a redirection from a command substitution. +Here is the ninth ksh 93u+m/1.0 bugfix release. This release contains many +fixes of old and not-so-old bugs (including a couple of regressions in the +printf built-in introduced in 93u+m/1.0.5), adds Android/Termux as a +supported platform, and reintroduces the ability to build a dynamically +linked ksh (with libast, libdll, libcmd, and libshell available for other +applications to use) on most supported platforms. Further below is an overview of the main changes. For greater detail, see the NEWS file in the distribution. For complete detail, see the git(1) @@ -16,7 +18,7 @@ https://github.com/ksh93/ksh/releases To build, follow the instructions in README.md or src/cmd/ksh93/README. -Or ask your distribution package manager to upgrade ksh to this version. +Or ask your distribution package maintainer to upgrade ksh to this version. ### ABOUT KSH ### @@ -44,8 +46,8 @@ Main ksh 93u+m developers: Martijn Dekker, Johnothan King, hyenias Direct contributors: Andy Fiddaman, Anuradha Weeraman, atheik, Chase, -Cy Schubert, Govind Kamat, Harald van Dijk, K. Eugene Carlson, Lev -Kujawski, Marc Wilson, Phi, Ryan Schmidt, rymrg, Sterling Jensen, +Cy Schubert, Govind Kamat, Harald van Dijk, hyousatsu, K. Eugene Carlson, +Lev Kujawski, Marc Wilson, Phi, Ryan Schmidt, rymrg, Sterling Jensen, Trey Valenta, Vincent Mihalkovic Also includes backported contributions by: David Korn, Glenn Fowler, @@ -70,6 +72,49 @@ You can also join the mailing list/Google group at: https://groups.google.com/g/korn-shell +### MAIN CHANGES between ksh 93u+m/1.0.8 and 93u+m/1.0.9 ### + +- Android/Termux is now a supported platform. Build dependencies: binutils, + clang, getconf. Runtime dependencies (optional): ncurses-utils, getconf. +- Reintroduced support for building a dynamically linked ksh(1)/shcomp(1), + with libast, libdll, libcmd, and libshell available to other programs as + dynamic libraries. 'bin/package install /your/basepath' will install + development headers. The dynamically linked version is built in a 'dyn' + subdirectory; there are no changes to the statically linked version. + Dynamic linking is currently tested and supported on Linux, Android, + macOS, all the BSDs, illumos, Solaris, QNX, and Haiku. +- On systems where the external printf(1) utility supports deprecated + pre-POSIX syntax for formatters starting with '-', ksh now adapts its + built-in printf to match, for compatibility with system scripts. However, + ksh's built-in printf options such as -v or --man are not affected. +- Fixed a regression in the 'printf' built-in, introduced in 93u+m/1.0.5, + where each instance of '\0' or '%Z' in the format operand caused a string + argument to be incorrectly skipped. +- Fixed a regression, introduced in 93u+m/1.0.5, in ordinal specifiers in + 'printf %T' date specifications. For example, + printf '%(%F)T\n' '4th tuesday in march 2016' + wrongly printed '2016-04-09' and now again correctly prints '2016-03-22'. +- Fixed a regression of 'return' within traps, reintroduced in 93u+m/1.0.8 + after being fixed in 93u+m/1.0.0. The regression caused a 'return' or + 'exit' with no arguments to assume the before-trap exit status instead of + that of the last-run command. This broke the shipped 'autocd' function. +- Fixed a longstanding bug in shell arithmetic: the representation of + negative integers with a base other than 10 was incorrectly treated as + unsigned long. For example, + typeset -i16 n=-12; echo $n + now correctly outputs '-16#c' and no longer ouputs '16#fffffffffffffff4'. +- Fixed a bug, introduced in ksh93q+ 2005-05-22, that stopped an append + assignment from working together with a declaration command. For example, + 'typeset var+=value' or 'export var+=value' now again work as expected. +- Fixed a longstanding bug where the default terminal width for typeset -L, -R, + or -Z, if not given, was miscalculated for multibyte or control characters. +- Fixed: expansions of name references in loops were incorrectly treated as + invariant so they yielded the wrong values. +- If a .get or .getn discipline function is set for a variable, it is no + longer incorrectly triggered when performing an arithmetic assignment on + that variable; only the .set discipline is now triggered (as documented). +- Many other bug fixes (see the NEWS file). + ### MAIN CHANGES between ksh 93u+m/1.0.7 and 93u+m/1.0.8 ### - Fixed a regression in the behavior of 'exit' in a trap action. The exit
View file
_service:tar_scm:ksh-1.0.8.tar.gz/COPYRIGHT -> _service:tar_scm:ksh-1.0.9.tar.gz/COPYRIGHT
Changed
@@ -16,17 +16,18 @@ # # # Martijn Dekker <martijn@inlv.org> # # Johnothan King <johnothanking@protonmail.com> # -# hyenias <58673227+hyenias@users.noreply.github.com> # # K. Eugene Carlson <kvngncrlsn@gmail.com> # +# hyenias <58673227+hyenias@users.noreply.github.com> # # Anuradha Weeraman <anuradha@debian.org> # # Lev Kujawski <int21h@mailbox.org> # # Phi <phi.debian@gmail.com> # # atheik <14833674+atheik@users.noreply.github.com> # +# Vincent Mihalkovic <vmihalko@redhat.com> # # Ryan Schmidt <ryandesign@macports.org> # # Harald van Dijk <harald@gigawatt.nl> # # Chase <nicetrynsa@protonmail.ch> # # rymrg <54061433+rymrg@users.noreply.github.com> # -# Vincent Mihalkovic <vmihalko@redhat.com> # +# hyousatsu <118750527+hyousatsu@users.noreply.github.com> # # Trey Valenta <t@trey.net> # # Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> # # Marc Wilson <posguy99@gmail.com> #
View file
_service:tar_scm:ksh-1.0.8.tar.gz/NEWS -> _service:tar_scm:ksh-1.0.9.tar.gz/NEWS
Changed
@@ -2,6 +2,253 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0 Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library. +2024-07-02: + +- Release 1.0.9. + +- Support for UNC paths (//server/dir) is now enabled by default on Cygwin. + +2024-06-30: + +- Fixed: the 'hash' and 'alias -t' commands no longer autoload functions + from executable files on FPATH as an unintended side effect. + +2024-06-27: + +- Fixed: a builtin activated with the 'builtin' command was not found if + invoked within a namespace block on the same line as the 'builtin' command. + +2024-06-26: + +- Fixed: when the --showme option was used with a command containing multiple + redirections, only the first redirection was shown, without a newline. This + bug was introduced along with --showme in ksh 93s- 2006-09-12. + +2024-03-05: + +- Fixed a corner case bug causing incorrect field splitting behaviour of a + repeated whitespace character in the IFS variable. The behaviour was + incorrect when the posix option was changed while xtrace was on, or when a + shell discipline function was defined for IFS. Bug introduced on 2022-03-05. + +2024-03-03: + +- Fixed incorrect behaviour of {n1..n2..incr} range brace expansions, which + sometimes occurred if the value of n1 multiplied by incr falls outside of + the INT_MIN..INT_MAX range. For instance, {1696512000..1696512000..300} + now correctly outputs only 1696512000. + +2024-03-30: + +- A regression was fixed in ordinal specifiers in 'printf %T' date + specifications. For example, + printf '%(%F)T\n' '4th tuesday in march 2016' + wrongly printed '2016-04-09' and now again correctly prints '2016-03-22'. + This regression was introduded with the printf fixes on 2023-05-18. + +2024-03-24: + +- We now support building a dynamically linked ksh 93u+m with libast, + libdll, libcmd, and libshell available as dynamic libraries for other + applications to use. The dynamically linked version is built in a 'dyn' + subdirectory; there are no changes to the statically linked version. See + README.md for more information. Dynamic linking is tested and supported + on Linux, Android, macOS, FreeBSD, NetBSD, OpenBSD, illumos and Solaris. + Please test this on other platforms and send us your reports and patches. + +2024-03-22: + +- Fixed a crash in the getconf built-in that could occur after the 'builtin' + command was used to bind it to the same path as the external getconf command. + +2024-03-20: + +- Android with Termux is now a supported environment for ksh 93u+m. Testing + was done on Android 14.0 with Termux 0.118.0. Please report any breakage. + Build dependencies (Termux packages): clang, binutils, getconf. Runtime + depenencies: ncurses-utils (for --multiline), getconf (fallback for the + /opt/ast/bin/getconf builtin). + +2024-03-12: + +- Fixed a regression in the 'printf' built-in, introduced on 2023-05-17, + where each instance of '\0' or '%Z' in the format operand caused a string + argument to be incorrectly skipped. + +2024-03-10: + +- Fixed a longstanding bug where the default terminal width for typeset -L, -R, + or -Z, if not given, was miscalculated for multibyte or control characters. + +- Fixed a crash on redefining an array inherited from the parent environment + in a subshell. + +- Fixed corner case breakage of universe handling in the 'echo' command: it + broke when used in a namespace block before being used anywhere else, and + only if _AST_FEATURES was not exported first. The bug caused _AST_FEATURES to + be incorrectly placed in that namespace. Bug introduced on 2023-06-02. + +2024-03-07: + +- Fixed a bug that caused some systems to corrupt the display of multibyte + characters in the command prompt. + +2024-03-05: + +- Fixed a regression, introduced on 2021-02-07, that made the common AST + options '--???ESC' and '--???noESC' ineffective for enabling/disabling + ANSI escape codes for emphasis in the output of --man or --help. + (Type, e.g., print '--???' for more information about common options.) + +- Fixed a rare crash in the 'print' built-in due to the use of uninitialised + memory while parsing options. Bug introduced in ksh 93u+ 2012-05-31. + +- Fixed a 2021-04-14 regression: the 'exec' command (which runs a command + that replaces the shell process and therefore should only run external + commands) would run a path-bound built-in if /opt/ast/bin is in PATH. + +- Fixed a corner case bug: a ${ shared-state command substitution;} failed to + capture the standard output of a command that replces the shell via 'exec'. + +2024-02-29: + +- Improved the robustness of the routines handling the execution by ksh of a + script without an initial #! path. More memory is freed up after ksh forks. + +- Fixed a crash that could occur after 'typeset +x var' when var was imported + from the environment and then a discipline function was set for it. + +2024-02-22: + +- Fixed a crash that occurred when starting ksh with no TERM variable in the + environment (e.g., in single user mode on NetBSD and DragonFlyBSD). + +- Fixed a regression of 'return' within traps, reintroduced on 2023-12-25 + after being fixed on 2020-09-09. The regression caused a 'return' or + 'exit' with no arguments to assume the before-trap exit status instead of + that of the last-run command. This broke the shipped 'autocd' function. + +- Fixed some integer overflows that could occur when using TMOUT. + +- Fixed a crash on Solaris and illumos when cancelling a here-document + with ^C or ^D in an interactive shell. + +2024-02-17: + +- Fixed a crash that could occur when using 'typeset -T' typed variables + in a virtual subshell. + +2024-02-11: + +- Added SHOPT_PRINTF_LEGACY compile-time option for compatibility with + POSIX-ignorant external printf(1) commands that process a format operand + starting with '-' without the standard preceding '--' options terminator. + This is for backward compatibility with local system scripts. The + behaviour of the system's external printf(1) determines whether this is + compiled in or out by default. Normal ksh printf options keep working. + +- Fixed a bug, introduced on 2023-06-02, that made it impossible within a + namespace to unset a function defined outside the namespace. + +- Fixed: ksh didn't pass the exit status of the last command it executed to + the parent process on entering EOF (Ctrl+D) on a terminal. + +2024-02-09: + +- Fixed multiple inaccurate or missing values in the /opt/ast/bin/getconf + path-bound built-in command. + +2024-02-08: + +- Fixed an init-time crash that may occur if standard error is on a terminal, + but the path to its tty device can't be found (e.g., in a chroot situation). + +- Fixed corrupted output of the 'time' keyword as formatted via TIMEFORMAT on + systems where sizeof(time_t) != sizeof(int). Bug introduced on 2020-07-13. + +2024-02-06: + +- Fixed a regression introduced on 2023-03-04 that caused ksh to lock up + after using the Arch Linux arch-chroot script. + +2024-02-03: + +- Fixed: the arithmetic representation of negative integers with a base other + than 10 is no longer incorrectly treated as unsigned long. For example, + typeset -i16 n=-12; echo $n + now correctly outputs '-16#c' and no longer ouputs '16#fffffffffffffff4'. + +2024-01-27: + +- Fixed: tilde expansion discipline functions (see 2021-03-16) were not + reinitialised when executing a ksh script without a #! path line. + +2024-01-23: + +- Fixed a rare crash or rare incorrect behaviour in .sh.tilde.{get,set} + discipline functions for ~ expansion (see 2021-03-16 below). + +- Fixed a bug that caused listing the .sh.match variable with ${!.sh.match} to + show spurious elements. + +2024-01-22: + +- Fixed a bug in the loop invariants optimizer (SHOPT_OPTIMIZE) that caused + expansions of name references to be incorrectly treated as invariant so they + yielded the wrong values. Fix backported from from ksh 93v- 2013-02-13. + +- Fixed a buffer overflow that could occur when using tab completion + with multibyte filenames. + +2024-01-21: + +- A bug was fixed that caused both the 'set' and 'get'/'getn' discipline + functions of a variable to be triggered when performing an assignment in + an arithmetic expression; only the 'set' discipline is now triggered when + assigning (as was always the documented behaviour). This applies to the + shell's internal disciplines as well. For example, $RANDOM is no longer + spuriously read from while seeding it via an arithmetic expression. + +- Fixed: assigning to LINENO, RANDOM, or _ via an arithmetic expression gave + undefined results on systems where sizeof(long double)!=sizeof(double). + +2024-01-16: + +- Fixed a parsing bug in array subscripts containing '=' in combination with + a declaration command (such as 'typeset' or 'export'). For instance, + 'typeset -A arr; typeset -i arrfoo=bar=123' now works correctly. + +2024-01-15: + +- Fixed a bug, introduced in ksh93q+ 2005-05-22, that stopped an append + assignment from working together with a declaration command. For example, + 'typeset var+=value' or 'export var+=value' now again work as expected. + +2024-01-14: + +- Fixed a regression introduced on 2022-11-01 that caused ksh to enter + an infinite loop after using the up arrow in emacs mode with an empty + history file. + +- Fixed a bug in 'read -s': in a script, the first invocation of that + command, with the emacs or vi shell option on, did not allow the user to + navigate through the shell history file. + +2024-01-11: + +- Fixed ancient incorrect behaviour in the 'kill' built-in: it sent SIGCONT + to the given process along with every other non-SIGCONT signal issued, + causing a stopped process to be incorrectly resumed upon sending it any + signal and causing any SIGCONT trap handler to be incorrectly triggered. + +- Fixed: the 'kill' built-in was not able to terminate an interactive shell + by sending a signal such as SIGHUP to its own shell (e.g. kill -s HUP $$). + +2024-01-05: + +- Fixed a potential crash on pressing Ctrl+C on the command line while + history expansion (the -H or histexpand option) is active. + 2024-01-01: - Release 1.0.8. @@ -2690,7 +2937,7 @@ specifies and as all other POSIX shells do. To redirect standard output for reading and writing, you now need '1<>'. Ref.: https://github.com/att/ast/issues/75 - http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07 + https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_07 2020-05-12:
View file
_service:tar_scm:ksh-1.0.8.tar.gz/README.md -> _service:tar_scm:ksh-1.0.9.tar.gz/README.md
Changed
@@ -35,6 +35,11 @@ that corresponds to your architecture. The command `bin/package host type` outputs the name of this subdirectory. +Dynamically linked binaries, if supported for your system, are stored in +`dyn/bin` and `dyn/lib` subdirectories of your architecture directory. +If built, they are built in addition to the statically linked versions. +Export `AST_NO_DYLIB` to deactivate building dynamically linked versions. + If you have trouble or want to tune the binaries, you may pass additional compiler and linker flags. It is usually best to export these as environment variables *before* running `bin/package` as they could change the name of @@ -101,6 +106,13 @@ Destination directories with whitespace or shell pattern characters in their pathnames are not yet supported. +If a dynamically linked version of ksh and associated commands has been +built, then the `install` subcommand will prefer that: commands, dynamic +libraries and associated header files will be installed then. To install the +statically linked version instead (and skip the header files), either delete +the `dyn` subdirectory, or export `AST_NO_DYLIB=y` before building to prevent +it from being created in the first place. + ## What is ksh93? The following is the official AT&T description from 1993 that came with the @@ -121,7 +133,7 @@ modification. The code should conform to the -IEEE POSIX 1003.1 standard(http://www.opengroup.org/austin/papers/posix_faq.html) +IEEE POSIX 1003.1 standard(https://www.opengroup.org/austin/papers/posix_faq.html) and to the proposed ANSI C standard so that it should be portable to all such systems. Like the previous version, KSH-88, it is designed to accept eight bit character sets transparently, thereby making it internationally
View file
_service:tar_scm:ksh-1.0.8.tar.gz/TODO -> _service:tar_scm:ksh-1.0.9.tar.gz/TODO
Changed
@@ -1,4 +1,4 @@ -The following bugs and issues are known for ksh 93u+m 1.0.5: +The following bugs and issues are known for ksh 93u+m 1.0.9: Memory leak when initialising associative array in subshell https://github.com/ksh93/ksh/issues/94 @@ -6,15 +6,9 @@ command substitution botches output of non-waited-for child processes https://github.com/ksh93/ksh/issues/124 -wrong typeset -p output after unsetting multidimensional array elements -https://github.com/ksh93/ksh/issues/148 - typeset -L/-R: string length breaks on multibyte characters https://github.com/ksh93/ksh/issues/189 -Unicode code points in $'...' strings should vary according to the locale -https://github.com/ksh93/ksh/issues/193 - Segfault with very large extended glob patterns https://github.com/ksh93/ksh/issues/207 @@ -39,14 +33,26 @@ Function autoload apparently broken on DragonFly BSD https://github.com/ksh93/ksh/issues/432 -Alias expansion loop not detected in command substitution -https://github.com/ksh93/ksh/issues/458 - -Make KEYBD trap handling code multibyte-aware -https://github.com/ksh93/ksh/issues/460 - nameref fails with nested associative arrays https://github.com/ksh93/ksh/issues/594 globstar fails to resolve symlink https://github.com/ksh93/ksh/issues/629 + +Race condition in job notification +https://github.com/ksh93/ksh/issues/655 + +ksh remains in "noecho" mode forever +https://github.com/ksh93/ksh/issues/672 + +bogus typeset -p output for compounds with disciplines +https://github.com/ksh93/ksh/issues/729 + +test a = a b: undetected error bug +https://github.com/ksh93/ksh/issues/739 + +Occasional "write error" when writing to pipe +https://github.com/ksh93/ksh/issues/741 + +sleep 10 | read hangs interactive shell after ^Z +https://github.com/ksh93/ksh/issues/750
View file
_service:tar_scm:ksh-1.0.8.tar.gz/bin/package -> _service:tar_scm:ksh-1.0.9.tar.gz/bin/package
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -36,7 +36,7 @@ then : good shell else "$SHELL" -c "$min_posix" 2>/dev/null && exec "$SHELL" -- "$0" ${1+"$@"} sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} - DEFPATH=`getconf PATH` 2>/dev/null || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin + DEFPATH=`getconf PATH 2>/dev/null` || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin PATH=$DEFPATH:$PATH export PATH sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} @@ -101,7 +101,7 @@ ccs="/usr/kvm /usr/ccs/bin" org="gnu GNU" makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile -env="HOSTTYPE PACKAGEROOT INSTALLROOT PATH FPATH MANPATH" +env="HOSTTYPE PACKAGEROOT INSTALLROOT PATH DEFPATH FPATH MANPATH" package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' @@ -115,12 +115,12 @@ case $(getopts '-123:xyz' opt --xyz 2>/dev/null; echo 0$opt) in 0123) USAGE=$' -? -@(#)$Id: '$command$' (ksh 93u+m) 2023-06-18 $ +@(#)$Id: '$command$' (ksh 93u+m) 2024-07-01 $ -author?Glenn Fowler <gsf@research.att.com> -author?Contributors to https://github.com/ksh93/ksh -copyright?(c) 1994-2012 AT&T Intellectual Property --copyright?(c) 2020-2023 Contributors to ksh 93u+m +-copyright?(c) 2020-2024 Contributors to ksh 93u+m -license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +NAME?'$command$' - build, test and install ksh 93u+m +DESCRIPTION?The \b'$command$'\b command is the main control script @@ -205,6 +205,9 @@ to install the \acommand\as directly, or a temporary directory like \a/tmp/pkgtree/usr\a to prepare for packaging with operating system-specific tools. + Each \acommand\a is first searched in \b$INSTALLROOT/dyn/bin\b + (dynamically linked version) + and then in \b$INSTALLROOT/bin\b. If no \acommand\a is specified, then \aksh\a and \ashcomp\a are assumed. +make\b \apackage\a \aoption\a ... \atarget\a ... ?Build @@ -324,7 +327,7 @@ '} lo= make= -makeflags='-K' +makeflags='' nl=" " noexec= @@ -464,8 +467,10 @@ any necessary subdirectories are created. dest_dir can be a directory like /usr/local to install the commands directly, or a temporary directory like /tmp/pkgtree/usr to prepare for packaging with - operating system-specific tools. If no command is specified, then ksh - and shcomp are assumed. + operating system-specific tools. Each command is first searched in + $INSTALLROOT/dyn/bin (dynamically linked version) and then in + $INSTALLROOT/bin. If no command is specified, then ksh and shcomp + are assumed. make package option ... target ... Build and install. The default target is install, which makes and installs package. If the standard output is a terminal then the @@ -543,11 +548,11 @@ pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) IMPLEMENTATION - version package (ksh 93u+m) 2023-06-18 + version package (ksh 93u+m) 2024-07-01 author Glenn Fowler <gsf@research.att.com> author Contributors to https://github.com/ksh93/ksh copyright (c) 1994-2012 AT&T Intellectual Property - copyright (c) 2020-2023 Contributors to ksh 93u+m + copyright (c) 2020-2024 Contributors to ksh 93u+m license https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html' case $1 in html) echo "</pre></body></html>" ;; @@ -656,7 +661,7 @@ VPATH=*)eval USER_$n='$'v ;; 'debug=1') - makeflags="$makeflags --debug-symbols" + makeflags="$makeflags --debug-symbols -e" ;; 'strip=1') makeflags="$makeflags --strip-symbols" @@ -914,7 +919,7 @@ 0|1) cpu=$( cd "$TMPDIR" tmp=hi$$ - trap 'set +o noglob; exec rm -f $tmp.*' 0 1 2 + trap 'set +o noglob; rm -f $tmp.*' 0 1 2 cat > $tmp.c <<! #include <stdio.h> #include <pthread.h> @@ -1033,6 +1038,9 @@ *-linux-gnu* | *-linux-musl*) # fix missing machine field, e.g. aarch64-linux-gnu => aarch64-unknown-linux-gnu canon=${canon%%-*}-unknown-${canon#*-} ;; + *-linux-android*) + # Android/Termux is very much its own thing, so identify it as 'android', not 'linux' + canon=${canon%-linux-*}-android ;; esac case -${canon}- in --|*-powerpc-*) @@ -1351,10 +1359,6 @@ CcYyGgWwIiNn_*) type=cygwin ;; - UuWwIiNn*|Wwindows_01234567890123456789|Wwindows_NnTt) - type=win32 - arch=$(echo $arch | sed -e 's/_^_*$//') - ;; esac case $arch in '') case $mach in @@ -1538,7 +1542,7 @@ '') bits=$( set -e cd "$TMPDIR" tmp=hi$$ - trap 'set +o noglob; exec rm -rf "$tmp".*' 0 1 2 + trap 'set +o noglob; rm -rf "$tmp".*' 0 1 2 echo 'int main(void) { return 0; }' > $tmp.a.c checkcc $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1 @@ -1612,6 +1616,14 @@ "$@" ) +trace() +( + PS4="${action}: executing: " + exec 2>&1 # trace to standard output + set -o xtrace + "$@" +) + # cc checks # # CC: compiler base name name @@ -1642,6 +1654,124 @@ esac } +# output sanitized system $PATH, eliminating duplicate and nonexistent dirs, '..', etc. + +sanitize_PATH() +( + set -fu +e + IFS=':' + unset -v CDPATH + sPATH='' + for dir in $1; do + # Sanitize this path, resolving symlinks, + # with special-casing of ksh's virtual built-ins directory + case $dir in + /opt/ast/bin) + test ! -d "$dir" && sdir=$dir ;; + */* | !+-* | +-*!0123456789*) + sdir=$(cd -- $dir 2>/dev/null && pwd -P && echo X) ;; + *) sdir=$(cd ./$dir 2>/dev/null && pwd -P && echo X) ;; + esac || continue + sdir=${sdir%?X} + # Skip duplicates + case :$sPATH: in + *:"$sdir":*) + continue ;; + esac + # Found one, add it + sPATH=${sPATH:+$sPATH:}$sdir + done + printf '%s\n' "${sPATH#:}" +) + +# Ensure a sane $PATH beginning with standard utilities. +# POSIXly, a simple 'getconf PATH' should do it, but reality is otherwise. +# Find preferred getconf(1) on NixOS and Solaris/illumos. +# Compile fallback programs on systems without getconf(1). + +DEFPATH=$( + # support Android/Termux, NixOS, Solaris/illumos, generic /bin:/usr/bin + PATH=/data/data/com.termux/files/usr/bin:/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH + getconf PATH 2>/dev/null || { + # no getconf(1) -- try confstr(3) + checkcc + t=${TMPDIR:-/tmp}/path_test.$$ + trap 'set +f; rm -rf "$t."*' 0 + cat > $t.c <<-EOF + #include <stdio.h> + #include <unistd.h> + int main(void) + { + char buf8192; + size_t len = confstr(_CS_PATH, &buf, sizeof(buf)); + if (len > 0 && len < sizeof(buf)) + { + printf("%s\n", buf); + return 0; + } + return 1; + } + EOF + $CC $CCFLAGS $LDFLAGS -o "$t.exe" "$t.c" 2>/dev/null && "$t.exe" + } || { + # no confstr(3) either -- try non-standard _PATH_DEFPATH + cat > $t.c <<-EOF + #include <stdio.h> + #include <paths.h> + int main(void) + { + printf("%s\n", _PATH_DEFPATH); + return 0; + } + EOF + $CC $CCFLAGS $LDFLAGS -o "$t.exe" "$t.c" 2>/dev/null && "$t.exe" + } +) || DEFPATH=/bin:/usr/bin:/sbin:/usr/sbin +# Fix for Android/Termux. The /bin directory exists with standard +# utilities (sh, Toybox utils) but it is not included in _PATH_DEFPATH. +# It should come first because /bin is read-only. +if test -d /data/data/com.termux && test "$(/bin/uname -o 2>/dev/null)" = Android +then case ":$DEFPATH:" in + *:/bin:* ) ;; + * ) DEFPATH=/bin:$DEFPATH ;; + esac +fi +# Fix for NixOS. Not all POSIX standard utilities come with the default system, +# e.g. 'bc', 'file', 'vi'. The command that NixOS recommends to get missing +# utilities, e.g. 'nix-env -iA nixos.bc', installs them in a default profile +# directory that is not in $(getconf PATH). So add this path to the standard path. +# See: https://github.com/NixOS/nixpkgs/issues/65512 +if test -e /etc/NIXOS && + nix_profile_dir=/nix/var/nix/profiles/default/bin && + test -d "$nix_profile_dir" +then case ":$DEFPATH:" in + *:"$nix_profile_dir":* ) + # nothing to do + ;; + * ) # insert the default profile directory as the second entry + DEFPATH=$( + set -f + IFS=: + set -- $DEFPATH + one=$1 + shift + echo "$one:$nix_profile_dir${1+:}$*" + ) ;; + esac +fi +# Fix for AIX. At least as of version 7.1, the system default 'find', 'diff -u' and 'patch' utilities +# are broken and/or non-compliant in ways that make them incompatible with POSIX 2018. However, GNU +# utilities are commonly installed in /opt/freeware/bin, and under standard names (no g- prefix). +if test -d /opt/freeware/bin +then case $(uname) in + AIX ) DEFPATH="/opt/freeware/bin:$DEFPATH" ;; + esac +fi + +export DEFPATH # for iffe, etc. + +PATH=$(sanitize_PATH "/opt/ast/bin:$DEFPATH:$PATH") + # some actions have their own PACKAGEROOT or kick out early case $action in @@ -1837,24 +1967,6 @@ for i in lib do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit done - - # no $INITROOT means INIT already installed elsewhere - - if test -d $INITROOT - then - # update the basic package commands - - for i in mamprobe - do test -h $PACKAGEROOT/bin/$i 2>/dev/null || - case $(ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null) in - "$INITROOT/$i.sh"*) - note "update $PACKAGEROOT/bin/$i" - $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit - $exec chmod +x $PACKAGEROOT/bin/$i || exit - ;; - esac - done - fi ;; esac path=$PATH @@ -1950,14 +2062,14 @@ do eval \$a eval \" case \\\$LD_LIBRARY\${v}_PATH: in - \\\$d/lib:*) + \\\$d/dyn/lib:*) ;; *) x=\\\$LD_LIBRARY\${v}_PATH case \\\$x in ''|:*) ;; *) x=:\\\$x ;; esac - LD_LIBRARY\${v}_PATH=\$d/lib\\\$x + LD_LIBRARY\${v}_PATH=\$d/dyn/lib\\\$x export LD_LIBRARY\${v}_PATH p=1 ;; @@ -1992,30 +2104,30 @@ ;; esac case $LIBPATH: in - $INSTALLROOT/bin:$INSTALLROOT/lib:*) + $INSTALLROOT/dyn/bin:$INSTALLROOT/dyn/lib:*) ;; *) case $LIBPATH in '') LIBPATH=/usr/lib:/lib ;; esac - LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH + LIBPATH=$INSTALLROOT/dyn/bin:$INSTALLROOT/dyn/lib:$LIBPATH $show LIBPATH=$LIBPATH $show export LIBPATH export LIBPATH ;; esac case $SHLIB_PATH: in - $INSTALLROOT/lib:*) + $INSTALLROOT/dyn/lib:*) ;; - *) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH} + *) SHLIB_PATH=$INSTALLROOT/dyn/lib${SHLIB_PATH:+:$SHLIB_PATH} $show SHLIB_PATH=$SHLIB_PATH $show export SHLIB_PATH export SHLIB_PATH ;; esac case $DYLD_LIBRARY_PATH: in - $INSTALLROOT/lib:*) + $INSTALLROOT/dyn/lib:*) ;; - *) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} + *) DYLD_LIBRARY_PATH=$INSTALLROOT/dyn/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH} $show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH $show export DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH @@ -2030,6 +2142,16 @@ $show _RLD_ROOT=$_RLD_ROOT $show export _RLD_ROOT export _RLD_ROOT + # Haiku + case $LIBRARY_PATH: in + $INSTALLROOT/dyn/lib:*) + ;; + *) LIBRARY_PATH=$INSTALLROOT/dyn/lib${LIBRARY_PATH:+:$LIBRARY_PATH} + $show LIBRARY_PATH=$LIBRARY_PATH + $show export LIBRARY_PATH + export LIBRARY_PATH + ;; + esac # now set up PATH # @@ -2048,6 +2170,12 @@ test -n "${MANPATH+s}" && MANPATH=$INSTALLROOT/man:$MANPATH ;; esac + case $PATH: in + $INSTALLROOT/dyn/bin:*) + ;; + *) PATH=$INSTALLROOT/dyn/bin:$PATH + ;; + esac case $FPATH: in $INSTALLROOT/fun:*) ;; @@ -2099,10 +2227,7 @@ case $KEEP_SHELL in 0) save_PATH=$PATH - if PATH=$(getconf PATH 2>/dev/null) - then PATH=$PATH:$path - else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path - fi + PATH=$DEFPATH:$path for i in ksh ksh93 mksh yash bash sh do if onpath "$i" && checksh "$_onpath_" then SHELL=$_onpath_ @@ -2124,13 +2249,7 @@ # tame the environment - case $action in - use) ;; - *) ENV= - ERROR_OPTIONS= - export ENV ERROR_OPTIONS - ;; - esac + unset ERROR_OPTIONS ENV _KSHRC_WELCOMED_ # finalize the views @@ -2395,11 +2514,10 @@ do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return done fi - $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return + rm -f "$INSTALLROOT/dyn/bin/$i" "$INSTALLROOT/src/lib/libast/$i" & + $exec $CC -O $CCFLAGS $LDFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return test -f $i.o && $exec rm -f $i.o - i=$PATH - PATH=/bin - PATH=$i + hash -r ;; esac done @@ -2548,14 +2666,25 @@ done # set install directories bindir=$dd/bin - man1dir=${dd:-/usr}/share/man/man1 fundir=${dd:-/usr}/share/fun + mandir=${dd:-/usr}/share/man + man1dir=$mandir/man1 + man3dir=$mandir/man3 + libdir=$dd/lib + includedir=$dd/include # and off we go trace mkdir -p "$bindir" "$man1dir" || exit for f - do # install executable - trace cp "bin/$f" "$bindir/" || exit - # install manual and autoloadable functions + do # macOS throws code signature error if 'cp' overwrites Mach-O binary; must remove first + if test -e "$bindir/$f" + then rm -f "$bindir/$f" || exit + fi + # install executable + if test -f "dyn/bin/$f" + then trace cp "dyn/bin/$f" "$bindir/" || exit + else trace cp "bin/$f" "$bindir/" || exit + fi + # install manual pages and autoloadable functions case $f in ksh) trace cp "$PACKAGEROOT/src/cmd/ksh93/sh.1" "$man1dir/ksh.1" || exit trace mkdir -p "$fundir" || exit @@ -2574,6 +2703,34 @@ ;; esac done + if test -d "dyn/lib" + then trace mkdir -p "$libdir" "$man3dir" "$includedir" + # install libraries + # note: to copy symlinks with BSD cp, we need to specify -R as well as -P, contra POSIX + set +o noglob + for f in dyn/lib/* + do set -o noglob + # macOS throws code signature error if 'cp' overwrites Mach-O binary; must remove first + if test -e "$libdir/$f" + then rm -f "$libdir/$f" || exit + fi + # cp -P is not yet universally supported, but cp -R also preserves symlinks + trace cp -R "$f" "$libdir"/ + done + # install developer stuff + test -d "$includedir/ast" && trace rm -rf -- "$includedir/ast" + trace cp -R "include/ast" "$includedir"/ || exit + printf "install: writing into %s:" "$man3dir" + ( + set +o noglob + for f in man/man3/*.3 + do printf " %sast" "${f##*/}" + # give .3 pages an ast suffix to avoid conflicts + sed '/^\.TH .* 3/ s/ 3/ 3ast/' "$f" > "$man3dir/${f##*/}ast" + done + ) + printf '\n' + fi } error_status=0 @@ -2841,6 +2998,41 @@ ;; esac + # check against previous compiler and flags + + err= + for var in CC CCFLAGS CCLDFLAGS LDFLAGS + do store=$INSTALLROOT/lib/package/gen/$var + eval "new=\$$var" + if test -e "$store" + then old=$(cat "$store") || exit + case $old in + "$new") ;; + *) case $old in + '') old="(none)" ;; + *) old="'$old'" ;; + esac + case $new in + '') new="(none)" ;; + *) new="'$new'" ;; + esac + note "$var changed from $old to $new" + err=y ;; + esac + elif test -d "$INSTALLROOT/lib/package/gen" # does not exist if 'bin/package debug make' + then case $new in + '') ;; + *) echo "$new" ;; + esac > $store || exit + fi + done + case $err,${FORCE_FLAGS+f} in + y,) err_out "This would likely break the build. Restore the flag(s)," \ + "or delete the build directory and rebuild from scratch." + ;; + esac + unset err var store old new + # remember the default $CC case $CC in @@ -2875,33 +3067,38 @@ ;; esac - # no $INITROOT means INIT already installed elsewhere + # update probe scripts - if test -d $INITROOT - then - # update probe scripts + i=$INSTALLROOT/bin/mamprobe + j=$INITROOT/mamprobe.sh + case $(ls -t "$i" "$j" 2>/dev/null) in + "$i"*) ;; + *) note "update $i" + $exec cp "$j" "$i" || exit + $exec chmod +x "$i" || exit + ;; + esac - for i in lib/probe lib/probe/C lib/probe/C/make - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - i=$INSTALLROOT/lib/probe/C/make/probe - j=$INITROOT/C+probe - k=$INITROOT/make.probe - case $(ls -t $i $j $k 2>/dev/null) in - $i*) ;; - *) if test -f "$j" && test -f "$k" - then note "update $i" - case $exec in - '') cat $j $k > $i || exit - ;; - *) echo "cat $j $k > $i" - ;; - esac - $exec chmod +x $i || exit - fi - ;; - esac - fi + for i in lib/probe lib/probe/C lib/probe/C/make + do test -d "$INSTALLROOT/$i" || $exec mkdir "$INSTALLROOT/$i" || exit + done + i=$INSTALLROOT/lib/probe/C/make/probe + j=$INITROOT/C+probe + k=$INITROOT/make.probe + case $(ls -t "$i" "$j" "$k" 2>/dev/null) in + "$i"*) ;; + *) if test -f "$j" && test -f "$k" + then note "update $i" + case $exec in + '') cat "$j" "$k" > $i || exit + ;; + *) echo "cat $j $k > $i" + ;; + esac + $exec chmod +x "$i" || exit + fi + ;; + esac # initialize mamake @@ -2911,40 +3108,6 @@ view) exit 0 ;; esac - # check against previous compiler and flags - - err= - for var in CC CCFLAGS CCLDFLAGS LDFLAGS - do store=$INSTALLROOT/lib/package/gen/$var - eval "new=\$$var" - if test -f $store - then old=$(cat $store) - case $old in - "$new") ;; - *) case $old in - '') old="(none)" ;; - *) old="'$old'" ;; - esac - case $new in - '') new="(none)" ;; - *) new="'$new'" ;; - esac - note "$var changed from $old to $new" - err=y ;; - esac - else test -d $INSTALLROOT/lib/package/gen && case $new in - '') ;; - *) echo "$new" ;; - esac > $store - fi - done - case $err,${FORCE_FLAGS+f} in - y,) err_out "This would likely break the build. Restore the flag(s)," \ - "or delete the build directory and rebuild from scratch." - ;; - esac - unset err var store old new - # all work under $INSTALLROOT/src $make cd $INSTALLROOT/src @@ -2973,99 +3136,18 @@ ;; esac - # mamprobe data should have been generated by this point + # transition - TODO: remove when dust settles - case $exec in - '') if test ! -f "$INSTALLROOT/bin/.paths" || test -w "$INSTALLROOT/bin/.paths" - then N=' -' - b= f= h= n= p= u= B= L= - if test -f $INSTALLROOT/bin/.paths - then exec < $INSTALLROOT/bin/.paths - while read x - do case $x in - '#'?*) case $h in - '') h=$x ;; - esac - ;; - *BUILTIN_LIB=*) b=$x - ;; - *FPATH=*) f=$x - ;; - *PLUGIN_LIB=*) p=$x - ;; - *) case $u in - ?*) u=$u$N ;; - esac - u=$u$x - ;; - esac - done - fi - ifs=$IFS - m= - case $p in - ?*) b= - ;; - esac - case $b in - ?*) IFS='=' - set $b - IFS=$ifs - shift - p="PLUGIN_LIB=$*" - case $b in - NnOo*) p=no$p ;; - esac - m=1 - ;; - esac - case $f in - '') f="FPATH=../fun" - m=1 - ;; - esac - case $h in - '') h='# use { no NO } prefix to permanently disable #' ;; - esac - case $p in - '') p="PLUGIN_LIB=cmd" - if ( set +o noglob - grep '^setv mam_cc_DIALECT .* EXPORT=ADLL' "$INSTALLROOT"/lib/probe/C/mam/* - ) >/dev/null 2>&1 - then p=no$p - fi - m=1 - ;; - esac - case $m in - 1) case $u in - ?*) u=$N$u ;; - esac - echo "$h$N$p$N$f$N$u" > $INSTALLROOT/bin/.paths - ;; - esac - fi - ;; - esac + rm -f "$INSTALLROOT/bin/.paths" & # run from separate copies since ksh may be rebuilt case $EXECROOT in $INSTALLROOT) $make cd $INSTALLROOT/bin - if executable /bin/cp - then cp=/bin/cp - else cp=cp - fi - if executable /bin/mv - then mv=/bin/mv - else mv=mv - fi - if executable /bin/rm - then rm=/bin/rm - else rm=rm - fi + cp=$(PATH=$DEFPATH; command -v cp) || cp=cp + mv=$(PATH=$DEFPATH; command -v mv) || mv=mv + rm=$(PATH=$DEFPATH; command -v rm) || rm=rm for i in \ ksh tee cp ln mv rm \ *ast*.dll *cmd*.dll *dll*.dll *shell*.dll @@ -3102,7 +3184,6 @@ # build with mamake - note "make with mamake" case $target in '') target="install" ;; esac @@ -3270,7 +3351,7 @@ case $filter in errors) $exeg grep -E '^pax:|\*\*\*' $j ;; - *) $exec grep -E -iv '^($||\+\|cc^-:|kill |make.*(file system time|has been replaced)|so|0123456789+ error|uncrate |0123456789+ block|ar: creat|iffe: test: |conf: (check|generate|test)|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|0123456789*$|(checking|creating|touch) /abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789)| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + *) $exec grep -E -iv '^($||\+\|cc^-:|kill |make.*(file system time|has been replaced)|so|0123456789+ error|uncrate |0123456789+ block|ar: creat|iffe: test: |conf: (check|generate|read|probe|test)|abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|0123456789*$|(checking|creating|touch) /abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789)| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | $exec grep : ;; esac @@ -3303,6 +3384,7 @@ if test "$KEEP_SHELL" -lt 2 && executable "$INSTALLROOT/bin/ksh" then SHELL=$INSTALLROOT/bin/ksh fi + export ENV=$INSTALLROOT/etc/kshrc x=:.. for d in $(set +o noglob; cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/^/*$,,' | sort -u) do x=$x:$INSTALLROOT/$d @@ -3320,6 +3402,13 @@ export PACKAGE_USE unset LC_ALL # respect the user's locale again; avoids multibyte corruption + for s in "$INSTALLROOT/dyn/bin/ksh" "$INSTALLROOT/$OK/bin/ksh" "$INSTALLROOT/bin/ksh" + do if "$s" -c ':' 2>/dev/null + then export SHELL=$s + break + fi + done + # run the command case $run in
View file
_service:tar_scm:ksh-1.0.8.tar.gz/bin/shtests -> _service:tar_scm:ksh-1.0.9.tar.gz/bin/shtests
Changed
@@ -1,6 +1,6 @@ # Wrapper script to run the ksh93 regression tests directly. -# By Martijn Dekker <martijn@inlv.org> 2020-05-14, 2023-03-17 -# Public domain. http://creativecommons.org/publicdomain/zero/1.0/ +# By Martijn Dekker <martijn@inlv.org> 2020-05-14, 2023-03-17, 2024-03-05 +# Public domain. https://creativecommons.org/publicdomain/zero/1.0/ # # The manual: bin/shtests --man # Brief help: bin/shtests --help @@ -26,29 +26,30 @@ exit 128 fi -# The test suite uses $SHELL to indicate the shell to test. But we cannot -# use a $SHELL environment value inherited by this script, as that is -# already used for the user's default login shell on most systems. So -# allow inheriting $KSH instead, or passing SHELL= or KSH= as arguments. +# bin/package will have set $SHELL to our ksh. +# Allow override by passing SHELL= or KSH= as arguments. for arg do case $arg in ( SHELL=* | KSH=* ) - KSH=${arg#*=} ;; + export KSH=${arg#*=} ;; ( * ) set -- "$@" "$1" ;; esac shift done -# Find root dir of ksh source -mydir=$(dirname "$0") \ -&& mydir=$(CDPATH='' cd -P -- "$mydir/.." && printf '%sX' "$PWD") \ -&& mydir=${mydir%X} \ -|| exit -myarch=$("$mydir/bin/package" host type) || exit +# Relaunch with necessary environment stuff from bin/package +case ${HOSTTYPE+h}${INSTALLROOT+i}${PACKAGEROOT+p}${LD_LIBRARY_PATH+l} in +hipl) ;; +*) mydir=$(dirname "$0") \ + && mydir=$(CDPATH='' cd -P -- "$mydir/.." && printf '%sX' "$PWD") \ + && mydir=${mydir%X} \ + || exit + exec "$mydir/bin/package" use "$mydir" "$0" "$@" ;; +esac # Check if there is a ksh to test. case ${KSH+set} in -( '' ) KSH=$mydir/arch/$myarch/bin/ksh ;; +( '' ) KSH=$SHELL ;; esac if ! test -x "$KSH" || ! test -f "$KSH"; then printf '%s: shell not found: %s\n' "${0##*/}" "$KSH" >&2 @@ -62,10 +63,8 @@ && KSH=${KSH%X} # Run the test suite -CDPATH='' cd -P -- "$mydir/src/cmd/ksh93/tests" || exit +CDPATH='' cd -P -- "$PACKAGEROOT/src/cmd/ksh93/tests" || exit SHELL=$KSH -INSTALLROOT=${INSTALLROOT:-$mydir/arch/$myarch} -export SHELL INSTALLROOT unset -v KSH printf '#### Regression-testing %s ####\n' "$SHELL" exec "$SHELL" shtests "$@"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/Mamfile
Changed
@@ -1,15 +1,22 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -make test - make install - make all + +setv MAMAKE_STRICT 3 + +make test virtual + make test_announce virtual + exec - : testing KornShell $KSH_VERSION : + done + make install virtual + make all virtual exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} - done all virtual - done install virtual -done test virtual + done + make announce_build_done virtual notrace + prev cmd/ksh93/ksh + exec - ${<} -c 'print "# KornShell $KSH_VERSION"' + exec - echo "# Type 'bin/package use' to try it out" + done + done +done
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/Mamfile
Changed
@@ -1,723 +1,116 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. -setv PACKAGEROOT ../../../../.. setv CC cc -setv mam_cc_FLAGS -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} -setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -setv COTEMP $$ -setv LDFLAGS -make install - make iffe - prev iffe.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : iffe contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n iffe.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 225 in - exec - 0) ${STDCP} iffe.sh iffe - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < iffe.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} iffe.sh - exec - } > iffe - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - iffe.sh > iffe <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - ! - exec - ;; - exec - esac - exec - test -w iffe -a -x iffe || ${STDCHMOD} u+w,+x iffe - done iffe generated - make mktest - prev mktest.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : mktest contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n mktest.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 184 in - exec - 0) ${STDCP} mktest.sh mktest - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < mktest.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} mktest.sh - exec - } > mktest - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - mktest.sh > mktest <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - ! - exec - ;; - exec - esac - exec - test -w mktest -a -x mktest || ${STDCHMOD} u+w,+x mktest - done mktest generated - make package - prev package.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : package contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n package.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 184 in - exec - 0) ${STDCP} package.sh package - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < package.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} package.sh - exec - } > package - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - package.sh > package <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - ! - exec - ;; - exec - esac - exec - test -w package -a -x package || ${STDCHMOD} u+w,+x package - done package generated - make regress - prev regress.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : regress contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n regress.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 184 in - exec - 0) ${STDCP} regress.sh regress - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < regress.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} regress.sh - exec - } > regress - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - regress.sh > regress <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - ! - exec - ;; - exec - esac - exec - test -w regress -a -x regress || ${STDCHMOD} u+w,+x regress - done regress generated - make crossexec - prev crossexec.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : crossexec contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n crossexec.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 184 in - exec - 0) ${STDCP} crossexec.sh crossexec - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < crossexec.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} crossexec.sh - exec - } > crossexec - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - crossexec.sh > crossexec <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - ! - exec - ;; - exec - esac - exec - test -w crossexec -a -x crossexec || ${STDCHMOD} u+w,+x crossexec - done crossexec generated - make mamake - make mamake.o - make mamake.c - prev shlib-compat.h implicit dontcare virtual - prev ast.h implicit dontcare virtual - done mamake.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c mamake.c - done mamake.o generated - exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o - done mamake generated - make mkreq - prev mkreq.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : mkreq contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n mkreq.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 0 in - exec - 0) ${STDCP} mkreq.sh mkreq - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < mkreq.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} - mkreq.sh <<'!' - exec - - exec - ! - exec - } > mkreq - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - mkreq.sh > mkreq <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - - exec - ! - exec - ;; - exec - esac - exec - test -w mkreq -a -x mkreq || ${STDCHMOD} u+w,+x mkreq - done mkreq generated - make mprobe - prev mprobe.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : mprobe contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n mprobe.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 0 in - exec - 0) ${STDCP} mprobe.sh mprobe - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < mprobe.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} - mprobe.sh <<'!' - exec - - exec - ! - exec - } > mprobe - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - mprobe.sh > mprobe <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - - exec - ! - exec - ;; - exec - esac - exec - test -w mprobe -a -x mprobe || ${STDCHMOD} u+w,+x mprobe - done mprobe generated - make probe - make probe.sh - prev C+probe - prev make.probe - exec - ${STDCAT} C+probe make.probe > probe.sh - done probe.sh generated - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : probe contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n probe.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 0 in - exec - 0) ${STDCP} probe.sh probe - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < probe.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} - probe.sh <<'!' - exec - - exec - ! - exec - } > probe - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - probe.sh > probe <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - - exec - ! - exec - ;; - exec - esac - exec - test -w probe -a -x probe || ${STDCHMOD} u+w,+x probe - done probe generated - make ${INSTALLROOT}/bin - exec - if test ! -d ${INSTALLROOT}/bin - exec - then mkdir -p ${INSTALLROOT}/bin - exec - fi - done ${INSTALLROOT}/bin generated - make ${INSTALLROOT}/bin/iffe - prev iffe - exec - ${STDCMP} 2>/dev/null -s iffe ${INSTALLROOT}/bin/iffe || { ${STDMV} ${INSTALLROOT}/bin/iffe ${INSTALLROOT}/bin/iffe.old 2>/dev/null || true; ${STDCP} iffe ${INSTALLROOT}/bin/iffe ;} - done ${INSTALLROOT}/bin/iffe generated - make ${INSTALLROOT}/bin/mkreq - prev mkreq - exec - ${STDCMP} 2>/dev/null -s mkreq ${INSTALLROOT}/bin/mkreq || { ${STDMV} ${INSTALLROOT}/bin/mkreq ${INSTALLROOT}/bin/mkreq.old 2>/dev/null || true; ${STDCP} mkreq ${INSTALLROOT}/bin/mkreq ;} - done ${INSTALLROOT}/bin/mkreq generated - make ${INSTALLROOT}/bin/mktest - prev mktest - exec - ${STDCMP} 2>/dev/null -s mktest ${INSTALLROOT}/bin/mktest || { ${STDMV} ${INSTALLROOT}/bin/mktest ${INSTALLROOT}/bin/mktest.old 2>/dev/null || true; ${STDCP} mktest ${INSTALLROOT}/bin/mktest ;} - done ${INSTALLROOT}/bin/mktest generated - make ${INSTALLROOT}/bin/package - prev package - exec - ${STDCMP} 2>/dev/null -s package ${INSTALLROOT}/bin/package || { ${STDMV} ${INSTALLROOT}/bin/package ${INSTALLROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${INSTALLROOT}/bin/package ;} - done ${INSTALLROOT}/bin/package generated - make ${INSTALLROOT}/bin/regress - prev regress - exec - ${STDCMP} 2>/dev/null -s regress ${INSTALLROOT}/bin/regress || { ${STDMV} ${INSTALLROOT}/bin/regress ${INSTALLROOT}/bin/regress.old 2>/dev/null || true; ${STDCP} regress ${INSTALLROOT}/bin/regress ;} - done ${INSTALLROOT}/bin/regress generated - make ${PACKAGEROOT}/bin - exec - if test ! -d ${PACKAGEROOT}/bin - exec - then mkdir -p ${PACKAGEROOT}/bin - exec - fi - done ${PACKAGEROOT}/bin generated - make ${PACKAGEROOT}/bin/mamprobe - make mamprobe - prev mamprobe.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : mamprobe contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n mamprobe.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 0 in - exec - 0) ${STDCP} mamprobe.sh mamprobe - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < mamprobe.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} - mamprobe.sh <<'!' - exec - - exec - ! - exec - } > mamprobe - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - mamprobe.sh > mamprobe <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - - exec - ! - exec - ;; - exec - esac - exec - test -w mamprobe -a -x mamprobe || ${STDCHMOD} u+w,+x mamprobe - done mamprobe generated - exec - ${STDCMP} 2>/dev/null -s mamprobe ${PACKAGEROOT}/bin/mamprobe || { ${STDMV} ${PACKAGEROOT}/bin/mamprobe ${PACKAGEROOT}/bin/mamprobe.old 2>/dev/null || true; ${STDCP} mamprobe ${PACKAGEROOT}/bin/mamprobe ;} - done ${PACKAGEROOT}/bin/mamprobe generated - make ${PACKAGEROOT}/bin/package - prev package - exec - ${STDCMP} 2>/dev/null -s package ${PACKAGEROOT}/bin/package || { ${STDMV} ${PACKAGEROOT}/bin/package ${PACKAGEROOT}/bin/package.old 2>/dev/null || true; ${STDCP} package ${PACKAGEROOT}/bin/package ;} - done ${PACKAGEROOT}/bin/package generated - make ${INSTALLROOT}/bin/crossexec - prev crossexec - exec - ${STDCMP} 2>/dev/null -s crossexec ${INSTALLROOT}/bin/crossexec || { ${STDMV} ${INSTALLROOT}/bin/crossexec ${INSTALLROOT}/bin/crossexec.old 2>/dev/null || true; ${STDCP} crossexec ${INSTALLROOT}/bin/crossexec ;} - done ${INSTALLROOT}/bin/crossexec generated - make ${INSTALLROOT}/bin/mamake - prev mamake - exec - ${STDCMP} 2>/dev/null -s mamake ${INSTALLROOT}/bin/mamake || { ${STDMV} ${INSTALLROOT}/bin/mamake ${INSTALLROOT}/bin/mamake.old 2>/dev/null || true; ${STDCP} mamake ${INSTALLROOT}/bin/mamake ;} - done ${INSTALLROOT}/bin/mamake generated - make __proto_stub - note * - note * proto(1) has been removed, but install a backward compatibility stub - note * that allows old Mamfiles containing proto commands to keep working. - note * - exec - src=${PACKAGEROOT}/src/cmd/INIT/proto.sh - exec - dst=${INSTALLROOT}/bin/proto - exec - ${STDCMP} 2>/dev/null -s $src $dst || { ${STDMV} $dst $dst.old 2>/dev/null || true; ${STDCP} $src $dst ;} - exec - test -w $dst && test -x $dst || ${STDCHMOD} u+w,+x $dst - done __proto_stub dontcare virtual - make ${INSTALLROOT}/bin/.paths - exec - if test ! -f ${INSTALLROOT}/bin/.paths -o -w ${INSTALLROOT}/bin/.paths - exec - then N=' - exec - ' - exec - H=${mam_cc_HOSTTYPE} - exec - P="" - exec - b= f= h= l= n= p= u= B= L= - exec - set : $P - exec - while : - exec - do while : - exec - do case $1 in - exec - '') break 2 ;; - exec - :) shift; break ;; - exec - esac - exec - shift - exec - done - exec - case $# in - exec - 0|1) break ;; - exec - esac - exec - case $L in - exec - ?*) L="$L|" ;; - exec - esac - exec - L="$L$2=*" - exec - B=$1 - exec - done - exec - if test -f ${INSTALLROOT}/bin/.paths - exec - then while read x - exec - do case $x in - exec - *\$\(\"*) break - exec - ;; - exec - '#'?*) case $h in - exec - '') h=$x ;; - exec - esac - exec - ;; - exec - $L) l=$x - exec - ;; - exec - *BUILTIN_LIB=*) b=$x - exec - ;; - exec - *FPATH=*) f=$x - exec - ;; - exec - *PLUGIN_LIB=*) p=$x - exec - ;; - exec - *) case $u in - exec - ?*) u=$u$N ;; - exec - esac - exec - u=$u$x - exec - ;; - exec - esac - exec - done < ${INSTALLROOT}/bin/.paths - exec - fi - exec - ifs=$IFS - exec - m= - exec - case $p in - exec - ?*) b= - exec - ;; - exec - esac - exec - case $b in - exec - ?*) IFS='=' - exec - set $b - exec - IFS=$ifs - exec - shift - exec - p="PLUGIN_LIB=$*" - exec - case $b in - exec - NnOo*) p=no$p ;; - exec - esac - exec - m=1 - exec - ;; - exec - esac - exec - case $f in - exec - '') f="FPATH=../fun" - exec - m=1 - exec - ;; - exec - esac - exec - case $h in - exec - '') h='# use { no NO } prefix to permanently disable #' ;; - exec - esac - exec - case $l in - exec - '') set x x : $P - exec - l= - exec - while : - exec - do while : - exec - do case $# in - exec - 0) break ;; - exec - esac - exec - x=$1 - exec - shift - exec - case $x in - exec - :) break ;; - exec - esac - exec - done - exec - case $# in - exec - 0|1) break - exec - ;; - exec - 2) l=$2 - exec - ;; - exec - *) case "$H" in - exec - $3) l=$2; break ;; - exec - esac - exec - ;; - exec - esac - exec - done - exec - case $l in - exec - '') if test -x /lib/dld.sl - exec - then l=SHLIB_PATH - exec - elif test -x /usr/lib/dyld - exec - then l=DYLD_LIBRARY_PATH - exec - else case "$H" in - exec - ibm.*|mvs.*) - exec - l=LIBPATH - exec - ;; - exec - sgi.mips3) - exec - l=LD_LIBRARYN32_PATH - exec - ;; - exec - sgi.mips4) - exec - l=LD_LIBRARYN64_PATH - exec - ;; - exec - *) l=LD_LIBRARY_PATH - exec - ;; - exec - esac - exec - fi - exec - ;; - exec - esac - exec - case $l in - exec - ?*) case $B in - exec - '') B=lib ;; - exec - esac - exec - l="$l=../$B" - exec - m=1 - exec - ;; - exec - esac - exec - ;; - exec - esac - exec - case $p in - exec - '') p="PLUGIN_LIB=cmd" - exec - case '' in - exec - '') p=no$p ;; - exec - esac - exec - m=1 - exec - ;; - exec - esac - exec - case $m in - exec - 1) case $u in - exec - ?*) u=$N$u ;; - exec - esac - exec - echo "$h$N$p$N$f$N$l$u" > ${INSTALLROOT}/bin/.paths - exec - ;; - exec - esac - exec - fi - done ${INSTALLROOT}/bin/.paths generated - make ${INSTALLROOT}/lib/probe/C - exec - if test ! -d ${INSTALLROOT}/lib/probe/C - exec - then mkdir -p ${INSTALLROOT}/lib/probe/C - exec - fi - done ${INSTALLROOT}/lib/probe/C generated + +note * +note * initialization for the build system +note * + +make install virtual + loop DIR bin include/ast lib/lib lib/probe/C/make lib/probe/C/pp lib/probe/C/mam + make ${INSTALLROOT}/${DIR} + exec - mkdir -p ${@} + done + done + + note * + note * install helper scripts + note * + + make probe.sh + prev C+probe + prev make.probe + exec - cat ${^} > ${@} + done + loop SCRIPT probe iffe mktest regress crossexec mkreq mkreq-maplib mprobe proto dylink + make ${INSTALLROOT}/bin/${SCRIPT} + make ${SCRIPT} + prev ${@}.sh + exec - cp ${<} ${@} && chmod u+w,+x ${@} + done + exec - cp -f ${<} ${@} + done + done + make ${INSTALLROOT}/bin/mamprobe + note * the probe.sh dependency is needed for mamake to redo the probe when C+probe or make.probe is edited + prev probe.sh + prev mamprobe.sh + exec - cp ${<} ${@} && chmod u+w,+x ${@} + done + + note * + note * probe initialization + note * + make ${INSTALLROOT}/lib/probe/C/probe - prev ${INSTALLROOT}/lib/probe/C prev C+probe - exec - ${STDCMP} 2>/dev/null -s C+probe ${INSTALLROOT}/lib/probe/C/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/probe ${INSTALLROOT}/lib/probe/C/probe.old 2>/dev/null || true; ${STDCP} C+probe ${INSTALLROOT}/lib/probe/C/probe ;} - done ${INSTALLROOT}/lib/probe/C/probe generated - make ${INSTALLROOT}/lib/probe/C/make - exec - if test ! -d ${INSTALLROOT}/lib/probe/C/make - exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/make - exec - fi - done ${INSTALLROOT}/lib/probe/C/make generated - make ${INSTALLROOT}/lib/probe/C/pp - exec - if test ! -d ${INSTALLROOT}/lib/probe/C/pp - exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/pp - exec - fi - done ${INSTALLROOT}/lib/probe/C/pp generated - make ${INSTALLROOT}/lib/probe/C/mam - exec - if test ! -d ${INSTALLROOT}/lib/probe/C/mam - exec - then mkdir -p ${INSTALLROOT}/lib/probe/C/mam - exec - fi - done ${INSTALLROOT}/lib/probe/C/mam generated + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/probe/C/mam/probe - prev ${INSTALLROOT}/lib/probe/C/mam prev mprobe - exec - ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/probe ${INSTALLROOT}/lib/probe/C/mam/probe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/probe ;} - done ${INSTALLROOT}/lib/probe/C/mam/probe generated + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/probe/C/mam/mprobe prev mprobe - exec - ${STDCMP} 2>/dev/null -s mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/mam/mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe.old 2>/dev/null || true; ${STDCP} mprobe ${INSTALLROOT}/lib/probe/C/mam/mprobe ;} - done ${INSTALLROOT}/lib/probe/C/mam/mprobe generated + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/probe/C/make/probe prev probe - exec - ${STDCMP} 2>/dev/null -s probe ${INSTALLROOT}/lib/probe/C/make/probe || { ${STDMV} ${INSTALLROOT}/lib/probe/C/make/probe ${INSTALLROOT}/lib/probe/C/make/probe.old 2>/dev/null || true; ${STDCP} probe ${INSTALLROOT}/lib/probe/C/make/probe ;} - done ${INSTALLROOT}/lib/probe/C/make/probe generated - make ${INSTALLROOT}/include/ast - exec - if test ! -d ${INSTALLROOT}/include/ast - exec - then mkdir -p ${INSTALLROOT}/include/ast - exec - fi - done ${INSTALLROOT}/include/ast generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + exec - cp -f ${<} ${@} + done + note * + note * check if -ldl is required + note * + note * NOTE: this works around the sgi botch: + note * (1) irix 5.* made -ldl optional but warned + note * (2) irix 6.* has no -ldl + note * (3) dynamic progs built on irix 5.* and using -ldl fail + note * at runtime on irix 6.* because -ldl is not there + note * make ${INSTALLROOT}/lib/lib/dl - prev ${INSTALLROOT}/lib/lib make dl.req prev dl.c - exec - set +v +x - exec - r='-' - exec - for i in dl.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in dl - - exec - do case $p in - exec - -) if ${CC} -o dl.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o dl.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > dl.req - exec - ${STDRM} -f dl.exe dl - done dl.req generated - exec - ${STDCMP} 2>/dev/null -s dl.req ${INSTALLROOT}/lib/lib/dl || { ${STDMV} ${INSTALLROOT}/lib/lib/dl ${INSTALLROOT}/lib/lib/dl.old 2>/dev/null || true; ${STDCP} dl.req ${INSTALLROOT}/lib/lib/dl ;} - done ${INSTALLROOT}/lib/lib/dl generated + exec - mkreq-maplib ${CC} : dl : ${^} : dl + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done + note * + note * requiring these is a botch + note * make ${INSTALLROOT}/lib/lib/iconv make iconv.req prev iconv.c - exec - set +v +x - exec - r='-' - exec - for i in iconv.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in iconv - - exec - do case $p in - exec - -) if ${CC} -o iconv.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o iconv.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > iconv.req - exec - ${STDRM} -f iconv.exe iconv - done iconv.req generated - exec - ${STDCMP} 2>/dev/null -s iconv.req ${INSTALLROOT}/lib/lib/iconv || { ${STDMV} ${INSTALLROOT}/lib/lib/iconv ${INSTALLROOT}/lib/lib/iconv.old 2>/dev/null || true; ${STDCP} iconv.req ${INSTALLROOT}/lib/lib/iconv ;} - done ${INSTALLROOT}/lib/lib/iconv generated + exec - mkreq-maplib ${CC} : iconv : ${^} : iconv + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/lib/w make w.req prev w.c prev w2.c - exec - set +v +x - exec - r='-' - exec - for i in w.c w2.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in w - - exec - do case $p in - exec - -) if ${CC} -o w.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o w.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > w.req - exec - ${STDRM} -f w.exe w w2 - done w.req generated - exec - ${STDCMP} 2>/dev/null -s w.req ${INSTALLROOT}/lib/lib/w || { ${STDMV} ${INSTALLROOT}/lib/lib/w ${INSTALLROOT}/lib/lib/w.old 2>/dev/null || true; ${STDCP} w.req ${INSTALLROOT}/lib/lib/w ;} - done ${INSTALLROOT}/lib/lib/w generated + exec - mkreq-maplib ${CC} : w : ${^} : w + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done + note * + note * miscellaneous -l* checks + note * make ${INSTALLROOT}/lib/lib/intl make intl.req prev intl.c - exec - set +v +x - exec - r='-' - exec - for i in intl.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in intl - - exec - do case $p in - exec - -) if ${CC} -o intl.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o intl.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > intl.req - exec - ${STDRM} -f intl.exe intl - done intl.req generated - exec - ${STDCMP} 2>/dev/null -s intl.req ${INSTALLROOT}/lib/lib/intl || { ${STDMV} ${INSTALLROOT}/lib/lib/intl ${INSTALLROOT}/lib/lib/intl.old 2>/dev/null || true; ${STDCP} intl.req ${INSTALLROOT}/lib/lib/intl ;} - done ${INSTALLROOT}/lib/lib/intl generated + exec - mkreq-maplib ${CC} : intl : ${^} : intl + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/lib/m make m.req prev m.c @@ -726,140 +119,67 @@ prev m4.c prev m5.c prev m6.c - exec - set +v +x - exec - r='-' - exec - for i in m.c m2.c m3.c m4.c m5.c m6.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in m - - exec - do case $p in - exec - -) if ${CC} -o m.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o m.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > m.req - exec - ${STDRM} -f m.exe m m2 m3 m4 m5 m6 - done m.req generated - exec - ${STDCMP} 2>/dev/null -s m.req ${INSTALLROOT}/lib/lib/m || { ${STDMV} ${INSTALLROOT}/lib/lib/m ${INSTALLROOT}/lib/lib/m.old 2>/dev/null || true; ${STDCP} m.req ${INSTALLROOT}/lib/lib/m ;} - done ${INSTALLROOT}/lib/lib/m generated + exec - mkreq-maplib ${CC} : m : ${^} : m + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done make ${INSTALLROOT}/lib/lib/nsl make nsl.req prev nsl.c - exec - set +v +x - exec - r='-' - exec - for i in nsl.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in nsl - - exec - do case $p in - exec - -) if ${CC} -o nsl.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o nsl.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > nsl.req - exec - ${STDRM} -f nsl.exe nsl - done nsl.req generated - exec - ${STDCMP} 2>/dev/null -s nsl.req ${INSTALLROOT}/lib/lib/nsl || { ${STDMV} ${INSTALLROOT}/lib/lib/nsl ${INSTALLROOT}/lib/lib/nsl.old 2>/dev/null || true; ${STDCP} nsl.req ${INSTALLROOT}/lib/lib/nsl ;} - done ${INSTALLROOT}/lib/lib/nsl generated + exec - mkreq-maplib ${CC} : nsl : ${^} : nsl + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done + note * + note * what was sco smoking + note * almost all of gethost* are in -lnsl except gethostbyname which + note * is in -lsocket which isn't needed to resolve socket() but seems + note * to do the -lnsl job + note * make ${INSTALLROOT}/lib/lib/socket make socket.req prev socket.c prev nsl.c - exec - set +v +x - exec - r='-' - exec - for i in socket.c nsl.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in socket - - exec - do case $p in - exec - -) if ${CC} -o socket.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o socket.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > socket.req - exec - ${STDRM} -f socket.exe socket nsl - done socket.req generated - exec - ${STDCMP} 2>/dev/null -s socket.req ${INSTALLROOT}/lib/lib/socket || { ${STDMV} ${INSTALLROOT}/lib/lib/socket ${INSTALLROOT}/lib/lib/socket.old 2>/dev/null || true; ${STDCP} socket.req ${INSTALLROOT}/lib/lib/socket ;} - done ${INSTALLROOT}/lib/lib/socket generated + exec - mkreq-maplib ${CC} : socket : ${^} : socket + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done + note * + note * more substance abuse + note * gdbm's ndbm "compatibility" doesn't supply <ndbm.h>, instead supplies + note * <gdbm/ndbm.h> which provides K&R prototypes *and* it requires -lgdbm + note * some <ndbm.h> implementations use -lndbm, others -ldbm, still others -lc + note * this is why unix is starting to look like windows + note * this map allows makefiles to use -ldbm on all systems + note * + note * and this just in: sometimes its <gdbm-ndbm.h> and possibly -lgdbm_compat + note * + note * at least the -l* buck stops here + note * make ${INSTALLROOT}/lib/lib/dbm make dbm.req prev db.c prev gdbm.c - make gdbm1.c - prev gdbm-ndbm.h implicit dontcare virtual - done gdbm1.c - make gdbm2.c - prev ndbm.h implicit dontcare virtual - done gdbm2.c - exec - set +v +x - exec - r='-' - exec - for i in db.c gdbm.c gdbm1.c gdbm2.c - exec - do if ${CC} -c $i > /dev/null - exec - then g= - exec - for p in db - gdbm_compat - gdbm - ndbm - dbm - - exec - do case $p in - exec - -) if ${CC} -o dbm.exe $i $g > /dev/null 2>&1 - exec - then ${CC} -o dbm.exe $i > /dev/null 2>&1 || { - exec - r="$g" - exec - break 2 - exec - } - exec - fi - exec - g= - exec - ;; - exec - *) g="$g -l$p" - exec - ;; - exec - esac - exec - done - exec - fi - exec - done 2>/dev/null - exec - echo " $r" > dbm.req - exec - ${STDRM} -f dbm.exe db gdbm gdbm1 gdbm2 - done dbm.req generated - exec - ${STDCMP} 2>/dev/null -s dbm.req ${INSTALLROOT}/lib/lib/dbm || { ${STDMV} ${INSTALLROOT}/lib/lib/dbm ${INSTALLROOT}/lib/lib/dbm.old 2>/dev/null || true; ${STDCP} dbm.req ${INSTALLROOT}/lib/lib/dbm ;} - done ${INSTALLROOT}/lib/lib/dbm generated -done install virtual -make test - make test.iffe + prev gdbm1.c + prev gdbm2.c + exec - mkreq-maplib ${CC} : dbm : ${^} : db gdbm_compat gdbm ndbm dbm + prev mkreq-maplib + done + exec - cp -f ${<} ${@} + done +done install + +make test dontcare virtual + make test.iffe virtual prev iffe.tst - exec - exec "$SHELL" "$INSTALLROOT/bin/regress" iffe.tst iffe - done test.iffe virtual - make test.mamake - make mamake.tst - prev mamake.rt - exec - if test mamake.rt -nt mamake.tst - exec - then "$SHELL" "$INSTALLROOT/bin/mktest" --style=regress mamake.rt > mamake.tst - exec - fi - done mamake.tst generated - exec - exec "$SHELL" "$INSTALLROOT/bin/regress" mamake.tst mamake - done test.mamake virtual -done test dontcare virtual + exec - regress iffe.tst iffe + done + make test.mamake virtual + prev mamake.tst + exec - : testing non-libast mamake at $PWD/mamake : + exec - regress mamake.tst mamake + done +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/README-mamake.md -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/README-mamake.md
Changed
@@ -1,7 +1,7 @@ -## mamake and the MAM language ## +# mamake and the MAM language # MAM (Make Abstract Machine) is a simple rule-based make language -that is implemented in just six four-letter commands and five attributes, +that is implemented in just seven four-letter commands and five attributes, yet allows unlimited flexibility as it can execute arbitrary shell code. The program implementing MAM, `mamake`, is a portable C90 program written in a single file, `mamake.c`. @@ -10,29 +10,131 @@ to be built using only a standard C compiler and utilities installation without any other dependencies or complications. -MAM was designed by Glenn Fowler at AT&T. -The original documentation(http://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html) -for MAM specified a more extensive language than was actually implemented in `mamake.c`, -while the `ignore` attribute is not documented there. -This file documents the MAM implementation that we are actually using. - -`mamake` processes make files called `Mamfile`. -These were originally generated by a complex AT&T make system called `nmake`. -The intention was for `mamake` to process generated Mamfiles only -and not for it to replace `make`. -Yet, we are using it as our `make` in the ksh 93u+m distribution. -`nmake` was slow, brittle, and did not work on some modern systems, e.g. macOS. -It was not worth fixing because it is about as complex as ksh itself -- -whereas `mamake` is simple and portable, and offers all the same flexibility. - -Compared to the 2012-08-01 AT&T distribution, -ksh 93u+m made a few minor changes to `mamake` that make it easier to maintain Mamfiles by hand: -* All Mamfiles have been indented for legibility. (See `bin/Mamfile_indent` in the distribution.) -* Indentation and word separators may use any whitespace (e.g. tabs), not only spaces. -* Unrecognized commands and rule attributes throw an error instead of being silently ignored. -* Fixed some crashing bugs and memory leaks. -* The `prev` command may now be used without a prior `make`...`done` to declare a simple - prerequisite, provided the `MAMAKE_STRICT` variable is set. +MAM was originally designed by Glenn Fowler at AT&T and intended as an +abstraction layer for `make` implementations such as AT&T `nmake`. +The original documentation(https://web.archive.org/web/20041227143022/http://www2.research.att.com/~gsf/mam/mam.html) +for MAM specified a more extensive and slightly different language +than was actually implemented in `mamake.c`. +Notably, the `bind` command described there is completely different. +This file documents the MAM implementation that is actually in use. + +Since fixing and maintaining AT&T `nmake` proved impractical, `mamake` is +used here as a full `make` replacement, gradually adding some features to +the language to facilitate human maintenance of the `Mamfile`s. + +## Table of contents ## + +* General overview of the MAM language(#user-content-general-overview-of-the-mam-language) + * Strict and legacy modes(#user-content-strict-and-legacy-modes) +* MAM variables(#user-content-mam-variables) + * Special expansion syntax(#user-content-special-expansion-syntax) + * Automatic variables(#user-content-automatic-variables) +* Commands(#user-content-commands) + * Comments(#user-content-comments) + * Rules(#user-content-rules) + * Referencing prerequisites or previously defined rules(#user-content-referencing-prerequisites-or-previously-defined-rules) + * Setting MAM variables(#user-content-setting-mam-variables) + * Shell actions(#user-content-shell-actions) + * Viewpathing(#user-content-viewpathing) + * Execution(#user-content-execution) + * Strict level 2+ change(#user-content-strict-level-2-change) + * Declaring common code for shell actions(#user-content-declaring-common-code-for-shell-actions) + * Binding libraries(#user-content-binding-libraries) + * …while scanning and sorting leaf directories(#user-content-while-scanning-and-sorting-leaf-directories) + * …while building the current directory(#user-content-while-building-the-current-directory) + * Repeatedly iterating through a block(#user-content-repeatedly-iterating-through-a-block) +* Appendix: Main changes from the AT&T version(#user-content-appendix-main-changes-from-the-att-version) + +## General overview of the MAM language ## + +MAM is a simple declarative language, easy to parse for machines and easy to +read for humans, in which targets are defined that correspond to files that +need to be generated or updated, or that are prerequisites. `mamake` reads +build scripts from a file, `Mamfile` by default, from start to finish. As it +encounters `make` *target*…`done` blocks, it ‘makes’ (updates) the *target*s +using the instructions within those blocks. Those instructions may declare +dependencies and/or specify shell command actions. + +If a *target* is specified on the command line, `mamake` will update the +actions contained within that target and ignore the rest. + +### Strict and legacy modes ### + +By default, `mamake` remains fully backward compatible with Mamfiles as +originally generated by AT&T `nmake`. If the `MAMAKE_STRICT` variable is +set, some backward incompatible changes and deprecation warnings are +activated to ensure correct operation and to facilitate human maintenance of +the Mamfiles. A numeric value assigned to `MAMAKE_STRICT` indicates the +backward incompatibility level. The empty value is equivalent to level 1. +These are called the "strict levels" and their absence the "legacy mode", +also known as strict level 0. + +Each time backward incompatible changes are introduced to `mamake` that would +break previous Mamfiles, those are made subject to a `MAMAKE_STRICT` value of one +higher than the previous highest one; details of those changes are documented +throughout this file and listed in the appendix below. +This makes it possible to test or backport old code using the current build +system. Current Mamfiles should use the highest strict level available. +The current highest available strict level is **3**. + +## MAM variables ## + +MAM variables are imported from the environment +or set via `setv` (see below). +They are referenced using a `${`...`}` syntax not dissimilar to `sh`(1), +though the braces are *not* optional. +If an undefined variable is expanded and the variable name is valid in `sh`(1) +syntax, the expansion is left in place unexpanded, otherwise it is removed. +At strict level 2 and up, it is left unexpanded even if it is not a valid +`sh`(1) variable name; this allows POSIX shell expansions like `${foo#*bar}`. + +By default, the expansion of MAM variable references is recursive, +i.e., the value may itself contain other variable references. +Beware: there is no reference loop detection; any variable referencing +itself directly or indirectly will cause mamake to crash. +At strict level 2 and up, this (mis)feature is disabled and +variables always expand to their literal values, +and variable references in `setv` only work for previously defined variables. + +Note that, in shell actions (see `exec` below), MAM variables are expanded +before the script ever reaches the shell. Consequently, the use of single +shell quotes `'`…`'` does not stop their expansion as you might expect; +in fact, they ensure that only MAM variable expansion happens, +avoiding any potential conflicts with the shell expansion syntax. + +### Special expansion syntax ### + +In `${`*variable*`?`*str*`?`*x*`?`*y*`?}`, +if the string value of the *variable* is identical to *str* or if *c* is `*`, +then the value *x* is substituted, otherwise *y*. +The *x* and *y* values may result from nested variable references. +The last `?` is optional. + +In `${`*variable*`-`*x*`}`, the value of *variable* is substituted +if it is defined and non-empty, otherwise the value of *x* is substituted. +In `${`*variable*`+`*x*`}`, *x* is substituted if the value of +*variable* is defined and non-empty, otherwise the reference is removed. +Note that, unlike in `sh`(1), no distinction is made between an undefined +variable and a defined variable with an empty value. + +### Automatic variables ### + +The following variables are set and updated automatically. +They are inspired by similar variables in `make` implementations, +but since `mamake` is different, so are these variables. + +`${@}` is the name of the rule currently being made. + +`${<}` is the name of the prerequisite rule (`make`…`done` or `prev`) +that was *last* processed within the current rule. + +`${^}` is a space-separated list of names of all the current rule's +previously processed prerequisites. + +`${?}` is a space-separate list of the current rule's previously processed +prerequisites that have been updated by a shell action (see `exec` below) +during the current `mamake` run. Prequisites that were already up to date, +or prerequisites that do not contain a shell action, are not included. ## Commands ## @@ -48,20 +150,28 @@ ### Comments ### `note` is the comment command and is ignored. -For historical reasons, `info` and `meta` are also ignored. +In the legacy mode, `info` and `meta` are also ignored. ### Rules ### -`make` *rule* *attribute* ... -`done` *rule* *attribute* ... +`make` *target* *attribute* ... +`done` *target* + +A `make`...`done` block defines the rule named *target* using the other commands described here. +Unless the `virtual` attribute is used, *target* names the pathname of the file generated or referenced by the rule. -A `make`...`done` block defines the target rule named *rule* using the other commands described here. -Unless the `virtual` attribute is used, *rule* names the pathname of the file generated or referenced by the rule. +`mamake` processes the commands within the block if the *target* is out +of date or if the rule has the `virtual` attribute (see below). + +The *target* may be repeated as the operand to the `done` command. +In that case, it is matched against the current `make` *target* and +any mismatch will produce a "mismatched done statement" error. +If it is omitted, the current `make` *target* is assumed. Dependencies may be defined in two ways: 1. By nesting `make`...`done` blocks: - the enclosing *rule* is the parent - and the enclosed *rule*s are the prerequisites. + the enclosing rule is the parent + and the enclosed rules are the prerequisites. 2. By using the `prev` command (see **Referencing previously defined rules** below) to reference a previous `make`...`done` block. The dependency is defined as if that block were repeated at the `prev` command's location. @@ -74,103 +184,222 @@ declaring a dependency on a prerequisite file, such as a source code file that comes with the distribution or a file generated by a previously run Mamfile. -One or more of the following *attribute*s may be specified -by appending them to the `make` or `done` command: -* `archive`: Ignored. - Historically used to mark the generation of an `ar`(1) archive. +Making a prerequisite that is currently being made, or one that has already +been made, produces a warning; at strict level 3 and up, this is an error. + +One or more *attribute*s may be specified by appending them to the `make` command. +(At strict levels \< 2, they may also be appended to the `done` command; the effect +is the same either way. At strict level 1, this produces a deprecation warning.) +Attributes apply to the current rule only and do not propagate down to nested rules. +The following *attribute*s are available: * `dontcare`: Marks files that do not need to exist. If the file exists then its last-modified timestamp is checked and propagated, otherwise it is silently ignored. -* `generated`: Marks rules that produce output files generated by a shell action. - The `exec` command implicitly assigns this attribute, but it is customary to specify it regardless. -* `ignore`: The timestamp associated with *rule* is ignored in dependency resolution. +* `ignore`: The timestamp associated with the *target* is ignored in dependency resolution. * `implicit`: Marks the current rule as an implicit prerequisite of the enclosing parent rule. An implicit prerequisite can make the parent rule out of date without triggering the parent action. Implicit prerequisites usually correspond to `#include` prerequisites. For example, if `foo.o` is generated from `foo.c` and `foo.c` includes `foo.h`, then `foo.h` should be marked as an implicit prerequisite of `foo.c` so that touching `foo.h` does not make `foo.c` out of date while making `foo.o` out of date. +* `notrace`: Disables echoing (xtrace) of shell action commands. + This does not disable the trace header for the containing rule (see *Shell actions* below). +* `virtual`: Marks a rule that is not associated with any file. + The commands within are executed every time the rule is processed. + By convention, a virtual rule with target `install` performs pre-installation. + +At strict level 1 and up, specifying the following *attribute*s is +deprecated and will produce a warning; at strict level 2 and up, +specifying these is an error. + +* `archive`: Ignored. + Historically used to mark the generation of an `ar`(1) archive. +* `generated`: Marks rules that produce output files generated by a shell action. + The explicit assignment of this attribute is ignored at strict level 1. + The `exec` command implicitly assigns this attribute. + If a rule has this attribute, other rules dependent on this rule + will avoid applying viewpathing based on this rule. * `joint`: Ignored. Historically used to mark one of a group of rules that are built by a single shell action. -* `virtual`: Marks a rule that is not associated with any file. - The commands within are executed every time the Mamfile is processed. - By convention, a virtual rule named `all` makes everything, - and a virtual rule named `install` performs installation. ### Referencing prerequisites or previously defined rules ### -`prev` *rule* *attribute* ... +`prev` *target* *attribute* ... The `prev` command is used in two ways: -1. If *rule* is a previously defined rule, `prev` adds a dependency on that rule to the current rule. +1. If *target* matches a previously defined rule, `prev` adds a dependency on that rule to the current rule. This can be used to make a rule a prerequisite of multiple `make`...`done` blocks without repeating the rule. No attributes should be given for this use of `prev`, because the attributes of the referenced rule are used. - Superfluous attributes are an error if the `MAMAKE_STRICT` variable has been set, otherwise they are ignored. + Superfluous attributes are an error at strict level >= 1 and ignored in the legacy mode. -2. If *rule* is not a previously defined rule, the following applies. - If the `MAMAKE_STRICT` variable is not set, `prev` creates an empty dummy - *rule* and ignores the *attribute*s; this is for backward compatibility. - If the `MAMAKE_STRICT` variable is set, - `prev` creates a rule that declares a dependency on a prerequisite file named by *rule* +2. If *target* does not match a previously defined rule, the following applies. + In the legacy mode, `prev` creates an empty dummy + rule and ignores the *attribute*s; this is for backward compatibility. + At strict level 1 and up, + `prev` creates a rule that declares a dependency on a prerequisite file named by *target* in a manner equivalent to an empty `make`...`done` block, - with any *attribute*s given applied to the new rule, and + with the optional *attribute*s applied to the new rule, and a nonexistent prerequisite is an error unless a `virtual` or `dontcare` attribute is given. + Declaring a dependency on a prerequisite that is currently being made + (i.e.: directly or indirectly within that prerequisite's block) produces + a warning; at strict level 3 and up, this is an error. -### MAM variables ### +### Setting MAM variables ### `setv` *variable* *defaultvalue* Defines a new MAM *variable*, optionally assigning the initial *defaultvalue*. -If the *defaultvalue* begins and ends with double quotes (`"`), those are discarded. If the variable already has a value, the `setv` command is ignored; assigning a new value is not possible. When `mamake` starts, it imports all environment variables as MAM variables, so any variable's default value can be overridden by exporting an environment variable by its name. -MAM variables are referenced using the sh-style `${`...`}` syntax, though the braces are *not* optional. -Any reference to an undefined variable is silently left unexpanded (and not replaced by the empty string). -Expansion of MAM variable references is recursive, i.e., the value may itself contain other variable references. -Beware: there is no reference loop detection. +If the strict level is less than 2 and the *defaultvalue* begins and ends with +double quotes (`"`), those quotes are discarded, +though double quotes elsewhere in the value are not treated specially. +The value is otherwise taken entirely literally. -`TODO`: figure out and document advanced expansion syntax supported by `substitute()` in `mamake.c` +When the *variable* is `CC`, mamake runs the `mamprobe` script +to probe the C compiler for flags and features, +or uses that script's stored results if not outdated. +The results are stored as a series of `setv` commands +in a file in the directory `${INSTALLROOT}/lib/probe/C/mam`, +the file name being a hash of full path to the compiler indicated by `${CC}`. +That results file is then read and included in the current Mamfile +as if it followed the `setv CC` command. ### Shell actions ### `exec` `-` *code* One or more `exec` commands within a `make`...`done` block -define a shell script that is executed for *rule*. -The word following `exec` is ignored; by convention it is `-`. +define a shell script that is run to generate the *target*. +The argument following `exec` is ignored; by convention it is `-`. Each `exec` command appends a line of code to the shell script for the current rule. It is customary for a rule's `exec` commands to be contiguous, but not necessary. + Before adding each line of code to the script, MAM variable references (see **MAM variables** above) are expanded; their literal values are inserted into the *code* line (beware: no quoting is applied!). +Because variables are expanded when the line is encountered, the value +of the automatic variables for any `exec` line depends on the position +of the line in the rule. + +#### Viewpathing #### + +After MAM variable expansion, *viewpathing* is applied. +The first colon-separated element of `${VPATH}` is considered +the object code directory and the second the source code directory; +viewpathing provides the first with a vew to the second. +Viewpathing applies two transformations. + +The first is *prerequisite replacement*. +Each word (separated by whitespace, `;`, `(`, `)`, `` ` ``, `|`, `&` or `=`) +is searched for in the current rule's prerequisites, +and if it matches the name of a non-generated prerequisite, +it is replaced by the canonical path to it in the source directory, +ensuring that things like prerequisite headers are found. + +The second is *include flag duplication*. +After every argument that looks like a compiler include directory path (i.e., +starting with `-I`) with a relative path name (i.e., a directory path that does +*not* start with a `/`), another argument starting with `-I` is inserted with +that path name prefixed by the path to the source directory. This mechanism +ensures that headers are found both in the object directory and in the source +directory. It is processed regardless of the command; for example, it also +works for compiler flags passed to `iffe`(1). + +Note that shell quotes are *not* treated specially. If an argument starting +with `-I` ends in a shell quote without preceding whitespace, that trailing +quote is repeated along with the prefixed path and causes a syntax error. + +#### Execution #### + When `mamake` encounters the `done` command, the script is executed by the shell whose path is in the `SHELL` environment variable -or, absent that, by `/bin/sh`. -The `exec` command assigns the `generated` attribute to the current rule, even if it was not specified. +or, absent that, by `sh`(1). +Each shell action is run in a new instance of the shell. + +Before executing the script, an empty line followed by a trace header +in the following format is written to standard error: + + # path/to/Mamfile: startline-endline: rule + +During script execution, shell action comands are traced using the +shell's xtrace option, unless the rule has the `notrace` attribute. + +#### Strict level 2+ change #### + +At strict level 2 and up, `mamake` turns off global pathname expansion +(globbing) using `set -f` to make safer MAM variable expansion and shell +field splitting possible; this avoids unexpected pathname expansion if +a value contains `?`, `*` or ``. +A shell action can override this using `set +f`; +this should only be done for individual commands in a `(`subshell`)`. + +### Declaring common code for shell actions ### + +`shim` `-` *code* + +One or more `shim` commands declare a ‘shim’: a common section of `sh`(1) +code that will be automatically inserted in front of subsequent shell +actions upon execution. Like `exec`, `shim` combines multiple lines of +*code* into one section, with MAM variables expanded at declaration time and +viewpathing applied at execution time. The effect of `shim` is global. + +One use case is defining a shell function that each shell action can call. +For example, such a function might invoke the compiler with a series of +compiler flags common to all compiler invocations, with other flags added via +arguments to the function, so the common flags do not need to be repeated in +every shell action. + +Only one shim is active at a time, but it can be redefined. When the next +`exec` command is encountered, the shim is marked ready for use. The next +time a `shim` command is encountered after that, it starts a new shim from +scratch that affects subsequently executed shell actions. +A single `shim -` deactivates the shim. ### Binding libraries ### `bind` `-l`*libraryname* `dontcare` -An argument of `-l`*libraryname* (or `+l`*libraryname*) +These commands are scanned for while sorting leaf directories for recursive +building, and executed as normal commands while building the current directory. + +#### …while scanning and sorting leaf directories #### + +Any leaf directories with names that start with `INIT` will always be built before +all others. For all other leaf directories, the presence of any `bind` +command of the form `bind -lfoo` anywhere in a leaf +directory's Mamfile causes the leaf directory named `libfoo` (if it exists) +to be a prerequisite of that leaf directory. +The prerequisite leaf directory does not have to be in the same parent +directory, as long as it is processed as part of the same scan. +At this stage, attributes are ignored. + +#### …while building the current directory #### + +An argument of `-l`*libraryname* causes a MAM variable `mam_lib`*libraryname* to be defined (see **MAM variables** above). The variable will contain either the compiler argument for linking to the library *libraryname* (either the `-l`*libraryname* flag, or the full path in case of a static library) or, if the `dontcare` attribute is specified, possibly the empty string. +Any library dependencies are also included (see below). This can be used both for AST libraries shipped with the distribution and for system libraries. -If the library file is found in the distribution, -its time stamp is checked and the current target is marked as outdated if it is newer. +For each corresponding *.a library archive dependency built previously, +its time stamp is checked and the current target is marked as outdated if it is +newer, as if a `prev` had been executed for it. -The effect of `bind` is global, not scoped; it takes effect for all commands -physically following it, regardless of `make`…`done` nesting level. +The variable set by `bind` is global, but the marking of the target as +outdated applies to the current rule only, so it may be necessary to +repeat a `bind` command when statically linking executables that depend +on a library, otherwise they may not be relinked when the library changes. +The `mam_lib`*libraryname* variable will not be regenerated when repeating a `bind`. There is also a mechanism to communicate library dependency information across Mamfiles and `mamake` invocations. -If a file named *libraryname* in the current directory -or an `${INSTALLROOT}/lib/lib/`*libraryname*`.req` file +If a file named *libraryname*`.req` in the current directory +or an `${INSTALLROOT}/lib/lib/`*libraryname* file exists, `mamake` processes each of the words in the form `-l`*libraryname* in its contents as if they were arguments to `bind` commands and the resulting values are appended to the value of `mam_lib`*libraryname* @@ -182,9 +411,65 @@ then `mamake` compiles a small test program on the fly to check if the library exists; if this fails, the `mam_lib`*libraryname* variable will be emptied. -Any `bind` command whose argument does not start with `-l` or `+l` is ignored. +Any `bind` command whose argument does not start with `-l` is ignored. + +### Repeatedly iterating through a block ### + +`loop` *variable* *word* *word* ... +`done` + +`loop` reads the lines contained between it and the corresponding `done` +repeatedly with a named *variable* set to each of the *word*s. The lines +are processed as part of the rule containing the loop. +The *variable* is restored to its previous state after the loop completes. + +Note that `loop` causes repeated reading and processing of Mamfile lines, +*not* necessarily repeated execution. For instance, a loop can be used to +consolidate repetitive `make`…`done` rules. However, each rule is only made +once and subsequent rules by the same name are an error at strict level 3 +and up, or skipped over at strict \< 3. So it only makes sense to do this +if the contained make target names are modified by the expansion of the +iteration *variable*. -`TODO`: `bind` is not yet fully understood; more `mamake.c` code analysis is required. -In `require()` in `mamake.c` there is some special handling for dynamic libraries. -Note that the `bind` functionality implemented in `mamake.c` -is completely different from that described in the original documentation. +`loop` requires a seekable input file (i.e.: not a pipe). + +## Appendix: Main changes from the AT&T version ## + +Compared to the original AT&T version, ksh 93u+m made a number of +changes to `mamake` that facilitate correct operation and make it easier to +maintain Mamfiles by hand. The following lists the important changes. +* Introduced the notion of ‘strict mode’ levels that tidy things up by + activating some backward incompatible changes and deprecation warnings. +* Indentation and word separators may use any whitespace (e.g. tabs), not only spaces. +* Fixed a bug that stopped a rule marked `virtual` (not associated with + any file) from being executed if a file by that rule's name exists. +* Unrecognized commands and rule attributes throw an error instead of being silently ignored. +* It has been made optional to repeat the `make` target after `done`. +* The `notrace` attribute was added to disable xtrace for a rule's shell action. +* The automatic variables `${@}`, `${<}`, `${^}` and `${?}` have been added. +* An iteration block command, `loop`…`done`, has been added. +* A command to set common code for shell actions, `shim`, has been added. +* Attempting to make a rule that has already been made produces a warning. +* Attempting to declare a dependency on a rule currently being made produces a warning. +* **At strict level 1 and up:** + * Appending attributes to `done` instead of `make` is deprecated + and produces a warning. + * The ignored `archive` and `joint` attributes are deprecated. + * Explicitly specifying the `generated` attribute is deprecated. + * The dummy `info` and `meta` commands are unavailable instead of ignored. + * The `prev` command may be used instead of an empty `make`...`done` + block to declare a simple prerequisite with possible attributes. + * When `prev` references a previously processed target, + attributes are an error instead of being ignored. + * The legacy `silent` and `ignore` command prefixes are unavailable. +* **At strict level 2 and up:** + * Appending attributes to `done` instead of `make` is an error. + * The `archive` and `joint` attributes are unavailable. + * Explicitly specifying the `generated` attribute is an error. + * All variable references are expanded to their literal values + without scanning the values for recursive variable references. + * `setv` does not remove leading and trailing `"` from the value. + * Shell actions have pathname expansion (globbing) disabled by default. +* **At strict level 3 and up:** + * Attempting to make a rule that has already been made is an error. + * Attempting to declare a dependency on a rule currently being made is an error.
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/dylink.sh
Added
@@ -0,0 +1,142 @@ +######################################################################## +# # +# This file is part of the ksh 93u+m package # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # +# and is licensed under the # +# Eclipse Public License, Version 2.0 # +# # +# A copy of the License is available at # +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # +# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # +# # +# Martijn Dekker <martijn@inlv.org> # +# # +######################################################################## + +# Dynamic library linking tool for ksh 93u+m and supporting libraries. +# Called from **/Mamfile. + +case ${ZSH_VERSION+z} in +z) emulate ksh ;; +*) (command set -o posix) 2>/dev/null && set -o posix ;; +esac +set -o noglob # avoid pathname expansion interfering with field splitting + +note() +{ + printf "$0: %s\\n" "$@" >&2 +} + +err_out() +{ + note "$@" + exit 3 +} + +do_link() +{ + target=$dest_dir/$1 + shift + test -e "$target" && rm -f "$target" + ( + PS4="dylink $PS4" + set -o xtrace + # why pass CCFLAGS here? because it *might* have a flag like -m64 that the linker also needs + ${CC:-cc} $CCFLAGS $LDFLAGS -o "$target" "$@" + ) || exit +} + +# Basic sanity check. +case ${HOSTTYPE:+H}${INSTALLROOT:+I}${AST_NO_DYLIB+n} in +HI) ;; +HIn) note "Building dynamic libraries was disabled; skipping" + exit 0 # continue build + ;; +*) err_out "Required environment missing" + ;; +esac + +# Parse options. +exec_file= module_name= l_flags= version= suffix= +while getopts 'e:m:l:v:s:' opt +do case $opt in + e) exec_file=$OPTARG ;; + m) module_name=$OPTARG ;; + l) l_flags="$l_flags -l$OPTARG" ;; + v) version=$OPTARG ;; # this should be like 6.0 + s) suffix=$OPTARG ;; # this should be like .dylib or .so + '?') exit 2 ;; + *) err_out "Internal error (getopts)" ;; + esac +done +shift $((OPTIND - 1)) + +# Validate options. +case ${exec_file:+e}${module_name:+m} in +e | m) ;; +*) err_out "Either -e or -m should be specified" ;; +esac +case ${module_name:+m}${suffix:+s}${version:+v} in +'' | msv ) + ;; +*) err_out "-m requires +v/-s and vice versa" ;; +esac + +# Check for supported system. +case $HOSTTYPE in +android.* | darwin.* | dragonflybsd.* | freebsd* | haiku.* | linux.* | netbsd.* | openbsd.* | qnx.* | sol* ) + # supported + ;; +cygwin.*) + note "Dynamic libraries are not supported on Cygwin." + exit 0 # continue build + ;; +*) note "The system $HOSTTYPE is currently untested for dynamic libraries" \ + "so dynamic libraries are disabled by default. To test them," \ + "export AST_DYLIB_TEST to try to build a dynamically linked ksh." + case ${AST_DYLIB_TEST:+y} in + y) ;; + *) exit 0 # continue build + ;; + esac + ;; +esac + +# Set destination directory. +dest_dir=$INSTALLROOT/dyn +mkdir -p "$dest_dir/bin" "$dest_dir/lib" || err_out "could not mkdir" + +# Do the dynamic linking. +case ${exec_file} in +'') # ... figure out library file name(s) and internal name for linking purposes + # on macOS we have version before extension (libast.6.0.dylib), on other systems, after (libast.so.6.0) + case $suffix in + .dylib) lib_file=lib$module_name.$version$suffix + lib_linkname=lib$module_name.${version%%.*}$suffix + ;; + *) lib_file=lib$module_name$suffix.$version + lib_linkname=lib$module_name$suffix.${version%%.*} + ;; + esac + sym_links="$lib_linkname lib$module_name$suffix" + # ... remove possible old versions + (set +o noglob; exec rm -f "$dest_dir/lib/lib$module_name".*) + # ... execute linker command + case $HOSTTYPE in + darwin.*) + do_link "lib/$lib_file" -dynamiclib \ + -Wl,-dylib_install_name -Wl,"$lib_linkname" \ + "$@" -L"$dest_dir/lib" $l_flags + ;; + *) do_link "lib/$lib_file" -shared -Wl,-soname -Wl,"$lib_linkname" \ + "$@" -L"$dest_dir/lib" $l_flags + ;; + esac + for f in $sym_links + do ln -sf "$lib_file" "$dest_dir/lib/$f" + done + ;; +*) # Link an executable. + do_link "bin/$exec_file" "$@" -L"$dest_dir/lib" $l_flags + ;; +esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/iffe.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/iffe.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -33,7 +33,14 @@ set -o noglob command=iffe -version=2023-04-06 +version=2024-03-20 + +# DEFPATH should be inherited from package(1) +case $DEFPATH in +/*) ;; +*) echo "$command: DEFPATH not set" >&2 + exit 1 ;; +esac compile() # $cc ... { @@ -106,44 +113,7 @@ { case $1 in '') # Determine default system path, store in $pth. - pth=$( - PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH - exec getconf PATH 2>/dev/null - ) - case $pth in - '' | !/* | *:!/* | *: ) - pth="/bin /usr/bin /sbin /usr/sbin" ;; - *:*) pth=$(echo "$pth" | sed 's/:/ /g') ;; - esac - # Fix for NixOS. Not all POSIX standard utilities come with the default system, - # e.g. 'bc', 'file', 'vi'. The command that NixOS recommends to get missing - # utilities, e.g. 'nix-env -iA nixos.bc', installs them in a default profile - # directory that is not in $(getconf PATH). So add this path to the standard path. - # See: https://github.com/NixOS/nixpkgs/issues/65512 - if test -e /etc/NIXOS && - nix_profile_dir=/nix/var/nix/profiles/default/bin && - test -d "$nix_profile_dir" - then case " $pth " in - *" $nix_profile_dir "* ) - # nothing to do - ;; - * ) # insert the default profile directory as the second entry - pth=$( - set $pth - one=$1 - shift - echo "$one $nix_profile_dir${1+ }$@" - ) ;; - esac - fi - # Fix for AIX. At least as of version 7.1, the system default 'find', 'diff -u' and 'patch' utilities - # are broken and/or non-compliant in ways that make them incompatible with POSIX 2018. However, GNU - # utilities are commonly installed in /opt/freeware/bin, and under standard names (no g- prefix). - if test -d /opt/freeware/bin - then case $(uname) in - AIX ) pth="/opt/freeware/bin $pth" ;; - esac - fi + pth=$(echo "$DEFPATH" | sed 's/:/ /g') return ;; '<') shift @@ -653,7 +623,7 @@ -author?Phong Vo <kpv@research.att.com> -author?Contributors to https://github.com/ksh93/ksh -copyright?(c) 1994-2012 AT&T Intellectual Property --copyright?(c) 2020-2023 Contributors to ksh 93u+m +-copyright?(c) 2020-2024 Contributors to ksh 93u+m -license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +NAME?iffe - C compilation environment feature probe +DESCRIPTION?\biffe\b is a command interpreter that probes the C @@ -804,13 +774,8 @@ \b'"$dir"$'/\b\abase\a. } +?Generated \biffe\b headers are often referenced in C source as: - \b#include "'"$dir"$'/\b\afile\a". The \bnmake\b(1) base rules contain - metarules for generating \b'"$dir"$'/\b\afile\a from - \bfeatures/\b\afile\a\asuffix\a, where \asuffix\a may be omitted, - \b.c\b, or \b.sh\b (see the \brun\b test below). Because - \b#include\b prerequisites are automatically detected, \bnmake\b(1) - ensures that all prerequisite \biffe\b headers are generated before - compilation. Note that the directories are deliberately named + \b#include "'"$dir"$'/\b\afile\a". + Note that the directories are deliberately named \b'"$dir"$'\b and \bfeatures\b to keep case-ignorant file systems happy. +?The feature tests are:{ @@ -995,7 +960,7 @@ \bendif\b } with unnamed \b{\b ... \b}\b blocks. } +SEE ALSO?\bautoconf\b(1), \bconfig\b(1), \bgetconf\b(1), \bcrossexec\b(1), - \bnmake\b(1), \bpackage\b(1), \bsh\b(1) + \bpackage\b(1), \bsh\b(1) ' while getopts -a "$command" "$USAGE" OPT do case $OPT in
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,16 +17,27 @@ ***********************************************************************/ /* * -lm test #1 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ -#ifndef sin +#include <stdlib.h> #include <math.h> -#endif int main(void) { - sin(0.0); - fmod(100.234, 11.0); - return 0; + double f = (double)rand(); + int r = 0; + + r |= sin(f) != 0.0; + r |= fmod(f, 11.0) != 0.0; + return r; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m2.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m2.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,14 +17,24 @@ ***********************************************************************/ /* * -lm test #2 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ +#include <stdlib.h> #include <math.h> int main(void) { - double value = 0; + double value = (double)rand(); int exp = 0; int r = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m3.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m3.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,14 +17,24 @@ ***********************************************************************/ /* * -lm test #3 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ +#include <stdlib.h> #include <math.h> int main(void) { - long double value = 0; + long double value = (long double)rand(); int exp = 0; int r = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m4.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m4.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,14 +17,24 @@ ***********************************************************************/ /* * -lm test #4 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ +#include <stdlib.h> #include <math.h> int main(void) { - double value = 0; + double value = (double)rand(); return isnan(value); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m5.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m5.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,14 +17,24 @@ ***********************************************************************/ /* * -lm test #5 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ +#include <stdlib.h> #include <math.h> int main(void) { - long double value = 0; + long double value = (long double)rand(); return isnanl(value); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/m6.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/m6.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1994-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,16 +17,26 @@ ***********************************************************************/ /* * -lm test #6 + * + * This program is compiled and linked by mkreq-maplib.sh via INIT/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() call is to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ #define _ISOC99_SOURCE 1 +#include <stdlib.h> #include <math.h> int main(void) { - double value = -0.0; + double value = -((double)rand()); return !signbit(value); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/make.probe -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/make.probe
Changed
@@ -3,7 +3,7 @@ # Glenn Fowler # AT&T Research # -# @(#)make.probe (ksh 93u+m) 2023-03-09 +# @(#)make.probe (ksh 93u+m) 2024-03-23 # # C probe for make # @@ -21,6 +21,7 @@ probe_gcc_optimize="-Os" probe_gcc_version="*GgCcCc*" probe_include_local="'-ignore-source-dir -iquote' -iquote -I-" +probe_ldasneeded="-Wl,-as-needed -Wl,-no-as-needed" probe_ldlazy='-zlazyload -znolazyload -Wl,-zlazyload -Wl,-znolazyload' probe_ldlib="LD_LIBRARY_PATH LIBPATH LPATH" probe_ldmap="'-Wl,-M' '-Qoption ld -M' '-Wl,-m' '-m'" @@ -37,14 +38,10 @@ probe_optimize="-Os -O" probe_pic="-Kpic -KPIC -fpic -fPIC -pic -PIC +z +Z" probe_no_protect="'-fno-stack-protector -fno-stack-protector-all' -GS-" +probe_no_strict_aliasing="-fno-strict-aliasing" probe_readonly="-R -Krodata -xMerge -Wa,-r" probe_shared="'' -G -b -c -shared -Wl,dll" probe_shared_name="-Wl,-soname= -h" -probe_shared_nostart="-nostartfiles" -case `gcc -v 2>&1 | grep -E gcc.version` in -*version' '0123456.*) ;; -*) probe_shared_nostart= ;; # gcc 7+ -esac probe_shared_registry='"-update_registry $probe_shared_registry_file"' probe_shared_registry_file='registry.ld' probe_shared_registry_path="\$(LIBDIR)/$probe_shared_registry_file" @@ -129,6 +126,7 @@ gnu= implicitc= include_local= +ldasneeded= lddynamic= ldlazy= ldnolazy= @@ -149,6 +147,7 @@ nmedit= nmflags= no_protect= +no_strict_aliasing= optimize= prefix_archive=lib prefix_dynamic= @@ -163,7 +162,6 @@ shared= shared_name= shared_registry= -shellmagic= soversion= stdc= strict= @@ -558,6 +556,20 @@ ldnorecord=$2 break done + eval set x x $probe_ldasneeded + while : + do shift + shift + case $# in + 0) break ;; + esac + rm -f strip.$exe + $cc -o strip.$exe $1 strip.$obj $2 2>f && test -f strip.$exe || continue + cmp -s e f || continue + ldasneeded=$1 + ldnoasneeded=$2 + break + done fi case $cc_dll:$cc_pic:$so:$dynamic:$static in @@ -624,34 +636,6 @@ esac dld=$xx shared=$1 - # does -nostartfiles make sense? - z=`wc -c < xxx$dll` - eval set x $probe_shared_nostart - while : - do shift - case $# in - 0) break ;; - esac - rm -f xxx$dll - if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll - then case `wc -c < xxx$dll` in - $z) ;; - *) if test -s e - then case `cat e` in - *EeRrRrOoRr*|*WwAaRrNnIiNnGg*|*OoPpTtIiOoNn*) - continue - ;; - esac - fi - case $shared in - '') shared=$1 ;; - *) shared="$shared $1" ;; - esac - break - ;; - esac - fi - done case $cc_dll in "") cc_dll=$cc_dll_def ;; esac @@ -995,7 +979,7 @@ esac case $hosttype in -win32.*|cygwin.*|os2.*) +cygwin.*|os2.*) Lflag=1 ;; *) if $cc -c doti.$src @@ -1456,6 +1440,19 @@ esac done + eval set x $probe_no_strict_aliasing + while : + do shift + case $# in + 0) break ;; + esac + rm -f warn.$obj + $cc $1 -c warn.$src 2>e && test -f warn.$obj || continue + case $(wc -c < e) in + $e) no_strict_aliasing=$1; break ;; + esac + done + case $version_string in $probe_gcc_version) probe_optimize="$probe_gcc_optimize $probe_optimize" ;; esac @@ -1772,31 +1769,6 @@ ;; esac -# shellmagic defined if installed shell scripts need magic - -echo ': got magic : -echo ok' > ok -chmod +x ok -case `(eval ./ok | /bin/sh) 2>/dev/null` in -ok) ;; -*) echo '#!/bin/env sh -: got magic : -echo ok' > ok - chmod +x ok - case `(eval ./ok | /bin/sh) 2>/dev/null` in - ok) shellmagic='$("#")!/bin/env sh' - ;; - *) for i in /emx/bin/bash.exe /emx/bin/sh.exe - do if test -x $i - then shellmagic='$("#")!'$i - break - fi - done - ;; - esac - ;; -esac - # # path cleanup # @@ -1930,6 +1902,27 @@ esac # +# determine the need for any API version targets to add to the compiler flags +# + +CC_TARGET= +case $hosttype in +android.*) + # get current default API level + cat >_android_test.c <<-EOF + #include <stdio.h> + int main(void) { printf("%d\n", __ANDROID_API__); return 0; } + EOF + $cc -o _android_test _android_test.c + got=$(./_android_test) + (set +f; exec rm -rf _android_test*) & + # check for minimum required; we need API 26 for catopen(3) et al + if test -n "$got" && test "$got" -lt 26 + then CC_TARGET="--target=$(uname -m)-linux-android26" + fi ;; +esac + +# # set up for local override # @@ -1967,6 +1960,8 @@ CC_EXPORT_DYNAMIC=$export_dynamic CC_INCLUDE_LOCAL=$include_local CC_LD=$ld +CC_LD_ASNEEDED=$ldasneeded +CC_LD_NOASNEEDED=$ldnoasneeded CC_LD_DYNAMIC=$lddynamic CC_LD_LAZY=$ldlazy CC_LD_NOLAZY=$ldnolazy @@ -1984,6 +1979,7 @@ CC_NMEDIT=$nmedit CC_NMFLAGS=$nmflags CC_NOPROTECT=$no_protect +CC_NOSTRICTALIASING=$no_strict_aliasing CC_OPTIMIZE=$optimize CC_READONLY=$readonly CC_REPOSITORY=$repository @@ -1994,7 +1990,6 @@ CC_SHARED_NAME=$shared_name CC_SHARED_REGISTRY=$shared_registry CC_SHARED_REGISTRY_PATH=$probe_shared_registry_path -CC_SHELLMAGIC=$shellmagic CC_SIZE=$size CC_STATIC=$static CC_STDINCLUDE=$stdinclude @@ -2072,6 +2067,8 @@ *) echo CC.LD = $CC_LD ;; esac +echo CC.LD.ASNEEDED = $CC_LD_ASNEEDED +echo CC.LD.NOASNEEDED = $CC_LD_NOASNEEDED echo CC.LD.DYNAMIC = $CC_LD_DYNAMIC echo CC.LD.LAZY = $CC_LD_LAZY echo CC.LD.NOLAZY = $CC_LD_NOLAZY @@ -2092,6 +2089,7 @@ echo CC.NMEDIT ="$CC_NMEDIT" echo CC.NMFLAGS = $CC_NMFLAGS echo CC.NOPROTECT = $CC_NOPROTECT +echo CC.NOSTRICTALIASING = $CC_NOSTRICTALIASING echo CC.OPTIMIZE = $CC_OPTIMIZE echo CC.PICBIG = $CC_PICBIG echo CC.PICSMALL = $CC_PICSMALL @@ -2107,7 +2105,6 @@ echo CC.SHARED.NAME = $CC_SHARED_NAME echo CC.SHARED.REGISTRY = $CC_SHARED_REGISTRY echo CC.SHARED.REGISTRY.PATH = $CC_SHARED_REGISTRY_PATH -echo CC.SHELLMAGIC = $CC_SHELLMAGIC echo CC.SIZE = $CC_SIZE echo CC.STATIC = $CC_STATIC echo CC.STDINCLUDE = $CC_STDINCLUDE @@ -2128,6 +2125,7 @@ echo CC.SUFFIX.SHARED = $CC_SUFFIX_SHARED echo CC.SUFFIX.SOURCE = $CC_SUFFIX_SOURCE echo CC.SUFFIX.STATIC = $CC_SUFFIX_STATIC +echo CC.TARGET = $CC_TARGET echo CC.VERSION = $CC_VERSION case $CC_VERSION_STRING in *\"*) i=`echo " $CC_VERSION_STRING" | sed -e 's,",\\\\",g' -e 's,^ ,,' -e 's,.*,"&",'` ;;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mamake.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mamake.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1990-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -15,7 +15,11 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ +#if __clang__ #pragma clang diagnostic ignored "-Wparentheses" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wparentheses" +#endif /* * mamake -- MAM make @@ -23,7 +27,7 @@ * coded for portability */ -#define RELEASE_DATE "2023-04-16" +#define RELEASE_DATE "2024-06-28" static char id = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n"; #if _PACKAGE_ast @@ -34,9 +38,10 @@ static const char usage = "-?\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\n" "-author?Glenn Fowler <gsf@research.att.com>" +"-author?Martijn Dekker <martijn@inlv.org>" "-author?Contributors to https://github.com/ksh93/ksh" -"-copyright?(c) 1994-2012 AT&T Intellectual Property" -"-copyright?(c) 2020-2023 Contributors to ksh 93u+m" +"-copyright?(c) 1994-2013 AT&T Intellectual Property" +"-copyright?(c) 2020-2024 Contributors to ksh 93u+m" "-license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html" "+NAME?mamake - make abstract machine make" "+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and" @@ -68,7 +73,10 @@ " executed. Use \b-N\b to disable recursion actions too." "r:?Recursively make leaf directories matching \apattern\a. Only leaf" " directories containing a file named \bMamfile\b" -" are considered.:pattern" +" are considered. The \abind\a commands in the Mamfile" +" found in each leaf directory are scanned for leaf directory" +" prerequisites; the recursion order is determined by a topological sort" +" of these prerequisites.:pattern" "C:?Do all work in \adirectory\a. All messages will mention" " \adirectory\a.:directory" "D:?Set the debug trace level to \alevel\a. Higher levels produce more" @@ -146,14 +154,16 @@ #include <ctype.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/wait.h> #include <time.h> #if !_PACKAGE_ast +#include <errno.h> #include <stdlib.h> #include <string.h> #endif -#define delimiter(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)==';'||(c)=='('||(c)==')'||(c)=='`'||(c)=='|'||(c)=='&'||(c)=='=') +#define delimiter(c) (isspace(c)||(c)==';'||(c)=='('||(c)==')'||(c)=='`'||(c)=='|'||(c)=='&'||(c)=='=') #define add(b,c) (((b)->nxt >= (b)->end) ? append(b, "") : NULL, *(b)->nxt++ = (c)) #define get(b) ((b)->nxt-(b)->buf) @@ -161,9 +171,8 @@ #define use(b) (*(b)->nxt=0,(b)->nxt=(b)->buf) #define CHUNK 4096 -#define KEY(a,b,c,d) ((((unsigned long)(a))<<15)|(((unsigned long)(b))<<10)|(((unsigned long)(c))<<5)|(((unsigned long)(d)))) +#define KEY(a,b,c,d) ((((unsigned long)(a))<<24)|(((unsigned long)(b))<<16)|(((unsigned long)(c))<<8)|(((unsigned long)(d)))) #define NOW ((unsigned long)time(NULL)) -#define ROTATE(p,l,r,t) ((t)=(p)->l,(p)->l=(t)->r,(t)->r=(p),(p)=(t)) #define RULE_active 0x0001 /* active target */ #define RULE_dontcare 0x0002 /* ok if not found */ @@ -174,6 +183,8 @@ #define RULE_implicit 0x0040 /* implicit prerequisite */ #define RULE_made 0x0080 /* already made */ #define RULE_virtual 0x0100 /* not a file */ +#define RULE_notrace 0x0200 /* do not xtrace shell action */ +#define RULE_updated 0x0400 /* rule was outdated and remade */ #define STREAM_KEEP 0x0001 /* don't fclose() on pop() */ #define STREAM_MUST 0x0002 /* push() file must exist */ @@ -196,76 +207,85 @@ typedef struct Buf_s /* buffer stream */ { - struct Buf_s* old; /* next dropped buffer */ - char* end; /* 1 past end of buffer */ - char* nxt; /* next char to add */ - char* buf; /* buffer space */ + struct Buf_s *old; /* next dropped buffer */ + char *end; /* 1 past end of buffer */ + char *nxt; /* next char to add */ + char *buf; /* buffer space */ } Buf_t; typedef struct Dict_item_s /* dictionary item */ { - struct Dict_item_s* left; /* left child */ - struct Dict_item_s* right; /* right child */ - void* value; /* user defined value */ + struct Dict_item_s *left; /* left child */ + struct Dict_item_s *right; /* right child */ + void *value; /* user defined value */ +#if __STDC_VERSION__ >= 199901L + char name; /* 0 terminated name */ +#else char name1;/* 0 terminated name */ +#endif } Dict_item_t; typedef struct Dict_s /* dictionary handle */ { - Dict_item_t* root; /* root item */ + Dict_item_t *root; /* root item */ } Dict_t; typedef struct List_s /* Rule_t list */ { - struct List_s* next; /* next in list */ - struct Rule_s* rule; /* list item */ + struct List_s *next; /* next in list */ + struct Rule_s *rule; /* list item */ } List_t; typedef struct Rule_s /* rule item */ { - char* name; /* unbound name */ - char* path; /* bound path */ - List_t* prereqs; /* prerequisites */ - struct Rule_s* leaf; /* recursion leaf alias */ + char *name; /* unbound name */ + char *path; /* bound path */ + List_t *prereqs; /* prerequisites */ + struct Rule_s *leaf; /* recursion leaf alias */ int flags; /* RULE_* flags */ int making; /* currently make()ing */ unsigned long time; /* modification time */ + unsigned long line; /* starting line in Mamfile */ } Rule_t; typedef struct Stream_s /* input file stream stack */ { - Stdio_t* fp; /* read stream */ - char* file; /* stream path */ + Stdio_t *fp; /* read stream */ + char *file; /* stream path */ unsigned long line; /* stream line */ int flags; /* stream flags */ } Stream_t; typedef struct View_s /* viewpath level */ { - struct View_s* next; /* next level in viewpath */ + struct View_s *next; /* next level in viewpath */ int node; /* viewpath node path length */ +#if __STDC_VERSION__ >= 199901L + char dir; /* viewpath level dir prefix */ +#else char dir1; /* viewpath level dir prefix */ +#endif } View_t; static struct /* program state */ { - Buf_t* buf; /* work buffer */ - Buf_t* old; /* dropped buffers */ - Buf_t* opt; /* option buffer */ + int strict; /* strict mode activated if set */ + + Buf_t *old; /* dropped buffers */ + Buf_t *opt; /* option buffer */ - Dict_t* leaf; /* recursion leaf dictionary */ - Dict_t* libs; /* library dictionary */ - Dict_t* rules; /* rule dictionary */ - Dict_t* vars; /* variable dictionary */ + Dict_t *leaf; /* recursion leaf dictionary */ + Dict_t *rules; /* rule dictionary */ + Dict_t *vars; /* variable dictionary */ - View_t* view; /* viewpath levels */ + View_t *view; /* viewpath levels */ - char* directory; /* work in this directory */ - char* id; /* command name */ - char* file; /* first input file */ - char* pwd; /* current directory */ - char* recurse; /* recursion pattern */ - char* shell; /* ${SHELL} */ + char *directory; /* work in this directory */ + char *id; /* command name */ + char *file; /* first input file */ + char *pwd; /* current directory */ + char *recurse; /* recursion pattern */ + char *shell; /* ${SHELL} */ int active; /* targets currently active */ int debug; /* negative of debug level */ @@ -277,22 +297,28 @@ int indent; /* debug indent */ int keepgoing; /* do siblings on error */ int never; /* never execute */ - int peek; /* next line already in input */ int probed; /* probe already done */ int verified; /* don't bother with verify() */ Stream_t streams4; /* input file stream stack */ - Stream_t* sp; /* input stream stack pointer */ + Stream_t *sp; /* input stream stack pointer */ - char input8*CHUNK; /* input buffer */ + char *shim; /* finished shim */ + Buf_t *shim_buf; /* shim being built up */ } state; -static unsigned long make(Rule_t*); +static unsigned long make(Rule_t *, int, unsigned long, Buf_t **); static char mamfile = "Mamfile"; static char sh = "/bin/sh"; +static char empty = ""; -extern char** environ; +static Dict_item_t *auto_making; /* ${@} - name of rule being made */ +static Dict_item_t *auto_prev; /* ${<} - name of last prerequisite */ +static Dict_item_t *auto_allprev; /* ${^} - space-separated names of all prerequisites */ +static Dict_item_t *auto_updprev; /* ${?} - space-separated names of updated prerequisites */ + +extern char **environ; #if !_PACKAGE_ast @@ -304,8 +330,7 @@ * emit usage message and exit */ -static void -usage(void) +static void usage(void) { fprintf(stderr, "Usage: %s" " -iknFKNV" @@ -325,8 +350,7 @@ * output error message identification */ -static void -identify(Stdio_t* sp) +static void identify(Stdio_t * sp) { if (state.directory) fprintf(sp, "%s %s: ", state.id, state.directory); @@ -344,8 +368,7 @@ * >2 exit(level-2) */ -static void -report(int level, char* text, char* item, unsigned long stamp) +static void report(int level, char *text, char *item, unsigned long stamp) { int i; @@ -387,8 +410,7 @@ * don't know how to make or exit code making */ -static void -dont(Rule_t* r, int code, int keepgoing) +static void dont(Rule_t *r, int code, int keepgoing) { identify(stderr); if (!code) @@ -407,28 +429,12 @@ } /* - * local strrchr() - */ - -static char* -last(char* s, int c) -{ - char* r = 0; - - for (r = 0; *s; s++) - if (*s == c) - r = s; - return r; -} - -/* * open a buffer stream */ -static Buf_t* -buffer(void) +static Buf_t *buffer(void) { - Buf_t* buf; + Buf_t *buf; if (buf = state.old) state.old = state.old->old; @@ -443,8 +449,7 @@ * close a buffer stream */ -static void -drop(Buf_t* buf) +static void drop(Buf_t *buf) { buf->old = state.old; state.old = buf; @@ -454,8 +459,7 @@ * append str length n to buffer and return the buffer base */ -static char* -appendn(Buf_t* buf, char* str, int n) +static char *appendn(Buf_t *buf, char *str, int n) { int m; int i; @@ -479,8 +483,7 @@ * if str==0 then next pointer reset to base */ -static char* -append(Buf_t* buf, char* str) +static char *append(Buf_t *buf, char *str) { if (str) return appendn(buf, str, strlen(str)); @@ -489,30 +492,40 @@ } /* + * realloc for strings (with support for non-allocated empty string): * allocate space for s and return the copy */ -static char* -duplicate(char* s) +static char *reduplicate(char *orig, char *s) { - char* t; + char *t; int n; n = strlen(s); - if (!(t = newof(0, char, n, 1))) + if (n == 0) + { + if (orig && orig != empty) + free(orig); + return empty; + } + if (!(t = realloc(orig == empty ? NULL : orig, n + 1))) report(3, "out of memory duplicate", s, 0); strcpy(t, s); return t; } +static char *duplicate(char *s) +{ + return reduplicate(NULL, s); +} + /* * open a new dictionary */ -static Dict_t* -dictionary(void) +static Dict_t *dictionary(void) { - Dict_t* dict; + Dict_t *dict; if (!(dict = newof(0, Dict_t, 1, 0))) report(3, "out of memory dictionary", NULL, 0); @@ -520,24 +533,16 @@ } /* - * return the value for item name in dictionary dict - * if value!=0 then name entry value is created if necessary and set - * uses top-down splaying (ala Tarjan and Sleator) + * Return a pointer to item 'name' in dictionary 'dict'. + * If create!=0, then the item is created if necessary. + * Uses top-down splaying (ala Tarjan and Sleator). */ -static void* -search(Dict_t* dict, char* name, void* value) +static Dict_item_t *search(Dict_t *dict, char *name, int create) { int cmp; - Dict_item_t* root; - Dict_item_t* t; - Dict_item_t* left; - Dict_item_t* right; - Dict_item_t* lroot; - Dict_item_t* rroot; - - root = dict->root; - left = right = lroot = rroot = 0; + Dict_item_t *root = dict->root, *left = NULL, *right = NULL, *lroot = NULL, *rroot = NULL; + while (root) { if (!(cmp = strcmp(name, root->name))) @@ -546,7 +551,11 @@ { if (root->left && (cmp = strcmp(name, root->left->name)) <= 0) { - ROTATE(root, left, right, t); + /* rotate(left, right) */ + Dict_item_t *t = root->left; + root->left = t->right; + t->right = root; + root = t; if (!cmp) break; } @@ -556,13 +565,17 @@ rroot = root; right = root; root = root->left; - right->left = 0; + right->left = NULL; } else { if (root->right && (cmp = strcmp(name, root->right->name)) >= 0) { - ROTATE(root, right, left, t); + /* rotate(right, left) */ + Dict_item_t *t = root->right; + root->right = t->left; + t->left = root; + root = t; if (!cmp) break; } @@ -572,7 +585,7 @@ lroot = root; left = root; root = root->right; - left->right = 0; + left->right = NULL; } } if (root) @@ -586,20 +599,21 @@ else lroot = root->left; } - else if (value) + else if (create) { - if (!(root = newof(0, Dict_item_t, 1, strlen(name)))) + if (!(root = newof(0, Dict_item_t, 1, strlen(name) + 1))) + { report(3, "out of memory dictionary", name, 0); + abort(); + } strcpy(root->name, name); } if (root) { - if (value) - root->value = value; root->left = lroot; root->right = rroot; dict->root = root; - return value ? root->name : root->value; + return root; } if (left) { @@ -614,24 +628,25 @@ return NULL; } -/* - * return true if in strict mode - */ +static void setval(Dict_t *dict, char *name, void *value) +{ + Dict_item_t *node = search(dict, name, 1); + node->value = value; +} -static int -strict(void) +static void *getval(Dict_t *dict, char *name) { - return search(state.vars, "MAMAKE_STRICT", NULL) != NULL; + Dict_item_t *node = search(dict, name, 0); + return node ? node->value : NULL; } /* * low level for walk() */ -static int -apply(Dict_t* dict, Dict_item_t* item, int (*func)(Dict_item_t*, void*), void* handle) +static int apply(Dict_t *dict, Dict_item_t *item, int (*func)(Dict_item_t *, void *), void *handle) { - Dict_item_t* right; + Dict_item_t *right; do { @@ -648,8 +663,7 @@ * apply func to each dictionary item */ -static int -walk(Dict_t* dict, int (*func)(Dict_item_t*, void*), void* handle) +static int walk(Dict_t *dict, int (*func)(Dict_item_t *, void *), void *handle) { return dict->root ? apply(dict, dict->root, func, handle) : 0; } @@ -658,16 +672,27 @@ * return a rule pointer for name */ -static Rule_t* -rule(char* name) +static Rule_t *rule(char *name) { - Rule_t* r; + Rule_t *r; - if (!(r = (Rule_t*)search(state.rules, name, NULL))) + if (!(r = getval(state.rules, name))) { + Dict_item_t *rnode; + int n; if (!(r = newof(0, Rule_t, 1, 0))) report(3, "out of memory rule", name, 0); - r->name = (char*)search(state.rules, name, r); + rnode = search(state.rules, name, 1); + rnode->value = r; + r->name = rnode->name; + r->line = state.sp ? state.sp->line : 0; + /* + * Since ksh 93u+m removed proto(1) including the *.lic license + * atrocities, make those prerequisites optional. This allows + * testing code with old Mamfiles using the current build system. + */ + if (!state.strict && *name == '/' && (n = strlen(name)) > 4 && strcmp(name + n - 4, ".lic") == 0) + r->flags |= RULE_dontcare; } return r; } @@ -676,10 +701,9 @@ * prepend p onto rule r prereqs */ -static void -cons(Rule_t* r, Rule_t* p) +static void cons(Rule_t *r, Rule_t *p) { - List_t* x; + List_t *x; for (x = r->prereqs; x && x->rule != p; x = x->next); if (!x) @@ -696,26 +720,19 @@ * initialize the viewpath */ -static void -view(void) +static void view(void) { - char* s; - char* t; - char* p; - View_t* vp; - - View_t* zp; - int c; - int n; - - Stat_t st; - Stat_t ts; - + char *s, *t, *p; + View_t *vp, *zp; + int c, n; + Stat_t st, ts; char bufCHUNK; + Dict_item_t *vnode; if (stat(".", &st)) report(3, "cannot stat", ".", 0); - if ((s = (char*)search(state.vars, "PWD", NULL)) && !stat(s, &ts) && + vnode = search(state.vars, "PWD", 1); + if ((s = vnode->value) && !stat(s, &ts) && ts.st_dev == st.st_dev && ts.st_ino == st.st_ino) state.pwd = s; if (!state.pwd) @@ -723,11 +740,12 @@ if (!getcwd(buf, sizeof(buf) - 1)) report(3, "cannot determine PWD", NULL, 0); state.pwd = duplicate(buf); - search(state.vars, "PWD", state.pwd); + vnode->value = state.pwd; } - if ((s = (char*)search(state.vars, "VPATH", NULL)) && *s) + if ((s = getval(state.vars, "VPATH")) && *s) { - zp = 0; + p = NULL; + zp = NULL; for (;;) { for (t = s; *t && *t != ':'; t++); @@ -770,7 +788,9 @@ } } n = strlen(s); - if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1))) + if (!p) + abort(); + if (!(vp = newof(0, View_t, 1, strlen(p) + n + 2))) report(3, "out of memory view", s, 0); vp->node = n + 1; strcpy(vp->dir, s); @@ -793,8 +813,7 @@ * return next '?' or '}' in nested '}' */ -static char* -cond(char* s) +static char *cond(char *s) { int n; @@ -830,44 +849,81 @@ * expand var refs from s into buf */ -static void -substitute(Buf_t* buf, char* s) +static void substitute(Buf_t *buf, char *s) { - char* t; - char* v; - char* q; - char* b; - int c; - int n; - int a = 0; - int i; + char *t, *q; + char *v; /* variable's value */ + char *b; /* beginning: the literal expansion starting at $ */ + int c, n; + int found_AR = 0; /* 1 if ${AR} encountered */ + int valid_sh_name; /* if set, the variable name is valid in sh(1) */ while (c = *s++) { if (c == '$' && *s == '{') { b = s - 1; - i = 1; - for (n = *(t = ++s) == '-' ? 0 : '-'; (c = *s) && c != '?' && c != '+' && c != n && c != ':' && c != '=' && c != '' && c != '}'; s++) + t = ++s; + n = *t == '-' ? 0 : '-'; + valid_sh_name = 1; + while ( (c = *s) && + (c != '?' || s == t) && + c != '+' && + c != n && + c != ':' && + c != '=' && + c != '' && + c != '}' ) + { + s++; if (!isalnum(c) && c != '_') - i = 0; + valid_sh_name = 0; + } + + /* Zero-terminate the variable name */ + *s = 0; + + /* Keep unexpanded if it looks like a ksh array expansion ${varsubscript} */ + if (c == '') { append(buf, b); *s = c; continue; } - v = (char*)search(state.vars, t, NULL); - if ((c == ':' || c == '=') && (!v || c == ':' && !*v)) + + /* Obtain value */ + + v = getval(state.vars, t); + + /* + * In strict >= 2, always keep ${foo:-bar}, ${foo:+bar}, ${foo:=bar}, ${foo=bar} + * unexpanded for passing on to shell scripts in 'exec'. + * + * Before strict==2, this depends on whether the MAM variable value is nonexistent + * or (if ':') empty, which does not make a lot of sense, as that is not valid MAM + * expansion syntax and the feature is not actually implemented properly at all. + */ + + if ((c == ':' || c == '=') && (state.strict >= 2 || !v || c == ':' && !*v)) { append(buf, b); *s = c; continue; } - if (t0 == 'A' && t1 == 'R' && t2 == 0) - a = 1; + + /* A really absurd hack, see check for found_AR further below */ + + if (strcmp(t, "AR") == 0) + found_AR = 1; + + /* Un-terminate the variable name */ + *s = c; + + /* Find the ending '}', dealing with nesting */ + if (c && c != '}') { n = 1; @@ -877,9 +933,13 @@ else if (*s == '}' && !--n) break; } + + /* Special expansion syntax */ + switch (c) { case '?': + /* ${variable?c?x?y?} */ q = cond(t - 1); if (v) { @@ -913,6 +973,7 @@ break; case '+': case '-': + /* ${variable+x}, ${variable-x} */ if ((v == 0 || *v == 0) == (c == '-')) { c = *s; @@ -928,9 +989,23 @@ case '=': case '}': if (v) - { - if (a && t0 == 'm' && t1 == 'a' && t2 == 'm' && t3 == '_' && t4 == 'l' && t5 == 'i' && t6 == 'b') - { + { /* + * Perform the expansion: append the value of the variable to the buffer. + */ + if (found_AR && strncmp(t, "mam_lib", 7) == 0 && state.strict < 2) + { /* + * Absurd AT&T hack from 2007. The relevant src/cmd/INIT/RELEASE entry: + * 07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} + * i.e.: after ${AR}, expand any ${mam_lib*} to only first word of its value. + * + * In the entire AST repository's history, this has only been used once, in + * libcmd/Mamfile, to extract sumlib.o from libsum.a (to add it to libcmd.a): + * + * exec - ${AR} x ${mam_libsum} sumlib.o + * + * Taking the first word from ${mam_libsum} can very easily be handled + * by the shell script instead, so this is disabled at strict level 2+. + */ for (t = v; isspace(*t); t++); for (; *t && !isspace(*t); t++); if (*t) @@ -941,10 +1016,18 @@ if (t) *t = ' '; } - else + else if (state.strict < 2) + { + /* Recursively expand variable references in values (no loop detection)! */ substitute(buf, v); + } + else + { + /* Sanity at long last. Variables expand to their literal values. */ + append(buf, v); + } } - else if (i) + else if (valid_sh_name || state.strict >= 2) { c = *s; *s = 0; @@ -966,8 +1049,7 @@ * expand var refs from s into buf and return buf base */ -static char* -expand(Buf_t* buf, char* s) +static char *expand(Buf_t *buf, char *s) { substitute(buf, s); return use(buf); @@ -977,12 +1059,11 @@ * stat() with .exe check */ -static char* -status(Buf_t* buf, int off, char* path, struct stat* st) +static char *status(Buf_t *buf, int off, char *path, struct stat *st) { - int r; - char* s; - Buf_t* tmp; + int r; + char *s; + Buf_t *tmp; if (!stat(path, st)) return path; @@ -1016,14 +1097,11 @@ * return path to file */ -static char* -find(Buf_t* buf, char* file, struct stat* st) +static char *find(Buf_t *buf, char *file, struct stat *st) { - char* s; - View_t* vp; - int node; - int c; - int o; + char *s; + View_t *vp; + int node, c, o; if (s = status(buf, 0, file, st)) { @@ -1081,18 +1159,17 @@ * bind r to a file and return the modify time */ -static unsigned long -bindfile(Rule_t* r) +static unsigned long bindfile(Rule_t *r) { - char* s; - Buf_t* buf; + char *s; + Buf_t *buf; struct stat st; buf = buffer(); if (s = find(buf, r->name, &st)) { if (s != r->name) - r->path = duplicate(s); + r->path = reduplicate(r->path, s); r->time = st.st_mtime; r->flags |= RULE_exists; } @@ -1104,8 +1181,7 @@ * pop the current input file */ -static int -pop(void) +static int pop(void) { int r; @@ -1128,11 +1204,10 @@ * push file onto the input stack */ -static int -push(char* file, Stdio_t* fp, int flags) +static int push(char *file, Stdio_t *fp, int flags) { - char* path; - Buf_t* buf; + char *path; + Buf_t *buf; struct stat st; if (!state.sp) @@ -1141,10 +1216,10 @@ report(3, "input stream stack overflow", NULL, 0); if (state.sp->fp = fp) { - if(state.sp->file) + if (state.sp->file) free(state.sp->file); state.sp->file = strdup("pipeline"); - if(!state.sp->file) + if (!state.sp->file) report(3, "out of memory push", NULL, 0); } else if (flags & STREAM_PIPE) @@ -1152,10 +1227,10 @@ else if (!file || !strcmp(file, "-") || !strcmp(file, "/dev/stdin")) { flags |= STREAM_KEEP; - if(state.sp->file) + if (state.sp->file) free(state.sp->file); state.sp->file = strdup("/dev/stdin"); - if(!state.sp->file) + if (!state.sp->file) report(3, "out of memory push", NULL, 0); state.sp->fp = stdin; } @@ -1166,9 +1241,7 @@ { if (!(state.sp->fp = fopen(path, "r"))) report(3, "cannot read", path, 0); - if(state.sp->file) - free(state.sp->file); - state.sp->file = duplicate(path); + state.sp->file = reduplicate(state.sp->file, path); drop(buf); } else @@ -1189,21 +1262,23 @@ * return the next input line */ -static char* -input(void) +static char *input(void) { - char* e; + static char input8*CHUNK; /* input buffer */ + char *e; if (!state.sp) report(3, "no input file stream", NULL, 0); - if (state.peek) - state.peek = 0; - else if (!fgets(state.input, sizeof(state.input), state.sp->fp)) + if (!fgets(input, sizeof(input), state.sp->fp)) + { + if (ferror(state.sp->fp)) + report(3, "read error", NULL, 0); return NULL; - else if (*state.input && *(e = state.input + strlen(state.input) - 1) == '\n') + } + if (*input && *(e = input + strlen(input) - 1) == '\n') *e = 0; state.sp->line++; - return state.input; + return input; } /* @@ -1212,55 +1287,44 @@ * even on systems that otherwise demand #! magic (can you say Cygwin) */ -static int -execute(char* s) +static int execute(char *s) { - int c; - Buf_t* buf; + int stat; + pid_t pid; - if (!state.shell && (!(state.shell = (char*)search(state.vars, "SHELL", NULL)) || !strcmp(state.shell, sh))) + if (!state.shell && (!(state.shell = getval(state.vars, "SHELL")) || !strcmp(state.shell, sh))) state.shell = sh; - buf = buffer(); - append(buf, state.shell); - append(buf, " -c '"); - while (c = *s++) - { - if (c == '\'') - { - add(buf, c); - for (s--; *s == c; s++) - { - add(buf, '\\'); - add(buf, c); - } - } - add(buf, c); + pid = fork(); + if (pid < 0) + report(3, strerror(errno), "fork() failed", 0); + if (pid == 0) + { /* child */ + report(-5, s, "exec", 0); + execl(state.shell, "sh", "-c", s, (char*)0); + if (errno == ENOENT) + exit(127); + exit(126); } - add(buf, '\''); - s = use(buf); - report(-5, s, "exec", 0); - if ((c = system(s)) > 255) - c >>= 8; - drop(buf); - return c; + /* parent */ + waitpid(pid, &stat, 0); + if (WIFEXITED(stat)) + return WEXITSTATUS(stat); + if (WIFSIGNALED(stat)) + return WTERMSIG(stat) + 128; + return 128; } /* * run action s to update r */ -static unsigned long -run(Rule_t* r, char* s) +static unsigned long run(Rule_t *r, char *s) { - Rule_t* q; - char* t; - int c; - View_t* v; - int i; - int j; - int x; - Stat_t st; - Buf_t* buf; + Rule_t *q; + char *t; + int c, i, j, x; + Stat_t st; + Buf_t *buf; if (r->flags & RULE_error) return r->time; @@ -1273,33 +1337,51 @@ else x = state.exec; if (x) + { + /* stubs for backward compat */ + if (!state.strict) + append(buf, + "alias silent=\n" + "ignore() { env \"$@\" || :; }\n" + ); + /* find commands in the current working directory first */ append(buf, - /* stub for nmake's silent prefix (for backward compat) */ - "silent()\n" - "(\n" - "while test \"$#\" -gt 0\n" - "do case $1 in\n" - "*=*) export \"$1\"; shift;;\n" - "*) break;;\n" - "esac\n" - "done\n" - "\"$@\"\n" - ")\n" - /* stub for nmake's ignore prefix (for backward compat) */ - "ignore()\n" - "{\n" - "silent \"$@\" || :\n" /* always return status 0 */ - "}\n" - /* find commands in the current working directory first */ "case $PATH in\n" - ".:*) ;;\n" + ".:* | :*) ;;\n" "*) PATH=.:$PATH;;\n" "esac\n" - /* show trace for the shell action commands */ - "set -x\n" ); + /* disable global pathname expansion for safer field splitting */ + if (state.strict >= 2) + append(buf,"set -f\n"); + /* show trace for the shell action commands */ + if (!(r->flags & RULE_notrace)) + append(buf,"set -x\n"); + /* add the shim if one was set */ + if (state.shim) + append(buf, state.shim); + } + + /* + * Do viewpathing + */ + if (state.view) { + char *tofree = NULL; + if (x && state.shim) + { + /* Also subject the user-set shim to viewpathing + * (plus other code preprended above, but it should not contain anything viewpathable) */ + char *pre = use(buf); + long n = strlen(pre); + if (!(tofree = malloc(n + strlen(s) + 1))) + report(3, "out of memory run", NULL, 0); + strcpy(tofree, pre); + strcpy(tofree + n, s); + s = tofree; + } + /* Find words to apply viewpathing to */ do { for (; delimiter(*s); s++) @@ -1312,11 +1394,21 @@ append(buf, t); continue; } - if ((q = (Rule_t*)search(state.rules, t, NULL)) && q->path && !(q->flags & RULE_generated)) + /* + * If the word matches the name of a non-generated prerequisite, + * replace it with its canonical path within the source directory. + */ + if ((q = getval(state.rules, t)) && q->path && !(q->flags & RULE_generated)) append(buf, q->path); else { append(buf, t); + /* + * Viewpathing for -I cc flags (include path directories): + * duplicate every '-Ipath' and '-I path', where 'path' is a relative + * pathname (i.e. not starting with '/'). The duplicate points to the + * corresponding canonical path in the source directory. + */ if (*t == '-' && *(t + 1) == 'I' && (*(t + 2) || c)) { if (*(t + 2)) @@ -1332,7 +1424,7 @@ } if (*(t + i) && *(t + i) != '/') { - v = state.view; + View_t *v = state.view; while (v = v->next) { add(buf, ' '); @@ -1350,6 +1442,8 @@ } } while (*s = c); s = use(buf); + if (tofree) + free(tofree); } else if (x) { @@ -1384,23 +1478,17 @@ * return the full path for s using buf workspace */ -static char* -path(Buf_t* buf, char* s, int must) +static char *path(Buf_t *buf, char *s, int must) { - char* p; - char* d; - char* x; - char* e; - int c; - int t; - int o; - Stat_t st; + char *p, *d, *x, *e; + int c, t, o; + Stat_t st; for (e = s; *e && !isspace(*e); e++); t = *e; if ((x = status(buf, 0, s, &st)) && (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) return x; - if (!(p = (char*)search(state.vars, "PATH", NULL))) + if (!(p = getval(state.vars, "PATH"))) report(3, "variable not defined", "PATH", 0); do { @@ -1433,22 +1521,17 @@ * done on the first `setv CC ...' */ -static void -probe(void) +static void probe(void) { - char* cc; - char* s; - unsigned long h; - unsigned long q; - Buf_t* buf; - Buf_t* pro; - Buf_t* tmp; + char *cc, *s; + unsigned long h, q; + Buf_t *buf, *pro, *tmp; struct stat st; static char let = "ABCDEFGHIJKLMNOP"; static char cmd = "mamprobe"; - if (!(cc = (char*)search(state.vars, "CC", NULL))) + if (!(cc = getval(state.vars, "CC"))) cc = "cc"; buf = buffer(); s = path(buf, cmd, 1); @@ -1457,7 +1540,7 @@ s = cc = path(pro, cc, 1); for (h = 0; *s; s++) h = h * 0x63c63cd9L + *s + 0x9c39c33dL; - if (!(s = (char*)search(state.vars, "INSTALLROOT", NULL))) + if (!(s = getval(state.vars, "INSTALLROOT"))) report(3, "variable must be defined", "INSTALLROOT", 0); append(buf, s); append(buf, "/lib/probe/C/mam/"); @@ -1481,7 +1564,7 @@ } drop(pro); drop(buf); - make(rule("")); + make(rule(""), 0, 0, NULL); pop(); } @@ -1489,10 +1572,9 @@ * add attributes in s to r */ -static void -attributes(Rule_t* r, char* s) +static void attributes(Rule_t *r, char *s) { - char* t; + char *t; int n; for (;;) @@ -1509,8 +1591,9 @@ flag = RULE_dontcare; break; case 'g': + /* 'exec' assigns this attribute; ignore explicit assignment at strict level 1 */ if (n == 9 && !strncmp(t, "generated", n)) - flag = RULE_generated; + flag = state.strict ? -1 : RULE_generated; break; case 'i': if (n == 6 && !strncmp(t, "ignore", n)) @@ -1524,56 +1607,65 @@ break; case 'a': if (n == 7 && !strncmp(t, "archive", n)) - flag = -1; /* ignore (not implemented) */ + flag = -1; /* not implemented */ break; case 'j': if (n == 5 && !strncmp(t, "joint", n)) - flag = -1; /* ignore (not implemented) */ + flag = -1; /* not implemented */ + break; + case 'n': + if (n == 7 && !strncmp(t, "notrace", n)) + flag = RULE_notrace; break; } - if(flag > 0) + if (flag > 0) r->flags |= flag; - else if(flag == 0) + else if (flag == 0 || state.strict >= 2) { tn = '\0'; report(3, "unknown attribute", t, 0); } + else if (state.strict) + report(1, "deprecated", t, 0); } } /* * define ${mam_libX} for library reference lib + * + * lib is expected to be in the format "-lX" */ -static char* -require(char* lib, int dontcare) -{ - int c; - char* s; - char* r; - FILE* f; - Buf_t* buf; - Buf_t* tmp; - struct stat st; +#define LIB_VARPREFIX "mam_lib" - int tofree = 0; +static char *require(char *lib, int dontcare) +{ static int dynamic = -1; + char *s, *r, varname64; if (dynamic < 0) - dynamic = (s = search(state.vars, "mam_cc_L", NULL)) ? atoi(s) : 0; - if (!(r = search(state.vars, lib, NULL))) + dynamic = (s = getval(state.vars, "mam_cc_L")) ? atoi(s) : 0; + + if (strlen(lib + 2) > sizeof(varname) - sizeof(LIB_VARPREFIX)) + report(3, "-lname too long", lib, 0); + sprintf(varname, LIB_VARPREFIX "%s", lib + 2); + + if (!(r = getval(state.vars, varname))) { - buf = buffer(); - tmp = buffer(); + Buf_t *buf = buffer(), *tmp = buffer(); + int c, tofree = 0; + FILE *f; + struct stat st; + s = 0; for (;;) { if (s) append(buf, s); - if (r = search(state.vars, "mam_cc_PREFIX_ARCHIVE", NULL)) + if (r = getval(state.vars, "mam_cc_PREFIX_ARCHIVE")) append(buf, r); append(buf, lib + 2); - if (r = search(state.vars, "mam_cc_SUFFIX_ARCHIVE", NULL)) + if (r = getval(state.vars, "mam_cc_SUFFIX_ARCHIVE")) append(buf, r); r = expand(tmp, use(buf)); if (!stat(r, &st)) @@ -1587,10 +1679,10 @@ if (dynamic) { append(buf, s); - if (r = search(state.vars, "mam_cc_PREFIX_SHARED", NULL)) + if (r = getval(state.vars, "mam_cc_PREFIX_SHARED")) append(buf, r); append(buf, lib + 2); - if (r = search(state.vars, "mam_cc_SUFFIX_SHARED", NULL)) + if (r = getval(state.vars, "mam_cc_SUFFIX_SHARED")) append(buf, r); r = expand(tmp, use(buf)); if (!stat(r, &st)) @@ -1605,7 +1697,7 @@ tofree = 1; r = duplicate(r); } - search(state.vars, lib, r); + setval(state.vars, varname, r); append(tmp, lib + 2); append(tmp, ".req"); if (!(f = fopen(use(tmp), "r"))) @@ -1633,33 +1725,28 @@ } } fclose(f); - if(tofree) + if (tofree) free(r); r = use(buf); } else if (dontcare) { - append(tmp, "set +v +x\n"); - append(tmp, "cd \"${TMPDIR:-/tmp}\"\n"); - append(tmp, "echo 'int main(void){return 0;}' > x.${!-$$}.c\n"); - append(tmp, "${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c "); + append(tmp, "echo 'int main(void){return 0;}' > libtest.$$.c\n" + "${CC} ${CCFLAGS} -o libtest.$$.x libtest.$$.c "); append(tmp, r); - append(tmp, " >/dev/null 2>&1\n"); - append(tmp, "c=$?\n"); - append(tmp, "rm -f x.${!-$$}.cox\n"); - append(tmp, "exit $c\n"); + append(tmp, " >/dev/null 2>&1\n" + "c=$?\n" + "exec rm -rf libtest.$$.* &\n" /* also remove artefacts like *.dSYM dir (macOS) */ + "exit $c\n"); if (execute(expand(buf, use(tmp)))) { - if(tofree) + if (tofree) free(r); r = ""; } } r = duplicate(r); - search(state.vars, lib, r); - append(tmp, "mam_lib"); - append(tmp, lib + 2); - search(state.vars, use(tmp), r); + setval(state.vars, varname, r); drop(tmp); drop(buf); } @@ -1667,35 +1754,75 @@ } /* - * input() until `done r' + * update ${<}, ${^} and ${?} */ -static unsigned long -make(Rule_t* r) +static void update_allprev(Rule_t *r, char *all, char *upd) { - char* s; - char* t; - char* u; - char* v; - Rule_t* q; - unsigned long z; - unsigned long x; - Buf_t* buf; - Buf_t* cmd; - - r->making++; - if (r->flags & RULE_active) - state.active++; - if (*r->name) + char *name = r->name; + unsigned long n = strlen(name), nn; + /* set ${<} */ + auto_prev->value = reduplicate(auto_prev->value, name); + /* restore ${^}, append to it */ + if (nn = strlen(all)) + (all = realloc(all, nn + n + 2)) && (allnn++ = ' '); + else + all = malloc(n + 1); + if (!all) + report(3, "out of memory upd_allprev", NULL, 0); + strcpy(all + nn, name); + auto_allprev->value = all; + /* restore ${?}, append to it if rule was updated */ + if (r->flags & RULE_updated) { - z = bindfile(r); - state.indent++; - report(-1, r->name, "make", r->time); + if (nn = strlen(upd)) + (upd = realloc(upd, nn + n + 2)) && (updnn++ = ' '); + else + upd = malloc(n + 1); + if (!upd) + report(3, "out of memory upd_allprev", NULL, 0); + strcpy(upd + nn, name); } + auto_updprev->value = upd; +} + +/* + * input() until `done r' + * + * This function is called recursively for both 'make' and 'loop'. The inloop + * parameter is nonzero while processing a loop, in which case modtime and + * cmd are passed on from the caller and updated in the caller upon return. + * If inloop==0, modtime must be initialised to zero and parentcmd is ignored. + */ + +static unsigned long make(Rule_t *r, int inloop, unsigned long modtime, Buf_t **parentcmd) +{ + char *s; + char *u; /* command name */ + char *t; /* argument word */ + char *v; /* operand string */ + Rule_t *q; /* new rule */ + unsigned long x; /* new modtime */ + Buf_t *buf; /* scratch buffer */ + Buf_t *cmd; /* shell action */ + + if (inloop) + cmd = *parentcmd; else - z = 0; + { + cmd = NULL; + r->making++; + if (r->flags & RULE_active) + state.active++; + if (*r->name) + { + if (!(r->flags & RULE_virtual)) + modtime = bindfile(r); + state.indent++; + report(-1, r->name, "make", r->time); + } + } buf = buffer(); - cmd = 0; /* * Parse lines */ @@ -1718,13 +1845,14 @@ else t = v = s; /* enforce 4-letter lowercase command name */ - if(u0<'a' || u0>'z' || u1<'a' || u1>'z' || u2<'a' || u2>'z' || u3<'a' || u3>'z' || u4 && !isspace(u4)) + if (u0<'a' || u0>'z' || u1<'a' || u1>'z' || u2<'a' || u2>'z' || u3<'a' || u3>'z' || u4 && !isspace(u4)) report(3, "not a command name", u, 0); switch (KEY(u0, u1, u2, u3)) { case KEY('b','i','n','d'): - if ((t0 == '-' || t0 == '+') && t1 == 'l' && (s = require(t, !strcmp(v, "dontcare"))) && strncmp(r->name, "FEATURE/", 8) && strcmp(r->name, "configure.h")) + if (t0 == '-' && t1 == 'l' && (s = require(t, !strcmp(v, "dontcare"))) && strncmp(r->name, "FEATURE/", 8) && strcmp(r->name, "configure.h")) { + /* bind to library file */ for (;;) { for (t = s; *s && !isspace(*s); s++); @@ -1732,13 +1860,14 @@ *s = 0; else s = 0; - if (*t) + /* only bother if t is a path to a *.a we built (i.e. not -l...) */ + if (t0 && (t0 != '-' || t1 != 'l')) { q = rule(expand(buf, t)); attributes(q, v); x = bindfile(q); - if (z < x) - z = x; + if (modtime < x) + modtime = x; if (q->flags & RULE_error) r->flags |= RULE_error; } @@ -1748,29 +1877,74 @@ } } continue; + case KEY('d','o','n','e'): - q = rule(expand(buf, t)); - if (q != r && t0 != '$') - report(2, "improper done statement", t, 0); - attributes(r, v); - if (cmd && state.active && (state.force || r->time < z || !r->time && !z)) + if (inloop) { - if (state.explain && !state.force) + if (*t) + report(3, "superflous arguments", u, 0); + break; + } + if (*t) + { /* target is optional; use it for sanity check if present */ + q = rule(expand(buf, t)); + if (q != r && (t0 != '$' || state.strict)) + { + append(buf,q->name); + append(buf," != "); + append(buf,r->name); + report(3, "mismatched done statement", use(buf), 0); + } + if (*v) { + if (state.strict >= 2) + report(3, "superfluous arguments", u, 0); + else if (state.strict) + report(1, "attributes deprecated, move to 'make'", u, 0); + attributes(r, v); + } + } + if (cmd && state.active && (state.force || r->time < modtime || !r->time && !modtime)) + { + char *fname = state.sp->file, *rname = r->name, *rnamepre = "", *val; + int len; + + /* show a nice trace header */ + /* ...mamfile path: make relative to ${PACKAGEROOT} */ + if (*fname == '/' + && (val = getval(state.vars, "PACKAGEROOT")) && (len = strlen(val)) + && strncmp(fname, val, len) == 0 && fnamelen == '/' && fname++len) + fname += len; + /* ...rule name: change install root path prefix back to '${INSTALLROOT}' for brevity */ + if (*rname == '/' + && (val = getval(state.vars, "INSTALLROOT")) && (len = strlen(val)) + && strncmp(rname, val, len) == 0 && rnamelen == '/' && rnamelen + 1) + rname += len, rnamepre = "${INSTALLROOT}"; + fprintf(stderr, "\n# %s: %lu-%lu: make %s%s\n", + fname, r->line, state.sp->line, rnamepre, rname); + + /* -e option */ + if (state.explain) + { + fprintf(stderr, "# reason: "); if (!r->time) - fprintf(stderr, "%s not found\n", r->name); + fprintf(stderr, "target %s\n", + (r->flags & RULE_virtual) ? "is virtual" : "not found"); else - fprintf(stderr, "%s %lu older than prerequisites %lu\n", r->name, r->time, z); + fprintf(stderr, "target %lu older than prerequisites %lu\n", r->time, modtime); } - substitute(buf, use(cmd)); - x = run(r, use(buf)); - if (z < x) - z = x; + + /* run the shell action */ + x = run(r, use(cmd)); + if (modtime < x) + modtime = x; + r->flags |= RULE_updated; } r->flags |= RULE_made; if (!(r->flags & (RULE_dontcare|RULE_error|RULE_exists|RULE_generated|RULE_implicit|RULE_virtual))) dont(r, 0, state.keepgoing); break; + case KEY('e','x','e','c'): r->flags |= RULE_generated; if (r->path) @@ -1785,57 +1959,148 @@ add(cmd, '\n'); else cmd = buffer(); - append(cmd, v); + /* expand MAM vars now for each line, and not for the entire script at 'done', + * to avoid confusing behaviour of automatic variables such as ${<} */ + append(cmd, expand(buf, v)); + } + /* if a shim is buffered, get it ready and reset the buffer */ + if (get(state.shim_buf)) + { + state.shim = use(state.shim_buf); + /* a single 'shim -' deactivates the shim */ + if (*state.shim == '\n' && !state.shim1) + state.shim = NULL; } continue; + + case KEY('l','o','o','p'): + { + long saveoff; + char *vname, *words, *w, *nextw, *cp, *save_value; + Dict_item_t *vnode; + unsigned long saveline = state.sp->line; + + if (!*v) + report(3, "syntax error", u, 0); + /* remember current offset for repeated reading */ + if ((saveoff = ftell(state.sp->fp)) < 0) + report(3, "unseekable input", u, 0); + /* iterate through one or more whitespace-separated words */ + vname = duplicate(expand(buf, t)); + w = words = duplicate(expand(buf, v)); + vnode = search(state.vars, vname, 1); + save_value = vnode->value; + vnode->value = empty; + for (w = words; w; w = nextw) + { + /* zero-terminate current word and find next word */ + nextw = NULL; + for (cp = w; *cp && !isspace(*cp); cp++); + if (*cp) + { + *cp++ = '\0'; + for (; *cp && isspace(*cp); cp++); + if (*cp) + nextw = cp; + } + /* set iteration variable to current word */ + vnode->value = w; + /* reposition input to the start of this loop block */ + if (w != words) + { + if (fseek(state.sp->fp, saveoff, SEEK_SET) < 0) + report(3, "fseek failed", u, 0); + state.sp->line = saveline; + } + /* (re)read the loop block until 'done', in the context of the current rule */ + modtime = make(r, 1, modtime, &cmd); + } + vnode->value = save_value; + free(words); + free(vname); + continue; + } + case KEY('m','a','k','e'): - q = rule(expand(buf, t)); - if (!q->making) + { + char *save_making = auto_making->value; + char *save_allprev = auto_allprev->value; + char *save_updprev = auto_updprev->value; + char *name = expand(buf, t); + if ((q = getval(state.rules, name)) && (q->flags & RULE_made)) + report(state.strict < 3 ? 1 : 3, "rule already made", name, 0); + if (!q) + q = rule(name); + /* set ${@}; empty ${?}, ${^} and ${<} */ + auto_making->value = q->name; + auto_updprev->value = empty; + auto_allprev->value = empty; + auto_prev->value = reduplicate(auto_prev->value, empty); + if (q->making) + report(state.strict < 3 ? 1 : 3, "rule already being made", name, 0); + else { + /* make the target */ attributes(q, v); - x = make(q); - if (!(q->flags & RULE_ignore) && z < x) - z = x; + x = make(q, 0, 0, NULL); + if (!(q->flags & RULE_ignore) && modtime < x) + modtime = x; if (q->flags & RULE_error) r->flags |= RULE_error; } + /* update ${<}, restore/update ${^} and ${?} */ + if (auto_allprev->value != empty) + free(auto_allprev->value); + if (auto_updprev->value != empty) + free(auto_updprev->value); + update_allprev(q, save_allprev, save_updprev); + /* restore ${@} */ + auto_making->value = save_making; continue; + } + case KEY('p','r','e','v'): { char *name = expand(buf, t); - if (!strict()) + if (!state.strict) q = rule(name); /* for backward compat */ - else if (!(q = (Rule_t*)search(state.rules, name, NULL))) + else if (!(q = getval(state.rules, name))) { /* * 'prev' on a nonexistent rule, i.e., without a preceding 'make'...'done': * special-case this as a way to declare a simple source file prerequisite */ attributes(q = rule(name), v); - if(!(q->flags & RULE_virtual)) + if (!(q->flags & RULE_virtual)) { bindfile(q); if (!(q->flags & (RULE_dontcare | RULE_exists))) dont(q, 0, state.keepgoing); } + q->flags |= RULE_made; } else if (*v) - report(3, v, "superfluous attributes", 0); - if (!q->making) + report(3, v, "prev: superfluous attributes", 0); + if (q->making) + report(state.strict < 3 ? 1 : 3, "rule already being made", name, 0); + else { - if (!(q->flags & RULE_ignore) && z < q->time) - z = q->time; + if (!(q->flags & RULE_ignore) && modtime < q->time) + modtime = q->time; if (q->flags & RULE_error) r->flags |= RULE_error; state.indent++; report(-2, q->name, "prev", q->time); state.indent--; } + /* update ${<}, ${^} and ${?} */ + update_allprev(q, auto_allprev->value, auto_updprev->value); continue; } + case KEY('s','e','t','v'): - if (!search(state.vars, t, NULL)) + if (!getval(state.vars, t)) { - if (*v == '"') + if (*v == '"' && state.strict < 2) { s = v + strlen(v) - 1; if (*s == '"') @@ -1844,46 +2109,67 @@ v++; } } - search(state.vars, t, duplicate(expand(buf, v))); + v = duplicate(expand(buf, v)); + setval(state.vars, t, v); + if (strcmp(t, "MAMAKE_STRICT") == 0) + state.strict = *v ? atoi(v) : 1; } - if (!state.probed && t0 == 'C' && t1 == 'C' && !t2) + if (!state.probed && strcmp(t, "CC") == 0) { state.probed = 1; probe(); } continue; - case KEY('i','n','f','o'): + + case KEY('s','h','i','m'): + state.shim = NULL; + /* add line of code to shim buffer */ + if (*v) + append(state.shim_buf, expand(buf, v)); + add(state.shim_buf, '\n'); + continue; + case KEY('n','o','t','e'): - case KEY('m','e','t','a'): /* comment command */ continue; + + case KEY('i','n','f','o'): + case KEY('m','e','t','a'): + if (!state.strict) + continue; + /* FALLTHROUGH */ + default: report(3, "unknown command", u, 0); } break; } drop(buf); + if (inloop) + { + *parentcmd = cmd; + return modtime; + } if (cmd) drop(cmd); if (*r->name) { - report(-1, r->name, "done", z); + report(-1, r->name, "done", modtime); state.indent--; } if (r->flags & RULE_active) state.active--; r->making--; - return r->time = z; + return r->time = modtime; } /* * verify that active targets were made */ -static int -verify(Dict_item_t* item, void* handle) +static int verify(Dict_item_t *item, void *handle) { - Rule_t* r = (Rule_t*)item->value; + Rule_t *r = item->value; if ((r->flags & (RULE_active|RULE_error|RULE_made)) == RULE_active) dont(r, 0, 1); @@ -1894,41 +2180,59 @@ * return 1 if name is an initializer */ -static int -initializer(char* name) +static int initializer(char *name) { - char* s; + char *s; - if (s = last(name, '/')) + if (s = strrchr(name, '/')) s++; else s = name; - return s0 == 'I' && s1 == 'N' && s2 == 'I' && s3 == 'T'; + return !strncmp(s, "INIT", 4); } /* * update recursion leaf r and its prerequisites */ -static int -update(Rule_t* r) +static int update(Rule_t *r) { - List_t* x; - Buf_t* buf; - - static char cmd = "${MAMAKE} -C "; - static char arg = " ${MAMAKEARGS}"; + List_t *x; + Buf_t *buf; + /* topological sort */ r->flags |= RULE_made; if (r->leaf) r->leaf->flags |= RULE_made; for (x = r->prereqs; x; x = x->next) if (x->rule->leaf && !(x->rule->flags & RULE_made)) update(x->rule); + buf = buffer(); - substitute(buf, cmd); + + /* announce */ + { + char *p, *q; + int n; + append(buf, state.pwd); + add(buf, '/'); + append(buf, r->name); + p = use(buf); + /* show path relative to ${INSTALLROOT} */ + q = getval(state.vars, "INSTALLROOT"); + if (q && strncmp(p, q, n = strlen(q)) == 0) + p += n + 1; + fprintf(stderr, "\n# ... making %s ...\n", p); + if (state.explain) + fprintf(stderr, "# reason: recursion\n"); + } + + /* do */ + append(buf, getval(state.vars, "MAMAKE")); + append(buf, " -C "); append(buf, r->name); - substitute(buf, arg); + add(buf, ' '); + append(buf, getval(state.vars, "MAMAKEARGS")); run(r, use(buf)); drop(buf); return 0; @@ -1938,31 +2242,12 @@ * scan Mamfile prereqs */ -static int -scan(Dict_item_t* item, void* handle) +static int scan(Dict_item_t *item, void *handle) { - Rule_t* r = (Rule_t*)item->value; - char* s; - char* t; - char* u; - char* w; - Rule_t* q; - int i; - int j; - int k; - int p; - Buf_t* buf; - - static char* files = - { - "Mamfile" - /* ksh 93u+m no longer uses these: - * "Nmakefile", - * "nmakefile", - * "Makefile", - * "makefile" - */ - }; + Rule_t *r = item->value; + char *s, *t; + Rule_t *q; + Buf_t *buf; /* * drop non-leaf rules @@ -1982,149 +2267,31 @@ return 0; } buf = buffer(); - for (i = 0; i < elementsof(files); i++) + append(buf, r->name); + add(buf, '/'); + append(buf, mamfile); + if (push(use(buf), NULL, 0)) { - append(buf, r->name); - add(buf, '/'); - append(buf, filesi); - if (push(use(buf), NULL, 0)) + while (s = input()) { - while (s = input()) - { - j = p = 0; - while (*s) - { - for (k = 1; isspace(i = *s) || i == '"' || i == '\''; s++); - for (t = s; (i = *s) && !isspace(i) && i != '"' && i != '\'' && i != '\\' && i != ':'; s++) - if (i == '/') - t = s + 1; - else if (i == '.' && *(s + 1) != 'c' && *(s + 1) != 'C' && *(s + 1) != 'h' && *(s + 1) != 'H' && t0 == 'l' && t1 == 'i' && t2 == 'b') - *s = 0; - if (*s) - *s++ = 0; - if (!t0) - k = 0; - else if ((t0 == '-' || t0 == '+') && t1 == 'l' && t2) - { - append(buf, "lib"); - append(buf, t + 2); - t = use(buf); - } - else if (p) - { - if (t0 == '+' && !t1) - p = 2; - else if (p == 1) - { - if (i != ':' || strncmp(s, "command", 7)) - { - append(buf, "lib"); - append(buf, t); - t = use(buf); - } - if (i == ':') - while (*s && isspace(*s)) - s++; - } - } - else if (i == ':') - { - if (j != ':' || !isupper(*t)) - k = 0; - else if (!strcmp(t, "PACKAGE")) - { - p = 1; - k = 0; - } - else - { - for (u = t; *u; u++) - { - if (isupper(*u)) - *u = tolower(*u); - else if (!isalnum(*u)) - { - k = 0; - break; - } - } - } - } - else if (t0 != 'l' || t1 != 'i' || t2 != 'b') - k = 0; - else - { - for (u = t + 3; *u; u++) - { - if (!isalnum(*u)) - { - k = 0; - break; - } - } - } - if (k && ((q = (Rule_t*)search(state.leaf, t, NULL)) && q != r || *t++ == 'l' && *t++ == 'i' && *t++ == 'b' && *t && (q = (Rule_t*)search(state.leaf, t, NULL)) && q != r)) - { - for (t = w = r->name; *w; w++) - if (*w == '/') - t = w + 1; - if (t0 == 'l' && t1 == 'i' && t2 == 'b') - t += 3; - for (u = w = q->name; *w; w++) - if (*w == '/') - u = w + 1; - if (strcmp(t, u)) - cons(r, q); - } - j = i; - } - } - pop(); - for (s = 0, w = r->name; *w; w++) - if (*w == '/') - s = w; - if (s) - { - if ((s - r->name) > 3 && *(s - 1) == 'b' && *(s - 2) == 'i' && *(s - 3) == 'l' && *(s - 4) != '/') - { - /* - * foolib : foo : libfoo - */ - - *(s - 3) = 0; - q = (Rule_t*)search(state.leaf, r->name, NULL); - if (q && q != r) - cons(r, q); - for (t = w = r->name; *w; w++) - if (*w == '/') - t = w + 1; - append(buf, "lib"); - append(buf, t); - q = (Rule_t*)search(state.leaf, use(buf), NULL); - if (q && q != r) - cons(r, q); - *(s - 3) = 'l'; - } - else if (((s - r->name) != 3 || *(s - 1) != 'b' || *(s - 2) != 'i' || *(s - 3) != 'l') && (*(s + 1) != 'l' || *(s + 2) != 'i' || *(s + 3) != 'b')) - { - /* - * huh/foobar : lib/libfoo - */ - - s++; - t = s + strlen(s); - while (--t > s) - { - append(buf, "lib/lib"); - appendn(buf, s, t - s); - q = (Rule_t*)search(state.leaf, use(buf), NULL); - if (q && q != r) - cons(r, q); - } - } - } - break; + for (; isspace(*s); s++); + /* examine only commands of the form bind -lfoo */ + if (s0 != 'b' || s1 != 'i' || s2 != 'n' || s3 != 'd' || !isspace(s4)) + continue; + for (s += 5; isspace(*s); s++); + if (s0 != '-' || s1 != 'l' || !s2) + continue; + /* construct potential leaf directory name */ + append(buf, "lib"); + append(buf, s + 2); + t = use(buf); + for (s = t; *s && !isspace(*s); s++); + *s = '\0'; + /* add a rule and prepend it onto the prerequisites */ + if ((q = getval(state.leaf, t)) && q != r) + cons(r, q); } + pop(); } drop(buf); return 0; @@ -2134,12 +2301,11 @@ * descend into op and its prereqs */ -static int -descend(Dict_item_t* item, void* handle) +static int descend(Dict_item_t *item, void *handle) { - Rule_t* r = (Rule_t*)item->value; + Rule_t *r = item->value; - if (!state.active && (!(r->flags & RULE_active) || !(r = (Rule_t*)search(state.leaf, r->name, NULL)))) + if (!state.active && (!(r->flags & RULE_active) || !(r = getval(state.leaf, r->name)))) return 0; return r->leaf && !(r->flags & RULE_made) ? update(r) : 0; } @@ -2148,14 +2314,13 @@ * append the non-leaf active targets to state.opt */ -static int -active(Dict_item_t* item, void* handle) +static int active(Dict_item_t *item, void *handle) { - Rule_t* r = (Rule_t*)item->value; + Rule_t *r = item->value; if (r->flags & RULE_active) { - if (r->leaf || search(state.leaf, r->name, NULL)) + if (r->leaf || getval(state.leaf, r->name)) state.active = 0; else { @@ -2170,14 +2335,11 @@ * recurse on mamfiles in subdirs matching pattern */ -static int -recurse(char* pattern) +static int recurse(char *pattern) { - char* s; - char* t; - Rule_t* r; - Buf_t* buf; - Buf_t* tmp; + char *s, *t; + Rule_t *r; + Buf_t *buf, *tmp; struct stat st; /* @@ -2200,12 +2362,12 @@ if (find(tmp, use(buf), &st)) { r = rule(s); - if (t = last(r->name, '/')) + if (t = strrchr(r->name, '/')) t++; else t = r->name; r->leaf = rule(t); - search(state.leaf, t, r); + setval(state.leaf, t, r); } } pop(); @@ -2221,7 +2383,7 @@ state.active = 1; walk(state.rules, active, NULL); } - search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + setval(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); /* * scan the Mamfile and descend @@ -2238,15 +2400,11 @@ return 0; } -int -main(int argc, char** argv) +int main(int argc, char **argv) { - char** e; - char* s; - char* t; - char* v; - Buf_t* tmp; - int c; + char **e, *s, *t, *v; + Buf_t *tmp; + int c; /* * initialize the state @@ -2257,9 +2415,10 @@ state.exec = 1; state.file = mamfile; state.opt = buffer(); + state.shim_buf = buffer(); state.rules = dictionary(); state.vars = dictionary(); - search(state.vars, "MAMAKE", *argv); + setval(state.vars, "MAMAKE", *argv); /* * parse the options @@ -2297,7 +2456,8 @@ case 'K': continue; case 'V': - fprintf(stdout, "%s\n", id + 10); + write(1, id + 10, strlen(id) - 12); + putchar('\n'); exit(0); case 'f': append(state.opt, " -f "); @@ -2317,11 +2477,11 @@ continue; case 'G': append(state.opt, " -G"); - search(state.vars, "-debug-symbols", "1"); + setval(state.vars, "-debug-symbols", "1"); continue; case 'S': append(state.opt, " -S"); - search(state.vars, "-strip-symbols", "1"); + setval(state.vars, "-strip-symbols", "1"); continue; case '?': error(ERROR_usage(2), "%s", opt_info.arg); @@ -2365,7 +2525,7 @@ c = 0; v = "1"; } - search(state.vars, s - 1, v); + setval(state.vars, s - 1, v); if (c) *t = c; continue; @@ -2404,16 +2564,17 @@ continue; case 'G': append(state.opt, " -G"); - search(state.vars, "-debug-symbols", "1"); + setval(state.vars, "-debug-symbols", "1"); continue; case 'K': continue; case 'S': append(state.opt, " -S"); - search(state.vars, "-strip-symbols", "1"); + setval(state.vars, "-strip-symbols", "1"); continue; case 'V': - fprintf(stdout, "%s\n", id + 10); + write(1, id + 10, strlen(id) - 12); + putchar('\n'); exit(0); case 'f': case 'r': @@ -2459,6 +2620,13 @@ #endif /* + * option incompatibility + */ + + if (state.force) + state.explain = 0; + + /* * load the environment */ @@ -2469,7 +2637,7 @@ if (*t == '=') { *t = 0; - search(state.vars, s, t + 1); + setval(state.vars, s, t + 1); *t = '='; break; } @@ -2477,6 +2645,16 @@ } /* + * initialize the automatic variables + */ + + auto_making = search(state.vars, "@", 1); + auto_prev = search(state.vars, "<", 1); + auto_allprev = search(state.vars, "^", 1); + auto_updprev = search(state.vars, "?", 1); + auto_making->value = auto_prev->value = auto_allprev->value = auto_updprev->value = empty; + + /* * grab the command line targets and variable definitions */ @@ -2491,11 +2669,11 @@ t--; c = *t; *t = 0; - search(state.vars, s, v); + setval(state.vars, s, v); tmp = buffer(); append(tmp, s); append(tmp, ".FORCE"); - search(state.vars, use(tmp), v); + setval(state.vars, use(tmp), v); drop(tmp); *t = c; break; @@ -2541,9 +2719,9 @@ * read the mamfile(s) and bring the targets up to date */ - search(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); + setval(state.vars, "MAMAKEARGS", duplicate(use(state.opt) + 1)); push(state.file, NULL, STREAM_MUST); - make(rule("")); + make(rule(""), 0, 0, NULL); pop(); /*
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mamake.rt -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mamake.rt
Changed
@@ -1,40 +1,99 @@ NOTE regression tests for the mamake command +# To regenerate mamake.tst from this file: +# +# bin/package use +# cd src/cmd/INIT +# VPATH=.:. mktest mamake.rt > mamake.tst +# +# WARNING: the regeneration assumes mamake's output is correct, so VERIFY THE RESULTS! +# Always do 'git diff mamake.tst' to check that no unexpected changes have been made. +# +# WARNING 2: do not use 'Mamfile' as the data file for the tests, or the +# regeneration will overwrite and then delete the local Mamfile. Mamake +# supports an -f option to use an alternative file name. + UNIT mamake -TEST macros +# ====== +# the one original AT&T test -- changed to test both legacy and strict mode + +for strict in '' 'setv MAMAKE_STRICT 1' 'setv MAMAKE_STRICT 2' +do + +TEST expansions ${strict:+at strict level ${strict##* }} -DATA Mamfile <<'!' -info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 +DATA ._tmp_Mamfile_ <<EOF +${strict:-info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05} setv DEFINED defined setv EMPTY -make all - -exec - echo DEFINED ${DEFINED} -exec - echo DEFINED:VALUE ${DEFINED:VALUE} -exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} -exec - echo DEFINED=VALUE ${DEFINED=VALUE} -exec - echo DEFINEDVALUE ${DEFINEDVALUE} -exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} -exec - echo DEFINED.COMPONENTVALUE ${DEFINED.COMPONENTVALUE} - -exec - echo EMPTY ${EMPTY} -exec - echo EMPTY:VALUE ${EMPTY:VALUE} -exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} -exec - echo EMPTY=VALUE ${EMPTY=VALUE} -exec - echo EMPTYVALUE ${EMPTYVALUE} -exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} -exec - echo EMPTY.COMPONENTVALUE ${EMPTY.COMPONENTVALUE} - -exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} -exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} -exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} -exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} -exec - echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} -exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} -exec - echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVALUE} - -done all generated virtual -! - -EXEC -n +make all virtual + +exec - echo DEFINED \${DEFINED} +exec - echo DEFINED:VALUE \${DEFINED:VALUE} +exec - echo DEFINED:-VALUE \${DEFINED:-VALUE} +exec - echo DEFINED=VALUE \${DEFINED=VALUE} +exec - echo DEFINEDVALUE \${DEFINEDVALUE} +exec - echo DEFINED.COMPONENT \${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENTVALUE \${DEFINED.COMPONENTVALUE} + +exec - echo EMPTY \${EMPTY} +exec - echo EMPTY:VALUE \${EMPTY:VALUE} +exec - echo EMPTY:-VALUE \${EMPTY:-VALUE} +exec - echo EMPTY=VALUE \${EMPTY=VALUE} +exec - echo EMPTYVALUE \${EMPTYVALUE} +exec - echo EMPTY.COMPONENT \${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENTVALUE \${EMPTY.COMPONENTVALUE} + +exec - echo __NoT_DeFiNeD__ \${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE \${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE \${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE \${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__VALUE \${__NoT_DeFiNeD__VALUE} +exec - echo __NoT_DeFiNeD__.COMPONENT \${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENTVALUE \${__NoT_DeFiNeD__.COMPONENTVALUE} + +done all +EOF + +EXEC -n -f ._tmp_Mamfile_ + +done # for strict + +# ====== +# simple loop construct; automatic variables; notrace attribute + +TEST nested loop with notrace +DATA ._tmp_Mamfile_ <<\EOF +setv MAMAKE_STRICT +make looptest virtual + loop v1 one two three + loop v2 four five six + make ${v1}_${v2} virtual notrace + exec - echo '${v1}: ${v2}' + done + done + done + exec - : the current target is ${@} + exec - : the last target was ${<} + exec - : the targets were ${^} + exec - : the updated targets were ${?} +done +EOF +EXEC -f ._tmp_Mamfile_ + +TEST shim, \'exec\' in loop +DATA ._tmp_Mamfile_ <<\EOF +setv MAMAKE_STRICT 2 +setv _iter_ vertier +shim - echo KIJK EENS HIER >&2 +make shimtest virtual notrace + make looptest virtual notrace + loop _iter_ een twee drie vier + exec - echo ${_iter_} hoedje${_iter_?een??s} van papier >&2 + done + done + exec - echo "nu is 't gedaan met 't ${_iter_}" >&2 +done +EOF +EXEC -f ._tmp_Mamfile_
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mamake.tst -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mamake.tst
Changed
@@ -4,14 +4,14 @@ UNIT mamake -TEST 01 macros +TEST 01 expansions - EXEC -n + EXEC -n -f ._tmp_Mamfile_ INPUT -n - - INPUT Mamfile $'info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 + INPUT ._tmp_Mamfile_ $'info mam static 00000 1994-07-17 make (AT&T Research) 5.3 2009-05-05 setv DEFINED defined setv EMPTY -make all +make all virtual exec - echo DEFINED ${DEFINED} exec - echo DEFINED:VALUE ${DEFINED:VALUE} @@ -38,7 +38,7 @@ exec - echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVAL'\ $'UE} -done all generated virtual' +done all' OUTPUT - $'echo DEFINED defined echo DEFINED:VALUE echo DEFINED:-VALUE @@ -60,4 +60,202 @@ echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} echo __NoT_DeFiNeD__.COMPONENT echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVALUE}' - ERROR -n - + ERROR - $'\n# ._tmp_Mamfile_: 4-30: make all' + +TEST 02 'expansions at strict level 1' + + EXEC -n -f ._tmp_Mamfile_ + INPUT -n - + INPUT ._tmp_Mamfile_ $'setv MAMAKE_STRICT 1 +setv DEFINED defined +setv EMPTY +make all virtual + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINEDVALUE ${DEFINEDVALUE} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENTVALUE ${DEFINED.COMPONENTVALUE} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTYVALUE ${EMPTYVALUE} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENTVALUE ${EMPTY.COMPONENTVALUE} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVAL'\ +$'UE} + +done all' + OUTPUT - $'echo DEFINED defined +echo DEFINED:VALUE +echo DEFINED:-VALUE +echo DEFINED=VALUE defined +echo DEFINEDVALUE ${DEFINEDVALUE} +echo DEFINED.COMPONENT +echo DEFINED.COMPONENTVALUE ${DEFINED.COMPONENTVALUE} +echo EMPTY +echo EMPTY:VALUE ${EMPTY:VALUE} +echo EMPTY:-VALUE ${EMPTY:-VALUE} +echo EMPTY=VALUE +echo EMPTYVALUE ${EMPTYVALUE} +echo EMPTY.COMPONENT +echo EMPTY.COMPONENTVALUE ${EMPTY.COMPONENTVALUE} +echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} +echo __NoT_DeFiNeD__.COMPONENT +echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVALUE}' + ERROR - $'\n# ._tmp_Mamfile_: 4-30: make all' + +TEST 03 'expansions at strict level 2' + + EXEC -n -f ._tmp_Mamfile_ + INPUT -n - + INPUT ._tmp_Mamfile_ $'setv MAMAKE_STRICT 2 +setv DEFINED defined +setv EMPTY +make all virtual + +exec - echo DEFINED ${DEFINED} +exec - echo DEFINED:VALUE ${DEFINED:VALUE} +exec - echo DEFINED:-VALUE ${DEFINED:-VALUE} +exec - echo DEFINED=VALUE ${DEFINED=VALUE} +exec - echo DEFINEDVALUE ${DEFINEDVALUE} +exec - echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +exec - echo DEFINED.COMPONENTVALUE ${DEFINED.COMPONENTVALUE} + +exec - echo EMPTY ${EMPTY} +exec - echo EMPTY:VALUE ${EMPTY:VALUE} +exec - echo EMPTY:-VALUE ${EMPTY:-VALUE} +exec - echo EMPTY=VALUE ${EMPTY=VALUE} +exec - echo EMPTYVALUE ${EMPTYVALUE} +exec - echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +exec - echo EMPTY.COMPONENTVALUE ${EMPTY.COMPONENTVALUE} + +exec - echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +exec - echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +exec - echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +exec - echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +exec - echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} +exec - echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +exec - echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVAL'\ +$'UE} + +done all' + OUTPUT - $'echo DEFINED defined +echo DEFINED:VALUE ${DEFINED:VALUE} +echo DEFINED:-VALUE ${DEFINED:-VALUE} +echo DEFINED=VALUE ${DEFINED=VALUE} +echo DEFINEDVALUE ${DEFINEDVALUE} +echo DEFINED.COMPONENT ${DEFINED.COMPONENT} +echo DEFINED.COMPONENTVALUE ${DEFINED.COMPONENTVALUE} +echo EMPTY +echo EMPTY:VALUE ${EMPTY:VALUE} +echo EMPTY:-VALUE ${EMPTY:-VALUE} +echo EMPTY=VALUE ${EMPTY=VALUE} +echo EMPTYVALUE ${EMPTYVALUE} +echo EMPTY.COMPONENT ${EMPTY.COMPONENT} +echo EMPTY.COMPONENTVALUE ${EMPTY.COMPONENTVALUE} +echo __NoT_DeFiNeD__ ${__NoT_DeFiNeD__} +echo __NoT_DeFiNeD__:VALUE ${__NoT_DeFiNeD__:VALUE} +echo __NoT_DeFiNeD__:-VALUE ${__NoT_DeFiNeD__:-VALUE} +echo __NoT_DeFiNeD__=VALUE ${__NoT_DeFiNeD__=VALUE} +echo __NoT_DeFiNeD__VALUE ${__NoT_DeFiNeD__VALUE} +echo __NoT_DeFiNeD__.COMPONENT ${__NoT_DeFiNeD__.COMPONENT} +echo __NoT_DeFiNeD__.COMPONENTVALUE ${__NoT_DeFiNeD__.COMPONENTVALUE}' + ERROR - $'\n# ._tmp_Mamfile_: 4-30: make all' + +TEST 04 'nested loop with notrace' + + EXEC -f ._tmp_Mamfile_ + INPUT -n - + INPUT ._tmp_Mamfile_ $'setv MAMAKE_STRICT +make looptest virtual +\tloop v1 one two three +\t\tloop v2 four five six +\t\t\tmake ${v1}_${v2} virtual notrace +\t\t\t\texec - echo \'${v1}: ${v2}\' +\t\t\tdone +\t\tdone +\tdone +\texec - : the current target is ${@} +\texec - : the last target was ${<} +\texec - : the targets were ${^} +\texec - : the updated targets were ${?} +done' + OUTPUT - $'one: four +one: five +one: six +two: four +two: five +two: six +three: four +three: five +three: six' + ERROR - $' +# ._tmp_Mamfile_: 5-7: make one_four + +# ._tmp_Mamfile_: 5-7: make one_five + +# ._tmp_Mamfile_: 5-7: make one_six + +# ._tmp_Mamfile_: 5-7: make two_four + +# ._tmp_Mamfile_: 5-7: make two_five + +# ._tmp_Mamfile_: 5-7: make two_six + +# ._tmp_Mamfile_: 5-7: make three_four + +# ._tmp_Mamfile_: 5-7: make three_five + +# ._tmp_Mamfile_: 5-7: make three_six + +# ._tmp_Mamfile_: 2-14: make looptest ++ : the current target is looptest ++ : the last target was three_six ++ : the targets were one_four one_five one_six two_four two_five two_six thr'\ +$'ee_four three_five three_six ++ : the updated targets were one_four one_five one_six two_four two_five two'\ +'_six three_four three_five three_six' + +TEST 05 $'shim, \'exec\' in loop' + + EXEC -f ._tmp_Mamfile_ + INPUT -n - + INPUT ._tmp_Mamfile_ $'setv MAMAKE_STRICT 2 +setv _iter_ vertier +shim - echo KIJK EENS HIER >&2 +make shimtest virtual notrace +\tmake looptest virtual notrace +\t\tloop _iter_ een twee drie vier +\t\t\texec - echo ${_iter_} hoedje${_iter_?een??s} van papier >&2 +\t\tdone +\tdone +\texec - echo "nu is \'t gedaan met \'t ${_iter_}" >&2 +done' + OUTPUT - + ERROR - $' +# ._tmp_Mamfile_: 5-9: make looptest +KIJK EENS HIER +een hoedje van papier +twee hoedjes van papier +drie hoedjes van papier +vier hoedjes van papier + +# ._tmp_Mamfile_: 4-11: make shimtest +KIJK EENS HIER +nu is \'t gedaan met \'t vertier'
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mamprobe.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mamprobe.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -22,13 +22,7 @@ command=mamprobe -bins=` - ( - userPATH=$PATH - PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH - getconf PATH 2>/dev/null && echo "$userPATH" || echo /bin:/usr/bin:/sbin:/usr/sbin:"$userPATH" - ) | sed 's/:/ /g' -` || exit +bins=$(echo "$DEFPATH:$PATH" | sed 's/:/ /g') || exit # check the options @@ -37,7 +31,7 @@ case `(getopts '-123:xyz' opt --xyz; echo 0$opt) 2>/dev/null` in 0123) USAGE=$' -? -@(#)$Id: mamprobe (ksh 93u+m) 2022-10-26 $ +@(#)$Id: mamprobe (ksh 93u+m) 2024-03-05 $ +NAME?mamprobe - generate MAM cc probe info +DESCRIPTION?\bmamprobe\b generates MAM (make abstract machine) \bcc\b(1) @@ -48,10 +42,7 @@ of \acc-path\a. Any \ainfo-file\a directories are created if needed. If \ainfo-file\a is \b-\b then the probe information is written to the standard output. -+?\bmamprobe\b and \bmamake\b are used in the bootstrap phase of - \bpackage\b(1) installation before \bnmake\b(1) is built. The - probed variable names are the \bnmake\b(1) names with a \bmam_\b - prefix, \bCC\b converted to \bcc\b, and \b.\b converted to \b_\b. ++?The probed variable names get a \bmam_\b prefix. Additional variables are:{ +_hosttype_?the \bpackage\b(1) host type +mam_cc_L?\b-L\b\adir\a supported @@ -69,7 +60,7 @@ info-file cc-path -+SEE ALSO?\bpackage\b(1), \bmamake\b(1), \bnmake\b(1), \bprobe\b(1) ++SEE ALSO?\bpackage\b(1), \bmamake\b(1), \bprobe\b(1) ' while getopts -a "$command" "$USAGE" OPT do case $OPT in @@ -215,6 +206,7 @@ echo 'setv _hosttype_ ${mam_cc_HOSTTYPE}' # STD* are standard commands/flags +# (Deprecated; kept for backward compatibility) if ( ed <<!
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mkreq-maplib.sh
Added
@@ -0,0 +1,92 @@ +######################################################################## +# # +# This file is part of the ksh 93u+m package # +# Copyright (c) 1984-2012 AT&T Intellectual Property # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # +# and is licensed under the # +# Eclipse Public License, Version 2.0 # +# # +# A copy of the License is available at # +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # +# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # +# # +# Glenn Fowler <gsf@research.att.com> # +# Martijn Dekker <martijn@inlv.org> # +# # +######################################################################## + +# Generator for INIT's *.req library dependency files. +# This script is designed to be called from src/cmd/INIT/Mamfile only. +# It is based on the the code generated by the nmake MAPLIB +# rule from src/cmd/INIT/MAPLIB.mk, and replaces the latter. + +# Set options. +case ${ZSH_VERSION+z} in +z) emulate ksh ;; +*) (command set -o posix) 2>/dev/null && set -o posix ;; +esac +set -o noglob -o nounset +: $INSTALLROOT # error out early + +# Get colon-separated compiler invocation from arguments. +# Like this whole build system, we assume arguments do not contain +# spaces, or if they do, that they are meant to be field-split. +allcc= +while test "$#" -gt 0 && test "$1" != ":" +do allcc=$allcc${allcc:+ }$1 + shift +done +test "${1-}" = ":" || { echo "$0: bad arguments" >&2; exit 1; } +shift + +# Get the .req basename. +req=$1 +shift +test "${1-}" = ":" || { echo "$0: bad arguments" >&2; exit 1; } +shift + +# Get the source file names. +src= +while test "$#" -gt 0 && test "$1" != ":" +do src=$src${src:+ }$1 + shift +done +test "${1-}" = ":" || { echo "$0: bad arguments" >&2; exit 1; } +shift + +# Get the libraries to test. +libs= +while test "$#" -gt 0 +do # for each lib name also add '-' + libs="$libs${libs:+ }$1 -" + shift +done + +# Setup. +trap 'set +o noglob; rm -rf "$req".exe*' 0 + +######### Main ########## +# Generate .req file. # +######################### +r=' -' +for i in $src +do if $allcc -c $i >/dev/null 2>&1 + then rm $(basename $i .c).o & + g= + for p in $libs + do case $p in + -) if $allcc -o $req.exe $i $g >/dev/null 2>&1 + then if ! $allcc -o $req.exe $i >/dev/null 2>&1 + then r=$g + break 2 + fi + fi + g= + ;; + *) g="$g -l$p" + ;; + esac + done + fi +done +echo "$r" > $req.req
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mkreq.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mkreq.sh
Changed
@@ -2,7 +2,7 @@ # # # This file is part of the ksh 93u+m package # # Copyright (c) 1984-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -95,13 +95,10 @@ echo " -l$self" for name do if test -f $INSTALLROOT/lib/lib/$name - then y=$(cat $INSTALLROOT/lib/lib/$name) - case $y in - *-?*) echo "" $y ;; - esac + then grep '^ -l.' $INSTALLROOT/lib/lib/$name continue elif test ! -f $INSTALLROOT/lib/lib$name.a then try_to_link $name -L$INSTALLROOT/lib || try_to_link $name || continue fi echo " -l$name" -done +done | sort -u
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/mktest.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/mktest.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -35,7 +35,7 @@ -author?Glenn Fowler <gsf@research.att.com> -copyright?Copyright (c) 2005-2012 AT&T Intellectual Property -license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html -+NAME?mktest - generate a regression test scripts ++NAME?mktest - generate regression test scripts +DESCRIPTION?\bmktest\b generates regression test scripts from test template commands in the \aunit\a.\brt\b file. The generated test script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/proto.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/proto.sh
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2021 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -18,16 +17,23 @@ # compiling older AST code (with Mamfiles containing proto commands) using the # current INIT system. This stub ignores all options, then invokes 'cat'. +usage() +{ + echo 'Usage: proto -dfhinprstvzP+S -C directory -e package -l file' + echo ' -o "name='\''value'\'' ..." -L file file ...' + exit 2 +} >&2 + while getopts ':dfhinprstvzPSC:e:l:o:L:' opt do case $opt in + :) usage + ;; \?) case $OPTARG in +) ;; - *) echo "proto: $OPTARG: unknown option" - echo 'Usage: proto -dfhinprstvzP+S -C directory -e package -l file' - echo ' -o "name='\''value'\'' ..." -L file file ...' - exit 2 + *) echo "proto: $OPTARG: unknown option" >&2 + usage ;; - esac >&2 + esac ;; esac done
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/INIT/regress.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/regress.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -21,10 +21,11 @@ case $(getopts '-123:xyz' opt --xyz 2>/dev/null; echo 0$opt) in 0123) USAGE=$' -? -@(#)$Id: regress (AT&T Research) 2012-02-02 $ +@(#)$Id: regress (ksh 93u+m) 2024-02-13 $ -author?Glenn Fowler <gsf@research.att.com> --copyright?Copyright (c) 1995-2012 AT&T Intellectual Property +-copyright?(c) 1995-2012 AT&T Intellectual Property +-copyright?(c) 2020-2024 Contributors to ksh 93u+m -license?https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +NAME?regress - run regression tests +DESCRIPTION?\bregress\b runs the tests in \aunit\a, or @@ -66,9 +67,10 @@ +BODY \b{ ... }?Defines the test body; used for complex tests. +CD \b\adirectory\a?Create and change to working directory for one test. - +CLEANUP \b\astatus\a?Called at exit time to remove the + +CLEANUP?Called at exit time to remove the temporary directory \aunit\a\b.tmp\b, list the tests totals via - \bTALLY\b, and exit with status \astatus\a. + \bTALLY\b, and exit with the number of test failures or 125, + whichever is lower, as the exit status. +COMMAND \b\aarg\a ...?Runs the current command under test with \aarg\a ... appended to the default args. +CONTINUE?The background job must be running. @@ -311,7 +313,6 @@ print -u2 "$msg" GROUP=INIT TESTS=0 - ERRORS=0 ;; esac } @@ -361,7 +362,7 @@ fi TALLY $note $TEST_keep || UNWIND - exit $1 + exit $((ERRORS < 125 ? ERRORS : 125)) } function RUN # op @@ -1088,11 +1089,11 @@ fi continue fi - diff $IGNORESPACE $i $j >$i.diff 2>&1 + diff -u $IGNORESPACE $i $j >$i.diff 2>&1 if -s $i.diff then failed=$failed${failed:+,}${i#$TWD/} if $TEST_verbose - then print -u2 " ===" diff $IGNORESPACE ${i#$TWD/} "<actual >expected ===" + then print -u2 " ===" diff $IGNORESPACE ${i#$TWD/} "('-': actual; '+': expected) ===" cat $i.diff >&2 fi fi @@ -1419,7 +1420,7 @@ then UNIT "${ARGV@}" UNIT_READONLY=1 fi -trap 'code=$?; CLEANUP $code' EXIT +trap 'CLEANUP' EXIT if ! $TEST_select then TEST_select="0123456789*" fi
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/utils
Added
+(directory)
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/utils/Mamfile_indent
Added
@@ -0,0 +1,34 @@ +origIFS=$IFS +IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches +let() { return $((!($1))); } + +# Automatically (re-)indent make...done blocks in a Mamfile. +# Usage: Mamfile_indent <Mamfile >Mamfile.new +# +# Should work on all current POSIX compliant shells. +# By Martijn Dekker <martijn@inlv.org>, 2021, 2024. Public domain. + +# Spacing per indentation level. Edit to change style. +indent=' ' # one tab + +# Remove existing indentation, add new indentation. +indentlvl=0 +sed 's/^:space:*//' \ +| while IFS=$origIFS read -r line +do case $line in + '') printf '\n'; continue ;; + done*) let "indentlvl -= 1" ;; + esac + + spc= + i=0 + while let "(i += 1) <= indentlvl" + do spc=$indent$spc + done + printf '%s\n' $spc$line + + case $line in + make* | loop*) + let "indentlvl += 1" ;; + esac +done
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/INIT/utils/Mamfile_rm_unused_vars
Added
@@ -0,0 +1,32 @@ +IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches +CCn=' +' # newline +let() { return $((!($1))); } + +# Remove unused variable definitions from a Mamfile. +# Usage: Mamfile_rm_unused_vars <Mamfile >Mamfile.new +# +# Should work on all current POSIX compliant shells. +# By Martijn Dekker <martijn@inlv.org>, 2021, 2024. Public domain. +# +# All variables are declared with 'setv' and they are used if an expansion +# of the form ${varname} exists (the braces are mandatory in Mamfiles). + +mamfile=$(let $# && cat "$1" || cat) +vars=$(printf '%s\n' $mamfile | awk '$1 == "setv" { print $2; }') +rm_unused_ere= +IFS=$CCn; for varname in $vars; do IFS= + case $varname in + MAMAKE_STRICT) continue ;; + esac + case $mamfile in + *"\${$varname}"* ) + ;; + * ) # add with '|' separator for Extended Regular Expression + rm_unused_ere="${rm_unused_ere:+$rm_unused_ere|}setv:blank:+$varname(:blank:|$)" ;; + esac +done +case $rm_unused_ere in +'') printf '%s\n' $mamfile ;; +*) printf '%s\n' $mamfile | grep -vE $rm_unused_ere ;; +esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/Mamfile
Changed
@@ -1,15 +1,14 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -make test - make install - make all + +setv MAMAKE_STRICT 3 + +make test virtual + make install virtual + make all virtual exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual -done test virtual + done + done +done
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/builtin/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/builtin/Mamfile
Changed
@@ -1,130 +1,167 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 + setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGE_cmd ${INSTALLROOT} -setv PACKAGEROOT ../../../../.. setv CC cc -setv mam_cc_FLAGS -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCFLAGS setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} setv IFFEFLAGS setv LDFLAGS -make .INIT + +make .INIT dontcare virtual prev ${PACKAGE_ast_INCLUDE}/cmdlist.h - exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h + exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' \ + exec - -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${<} bind -lcmd -done .INIT dontcare virtual -make install + bind -lutil dontcare +done .INIT + +make install virtual + note * + note * AST header dependencies + note * TODO: verify and centralise + note * + + prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_map.h + prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + make ${PACKAGE_ast_INCLUDE}/proc.h implicit + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + make ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/option.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/cmd.h implicit + make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit + prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + make ${PACKAGE_ast_INCLUDE}/stk.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h + done + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + note * + note * Build pty + note * + make pty make pty.o make pty.c make FEATURE/pty implicit prev features/pty - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty - done FEATURE/pty generated - prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit - make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/bytesex.h - done ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_common.h - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - done ${PACKAGE_ast_INCLUDE}/wchar.h - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h - done ${PACKAGE_ast_INCLUDE}/wctype.h - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h - done ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/ast_map.h - prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_sys.h - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/vmalloc.h + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" \ + exec - ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} \ + exec - -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run ${<} + done + prev ${PACKAGE_ast_INCLUDE}/ast_time.h + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h prev ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/proc.h implicit - make ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/proc.h - make ${PACKAGE_ast_INCLUDE}/error.h implicit - make ${PACKAGE_ast_INCLUDE}/option.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/option.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/error.h - make ${PACKAGE_ast_INCLUDE}/cmd.h implicit - prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit dontcare - make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit - prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit - done ${PACKAGE_ast_INCLUDE}/cmdext.h - prev ${PACKAGE_ast_INCLUDE}/shcmd.h - make ${PACKAGE_ast_INCLUDE}/stk.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - done ${PACKAGE_ast_INCLUDE}/stk.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/cmd.h + prev ${PACKAGE_ast_INCLUDE}/proc.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/cmd.h done pty.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -DCMD_STANDALONE=b_pty -c pty.c - done pty.o generated - bind -lutil dontcare - exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} -lm ${mam_libcmd} - done pty generated + exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} \ + exec - -DERROR_CATALOG=\""builtin"\" -DCMD_STANDALONE=b_pty -c ${<} + done pty.o + exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS} ${mam_cc_L+-L.} \ + exec - ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd} + done pty + + note * + note * Dynamically linked version, if supported + note * + + make ${INSTALLROOT}/dyn/bin/pty dontcare + prev pty + prev ${INSTALLROOT}/lib/lib/cmd + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED}' + exec - dylink -e pty ${mam_libutil} $(cat ${INSTALLROOT}/lib/lib/cmd) pty.o + done + + note * + note * Pre-install + note * + make ${INSTALLROOT}/bin - exec - mkdir -p ${INSTALLROOT}/bin - done ${INSTALLROOT}/bin generated + exec - mkdir -p ${@} + done make ${INSTALLROOT}/bin/pty prev pty - exec - ${STDCMP} 2>/dev/null -s pty ${INSTALLROOT}/bin/pty || { ${STDMV} ${INSTALLROOT}/bin/pty ${INSTALLROOT}/bin/pty.old 2>/dev/null || true; ${STDCP} pty ${INSTALLROOT}/bin/pty ;} - done ${INSTALLROOT}/bin/pty generated -done install virtual -make test -done test dontcare virtual + note * macOS throws code signature error if 'cp' overwrites Mach-O binary; must remove first + exec - rm -f ${@} && cp ${<} ${@} + done +done install + +make test dontcare virtual +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/builtin/features/pty -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/builtin/features/pty
Changed
@@ -11,8 +11,7 @@ lib grantpt,unlockpt,posix_openpt stdlib.h lib cfmakeraw termios.h -# try once with -lm, once without -tst - -lm - - output{ +tst output{ #include <fcntl.h> #if _lib_ptsname #include <stdlib.h> @@ -51,11 +50,8 @@ return 0; } }end fail{ - case ${_features_pty_TRIEDONCE-no} in - no) _features_pty_TRIEDONCE=yes ;; - *) echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2 - exit 1 ;; - esac + echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2 + exit 1 }end extern _getpty char* (int*, int, mode_t, int)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/builtin/pty.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/builtin/pty.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -407,12 +407,12 @@ } for (i = t = 0; i < n; i++) { - if (!(sfvalue(spsi) & SF_READ)) + if (!(sfvalue(spsi) & SFIO_READ)) /*skip*/; else if (spsi == mp) { t++; - if (!(s = (char*)sfreserve(mp, SF_UNBOUND, -1))) + if (!(s = (char*)sfreserve(mp, SFIO_UNBOUND, -1))) { sfclose(mp); mp = 0; @@ -587,7 +587,7 @@ } goto done; } - if ((n = sfpoll(&mp, 1, timeout)) <= 0 || !((int)sfvalue(mp) & SF_READ)) + if ((n = sfpoll(&mp, 1, timeout)) <= 0 || !((int)sfvalue(mp) & SFIO_READ)) { if (n < 0) { @@ -623,7 +623,7 @@ } return NULL; } - if (!(s = sfreserve(mp, SF_UNBOUND, -1))) + if (!(s = sfreserve(mp, SFIO_UNBOUND, -1))) { if (!prompt) { @@ -652,7 +652,7 @@ error(-2, "b \"%s\"", fmtnesq(s, "\"", n)); if ((bp->max - bp->end) < n) { - a = roundof(bp->max - bp->buf + n, SF_BUFSIZE); + a = roundof(bp->max - bp->buf + n, SFIO_BUFSIZE); r = bp->buf; if (!(bp->buf = vmnewof(bp->vm, bp->buf, char, a, 0))) outofmemory(); @@ -790,11 +790,11 @@ if (!(vm = vmopen(Vmdcheap, Vmbest, 0)) || !(cond = vmnewof(vm, 0, Cond_t, 1, 0)) || !(master = vmnewof(vm, 0, Master_t, 1, 0)) || - !(master->buf = vmnewof(vm, 0, char, 2 * SF_BUFSIZE, 0))) + !(master->buf = vmnewof(vm, 0, char, 2 * SFIO_BUFSIZE, 0))) outofmemory(); master->vm = vm; master->cur = master->end = master->buf; - master->max = master->buf + 2 * SF_BUFSIZE - 1; + master->max = master->buf + 2 * SFIO_BUFSIZE - 1; master->restore = -1; errno = 0; id = error_info.id; @@ -1077,7 +1077,7 @@ error(ERROR_system(1), "unable to create pty"); UNREACHABLE(); } - if (!(mp = sfnew(NULL, 0, SF_UNBOUND, master, SF_READ|SF_WRITE))) + if (!(mp = sfnew(NULL, 0, SFIO_UNBOUND, master, SFIO_READ|SFIO_WRITE))) { error(ERROR_system(1), "cannot open master stream"); UNREACHABLE();
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/COMPATIBILITY -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/COMPATIBILITY
Changed
@@ -1,4 +1,4 @@ - ksh 93u+m/1.0.5 vs. ksh 93u+ + ksh 93u+m/1.0.9 vs. ksh 93u+ The following is a list of changes between ksh 93u+ 2012-08-01 and the new ksh 93u+m reboot that could cause incompatibilities in rare corner cases. @@ -180,17 +180,31 @@ 33. The -e option of test// no longer returns true for pseudodevices that are only supported by the shell and do not in fact exist in the file system, such as /dev/tcp/*. + (Post-1.0 fix introduced in ksh 93u+m/1.0.4) 34. Single and double quotes now work like backslashes to quote '!', '^' and '-' in bracket expressions in shell glob patterns, e.g., the glob pattern "!a-z" now matches !, a, - or z and is no longer misparsed as !a-z. This restores compatibility with ksh88 and non-ksh shells. + (Post-1.0 fix introduced in ksh 93u+m/1.0.4) 35. In the ${parameter/pattern/string} search-and-replace expansion, an anchored empty pattern will now match the beginning or the end of the string, so that ${parameter/#/string} will prefix the string to the parameter value and ${parameter/%/string} will append it. Previously, these operations were no-ops (equivalent to ${parameter}). + (Post-1.0 fix introduced in ksh 93u+m/1.0.5) + +36. An assignment within an arithmetic expression no longer triggers both + of the variable's 'set' and 'get' discipline functions (if set). Only + the 'set' discipline is now triggered, as it was always documented. + (Post-1.0 fix introduced in ksh 93u+m/1.0.9) + +37. Non-base-10 signed negative integer values are now output as negative + numbers and no longer incorrectly treated as unsigned long integers + regardless of their type length. For example, 'typeset -i16 n=-12; + echo $n' now correctly prints -16#c instead of 16#fffffffffffffff4. + (Post-1.0 fix introduced in ksh 93u+m/1.0.9) ____________________________________________________________________________
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/DESIGN -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/DESIGN
Changed
@@ -31,17 +31,17 @@ The directory tests contains a number of regression tests. In most cases, when a bug gets fixed, a test is added to - one of these files. The regression tests can be run by - going to this directory and running - SHELL=shell_path shell_path shtests - where shell_path is an absolute pathname for the shell to - be tested. + one of these files. The ksh regression tests can be run by + invoking the shtests script in the top-level bin directory; + see 'bin/shtests --man' for documentation about the options. + They are also run with default options via 'bin/package tests' + as part of a complete test suite run that also includes tests + for the build system itself. - The top level directory contains the nmake Makefile, the - RELEASE file, the ksh93 man file (sh.1) and nval.3 and shell.3 - documentation files. The RELEASE file contains the list of bug - fixes and new features since the original ksh93 release. The file - COMPATIBILITY is a list of all known incompatibilities with ksh88. + The top level directory contains the mamake Mamfile, the ksh93 + manual page (sh.1) and the nval.3 and shell.3 documentation files. + The file COMPATIBILITY is a list of all known incompatibilities + with previous AT&T releases. Include directory: 1. argnod.h contains the type definitions for command
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/Mamfile
Changed
@@ -1,1333 +1,1310 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} setv CC cc -setv mam_cc_FLAGS -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCFLAGS setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -setv COTEMP $$ setv IFFEFLAGS setv LDFLAGS setv SH_DICT \"libshell\" -make install - make ksh - bind -ldll - bind -lcmd - bind -last - bind -lm dontcare - bind -lnsl dontcare - make shell.req - prev ${INSTALLROOT}/bin/mkreq - exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} : ${LDFLAGS} : shell dll cmd ast m jobs i socket nsl secdb network - done shell.req generated - make shopt.h implicit - make FEATURE/options implicit - prev features/options - prev shell.req - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options - done FEATURE/options generated - prev SHOPT.sh - prev Mamfile - note * the SHOPT.sh file calls the SHOPT function once for each option - exec - set +v +x - exec - - exec - writedef() - exec - { - exec - echo "${3:-#ifndef SHOPT_$1}" - exec - echo "# define SHOPT_$1 $2" - exec - echo "#endif" - exec - echo - exec - } - exec - - exec - SHOPT() - exec - { - exec - n=${1%%=*} # name - exec - v=${1#*=} # value - exec - # probe certain options if they don't have a value configured - exec - case $1 in - exec - 'MULTIBYTE=') - exec - # by default, SHOPT_MULTIBYTE is the opposite of AST_NOMULTIBYE - exec - writedef MULTIBYTE 1 '#if !defined(SHOPT_MULTIBYTE) && !AST_NOMULTIBYTE' ;; - exec - 'DEVFD=') - exec - # if /dev/fd/n exposes file descriptor n, make SHOPT_DEVFD use this for - exec - # process substitutions instead of FIFOs, which are not as secure - exec - # WARNING: do not use 'test -e' for this test (too many shells break it - exec - # by failing to test for the physical existence of /dev/fd/9 in the FS) - exec - ls -d /dev/fd/9 9<&0 >/dev/null 2>&1 && writedef DEVFD 1 ;; - exec - 'TEST_L=') - exec - # if external 'test' supports lowercase -l as equivalent to -L, enable - exec - # SHOPT_TEST_L so ksh supports it for compatibility with local scripts - exec - ${STDLN} -s /dev/null "$EXECROOT/link$$" - exec - if env test -l "$EXECROOT/link$$" && env test ! -l . - exec - then writedef TEST_L 1 - exec - fi 2>/dev/null - exec - ${STDRM} -f "$EXECROOT/link$$" ;; - exec - 'SYSRC=') - exec - # if one of these exists, make SHOPT_SYSRC load /etc/ksh.kshrc by default - exec - if test -f /etc/ksh.kshrc || test -f /etc/bash.bashrc - exec - then writedef SYSRC 1 - exec - fi ;; - exec - # some other SHOPTs may be probed for using feature tests in features/options - exec - *=?*) - exec - writedef "$n" "$v" ;; - exec - esac - exec - echo "* SHOPT_$n = ${v:-(probe)}" >&2 # show in make.out - exec - } - exec - - exec - exec >shopt.h - exec - echo '/* Generated from ksh93/SHOPT.sh by ksh93/Mamfile */' - exec - echo - exec - echo '#include "FEATURE/options"' - exec - echo - exec - . "$PACKAGEROOT/src/cmd/ksh93/SHOPT.sh" - exec - ${STDCAT} <<-EOF - exec - /* overrides */ - exec - #if SHOPT_SCRIPTONLY - exec - # undef SHOPT_ACCT - exec - # undef SHOPT_AUDIT - exec - # undef SHOPT_ESH - exec - # undef SHOPT_HISTEXPAND - exec - # undef SHOPT_SYSRC - exec - # undef SHOPT_VSH - exec - #endif - exec - EOF - done shopt.h generated - make pmain.o - make sh/pmain.c - make FEATURE/externs implicit - prev features/externs - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs - done FEATURE/externs generated - make include/shell.h implicit - make include/fault.h implicit - make FEATURE/sigfeatures implicit - prev features/sigfeatures - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures - done FEATURE/sigfeatures generated - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/bytesex.h - done ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_common.h - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - done ${PACKAGE_ast_INCLUDE}/wchar.h - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h - done ${PACKAGE_ast_INCLUDE}/wctype.h - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h - done ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/ast_map.h - prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_sys.h - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/sfio.h - make ${PACKAGE_ast_INCLUDE}/error.h implicit - make ${PACKAGE_ast_INCLUDE}/option.h implicit - make ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h - make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/vmalloc.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/option.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sig.h implicit - done include/fault.h - make ${PACKAGE_ast_INCLUDE}/stk.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - done ${PACKAGE_ast_INCLUDE}/stk.h - make include/history.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/history.h - make ${PACKAGE_ast_INCLUDE}/cmd.h implicit - prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit - make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit - prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit - done ${PACKAGE_ast_INCLUDE}/cmdext.h - prev ${PACKAGE_ast_INCLUDE}/shcmd.h - prev ${PACKAGE_ast_INCLUDE}/stk.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/cmd.h - prev ${PACKAGE_ast_INCLUDE}/shcmd.h - make include/nval.h implicit - prev ${PACKAGE_ast_INCLUDE}/option.h - make ${PACKAGE_ast_INCLUDE}/cdt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/cdt.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/nval.h - make include/name.h implicit - prev include/nval.h - prev ${PACKAGE_ast_INCLUDE}/cdt.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/name.h - prev ${PACKAGE_ast_INCLUDE}/cdt.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/shell.h - prev shopt.h - done sh/pmain.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/pmain.c - done pmain.o generated - make libshell.a archive - prev shell.req - make cd_pwd.o - make bltins/cd_pwd.c - make include/test.h implicit - prev include/shtable.h implicit - make include/defs.h implicit - prev include/regress.h implicit dontcare - prev include/shtable.h - prev include/shell.h +setv DYLIB_VERSION 2.0 + +make install virtual + note * + note * AST header dependencies + note * TODO: verify and centralise + note * + + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit prev ${PACKAGE_ast_INCLUDE}/endian.h - prev include/name.h - prev include/argnod.h implicit - prev ${PACKAGE_ast_INCLUDE}/cdt.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/defs.h - done include/test.h - make ${PACKAGE_ast_INCLUDE}/ls.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit dontcare - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ls.h - make include/builtins.h implicit - prev include/shtable.h - make FEATURE/dynamic implicit - prev features/dynamic - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic - prev ${PACKAGE_ast_INCLUDE}/dlldefs.h - done FEATURE/dynamic generated - prev ${PACKAGE_ast_INCLUDE}/option.h - done include/builtins.h - prev include/name.h - make include/path.h implicit - make FEATURE/acct implicit - prev Mamfile - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct - done FEATURE/acct generated - prev include/defs.h - prev include/nval.h - done include/path.h - make include/variables.h implicit - prev FEATURE/dynamic - prev ${PACKAGE_ast_INCLUDE}/option.h - prev include/nval.h - done include/variables.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/cd_pwd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/cd_pwd.c - done cd_pwd.o generated - make cflow.o - make bltins/cflow.c - prev include/builtins.h - make include/shnodes.h implicit - prev include/argnod.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/shnodes.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev include/defs.h - prev shopt.h - done bltins/cflow.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/cflow.c - done cflow.o generated - make enum.o - make bltins/enum.c - prev include/defs.h - prev shopt.h - done bltins/enum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=${SH_DICT} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/enum.c - done enum.o generated - make getopts.o - make bltins/getopts.c - prev include/builtins.h - prev include/nval.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/variables.h - prev include/defs.h - prev shopt.h - done bltins/getopts.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/getopts.c - done getopts.o generated - make hist.o - make bltins/hist.c - make include/edit.h implicit - prev include/national.h implicit - make include/terminal.h implicit - make FEATURE/ttys implicit - prev features/ttys - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys - done FEATURE/ttys generated - done include/terminal.h - prev ${PACKAGE_ast_INCLUDE}/sig.h - make FEATURE/locale implicit - prev features/locale - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale - done FEATURE/locale generated - make FEATURE/cmds implicit - prev features/cmds - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds - done FEATURE/cmds generated - done include/edit.h - prev include/builtins.h - prev include/history.h - prev include/name.h - make include/io.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/io.h - prev include/variables.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev include/defs.h - prev shopt.h - done bltins/hist.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/hist.c - done hist.o generated - make misc.o - make bltins/misc.c - prev ${PACKAGE_ast_INCLUDE}/times.h - make FEATURE/time implicit - prev features/time - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time - make ${PACKAGE_ast_INCLUDE}/times.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit dontcare - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/times.h dontcare - done FEATURE/time generated - prev FEATURE/locale - make include/jobs.h implicit - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - prev include/terminal.h - make ${PACKAGE_ast_INCLUDE}/aso.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/aso.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/jobs.h - prev include/builtins.h - prev include/history.h - prev include/name.h - prev include/io.h - prev include/path.h - prev include/shnodes.h - prev include/variables.h - prev include/defs.h - prev shopt.h - done bltins/misc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c - done misc.o generated - make mkservice.o - make bltins/mkservice.c - prev ${PACKAGE_ast_INCLUDE}/cmd.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/nval.h - prev include/defs.h - prev shopt.h - done bltins/mkservice.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=${SH_DICT} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/mkservice.c - done mkservice.o generated - make print.o - make bltins/print.c - make ${PACKAGE_ast_INCLUDE}/ccode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ccode.h - make ${PACKAGE_ast_INCLUDE}/tmx.h implicit - make ${PACKAGE_ast_INCLUDE}/tv.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/tv.h - make ${PACKAGE_ast_INCLUDE}/tm.h implicit - prev ${PACKAGE_ast_INCLUDE}/times.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/tm.h - done ${PACKAGE_ast_INCLUDE}/tmx.h - make include/streval.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_float.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_float.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done include/streval.h - prev include/builtins.h - prev include/history.h - prev include/name.h - prev include/io.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/print.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/print.c - done print.o generated - make read.o - make bltins/read.c - prev include/edit.h - prev include/terminal.h - prev include/history.h - prev include/builtins.h - prev include/name.h - prev include/io.h - make include/lexstates.h implicit - prev ${PACKAGE_ast_INCLUDE}/wctype.h - prev ${PACKAGE_ast_INCLUDE}/wchar.h - prev FEATURE/locale - done include/lexstates.h - prev include/variables.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done bltins/read.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c - done read.o generated - make sleep.o - make bltins/sleep.c - make FEATURE/poll implicit - prev features/poll - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll - done FEATURE/poll generated - prev FEATURE/time - prev include/builtins.h - prev ${PACKAGE_ast_INCLUDE}/tmx.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/sleep.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/sleep.c - done sleep.o generated - make trap.o - make bltins/trap.c - prev include/builtins.h - prev include/jobs.h - prev include/defs.h - prev shopt.h - done bltins/trap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/trap.c - done trap.o generated - make test.o - make bltins/test.c - prev ${PACKAGE_ast_INCLUDE}/tmx.h - prev FEATURE/poll - prev FEATURE/externs - prev include/builtins.h - prev include/test.h - prev include/terminal.h - prev include/io.h - prev ${PACKAGE_ast_INCLUDE}/regex.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/test.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/test.c - done test.o generated - make typeset.o - make bltins/typeset.c - prev FEATURE/dynamic - prev include/variables.h - prev include/builtins.h - prev include/history.h - prev include/name.h - prev include/path.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/typeset.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c - done typeset.o generated - make ulimit.o - make bltins/ulimit.c - make include/ulimit.h implicit - make FEATURE/rlimits implicit - prev features/rlimits - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits - done FEATURE/rlimits generated - prev FEATURE/time - done include/ulimit.h - prev include/name.h - prev include/builtins.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done bltins/ulimit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/ulimit.c - done ulimit.o generated - make umask.o - make bltins/umask.c - prev include/builtins.h - prev include/shell.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done bltins/umask.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/umask.c - done umask.o generated - make whence.o - make bltins/whence.c - prev include/builtins.h - make include/shlex.h implicit - prev include/lexstates.h - prev include/shtable.h - prev include/shnodes.h - prev ${PACKAGE_ast_INCLUDE}/cdt.h - done include/shlex.h - prev include/path.h - prev include/name.h - prev include/shtable.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/whence.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/whence.c - done whence.o generated - make main.o - make sh/main.c - prev execargs.h implicit dontcare virtual - prev nc.h implicit dontcare virtual - prev FEATURE/externs - make FEATURE/execargs implicit - prev Mamfile - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs - done FEATURE/execargs generated - make FEATURE/pstat implicit - prev Mamfile - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat - done FEATURE/pstat generated - make FEATURE/setproctitle implicit - prev Mamfile - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def setproctitle - done FEATURE/setproctitle generated - prev FEATURE/time - prev include/timeout.h implicit - prev include/history.h - prev include/shnodes.h - prev include/shlex.h - prev include/jobs.h - prev include/io.h - prev include/path.h - prev include/variables.h - prev include/defs.h - make include/fcin.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - done include/fcin.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done sh/main.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} -DSH_DICT=${SH_DICT} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/main.c - done main.o generated - make nvdisc.o - make sh/nvdisc.c - prev include/shlex.h - prev include/io.h - prev include/path.h - prev include/builtins.h - prev include/variables.h - prev include/defs.h - prev shopt.h - done sh/nvdisc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/nvdisc.c - done nvdisc.o generated - make nvtype.o - make sh/nvtype.c - prev include/builtins.h - prev include/variables.h - prev include/io.h - prev include/defs.h - prev shopt.h - done sh/nvtype.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/nvtype.c - done nvtype.o generated - make arith.o - make sh/arith.c - prev include/builtins.h - prev include/variables.h - prev include/streval.h - prev include/name.h - prev include/lexstates.h - prev include/defs.h - prev shopt.h - done sh/arith.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/arith.c - done arith.o generated - make args.o - make sh/args.c - prev include/io.h - prev include/shlex.h - prev FEATURE/poll - prev include/edit.h - prev include/terminal.h - prev include/builtins.h - prev include/jobs.h - prev include/path.h - prev include/defs.h - prev shopt.h - done sh/args.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/args.c - done args.o generated - make array.o - make sh/array.c - prev include/name.h - prev include/defs.h - prev shopt.h - done sh/array.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/array.c - done array.o generated - make completion.o - make edit/completion.c - prev include/history.h - prev include/edit.h - prev include/io.h - prev include/path.h - prev include/lexstates.h - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev include/defs.h - prev shopt.h - done edit/completion.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/completion.c - done completion.o generated - make defs.o - make sh/defs.c - prev include/timeout.h - prev include/edit.h - prev include/shlex.h - prev include/jobs.h - prev include/defs.h - prev shopt.h - done sh/defs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/defs.c - done defs.o generated - make edit.o - make edit/edit.c - prev include/shlex.h - prev include/edit.h - prev include/history.h - prev include/terminal.h - prev include/io.h - prev include/variables.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev FEATURE/time - prev include/fault.h - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done edit/edit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/edit.c - done edit.o generated - make expand.o - make sh/expand.c - prev include/path.h - prev include/io.h - make ${PACKAGE_ast_INCLUDE}/ast_dir.h implicit - make ${PACKAGE_ast_INCLUDE}/dirent.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_dirent.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_dirent.h - done ${PACKAGE_ast_INCLUDE}/dirent.h - prev dirlib.h implicit dontcare virtual - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h - done ${PACKAGE_ast_INCLUDE}/ast_dir.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/glob.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev include/test.h - prev include/variables.h - prev include/defs.h - prev shopt.h - done sh/expand.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/expand.c - done expand.o generated - make regress.o - make bltins/regress.c - prev ${PACKAGE_ast_INCLUDE}/tmx.h - prev include/builtins.h - prev include/io.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/defs.h - prev shopt.h - done bltins/regress.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/regress.c - done regress.o generated - make fault.o - make sh/fault.c - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - prev include/ulimit.h - prev include/builtins.h - prev include/path.h - prev include/jobs.h - prev include/variables.h - prev include/shlex.h - prev include/history.h - prev include/io.h - prev include/fcin.h - prev include/defs.h - prev shopt.h - done sh/fault.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/fault.c - done fault.o generated - make fcin.o - make sh/fcin.c - prev include/fcin.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done sh/fcin.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/fcin.c - done fcin.o generated - make history.o - make edit/history.c - prev ${PACKAGE_ast_INCLUDE}/stdio.h - prev include/history.h - prev include/io.h - prev include/builtins.h - prev include/path.h - prev include/variables.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev FEATURE/time - prev ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done edit/history.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/history.c - done history.o generated - make init.o - make sh/init.c - prev ${PACKAGE_ast_INCLUDE}/wctype.h - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - make include/version.h implicit - prev ${PACKAGE_ast_INCLUDE}/releaseflags.h implicit - done include/version.h - prev include/lexstates.h - prev FEATURE/externs - prev FEATURE/dynamic - prev FEATURE/time - prev include/builtins.h - prev include/shlex.h - prev include/io.h - prev include/jobs.h - prev include/edit.h - prev include/name.h - prev include/fault.h - prev include/path.h - prev include/variables.h - prev ${PACKAGE_ast_INCLUDE}/regex.h - prev ${PACKAGE_ast_INCLUDE}/tmx.h - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev include/defs.h - prev shopt.h - done sh/init.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/init.c - done init.o generated - make io.o - make sh/io.c - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev FEATURE/poll - prev FEATURE/dynamic - prev FEATURE/externs - prev include/timeout.h - prev include/edit.h - prev include/history.h - prev include/shnodes.h - prev include/shlex.h - prev include/jobs.h - prev include/io.h - prev include/path.h - prev include/variables.h - prev ${PACKAGE_ast_INCLUDE}/regex.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev include/fcin.h - prev include/defs.h - prev shopt.h - done sh/io.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/io.c - done io.o generated - make jobs.o - make sh/jobs.c - prev include/history.h - prev include/jobs.h - prev include/io.h - make ${PACKAGE_ast_INCLUDE}/wait.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/wait.h - prev include/defs.h - prev shopt.h - done sh/jobs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/jobs.c - done jobs.o generated - make lex.o - make sh/lex.c - prev include/shlex.h - prev include/io.h - prev include/lexstates.h - prev include/test.h - prev include/argnod.h - prev include/shell.h - prev include/defs.h - prev include/nval.h - prev include/fcin.h - prev ${PACKAGE_ast_INCLUDE}/releaseflags.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done sh/lex.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/lex.c - done lex.o generated - make macro.o - make sh/macro.c - prev include/streval.h - prev include/national.h - prev include/path.h - prev include/shnodes.h - prev include/jobs.h - prev include/io.h - prev include/shlex.h - prev include/variables.h - prev include/name.h - prev ${PACKAGE_ast_INCLUDE}/regex.h - prev include/fcin.h - prev include/defs.h - prev shopt.h - done sh/macro.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/macro.c - done macro.o generated - make name.o - make sh/name.c - prev include/builtins.h - prev include/shnodes.h - prev include/streval.h - prev FEATURE/externs - prev include/timeout.h - prev include/lexstates.h - prev include/path.h - prev include/variables.h - prev include/defs.h - prev shopt.h - done sh/name.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/name.c - done name.o generated - make nvtree.o - make sh/nvtree.c - prev include/lexstates.h - prev include/argnod.h - prev include/name.h - prev include/defs.h - prev shopt.h - done sh/nvtree.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/nvtree.c - done nvtree.o generated - make parse.o - make sh/parse.c - prev include/path.h - prev include/test.h - prev include/builtins.h - prev include/history.h - prev include/shlex.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/fcin.h - prev include/shell.h - prev include/defs.h - prev include/version.h - prev shopt.h - done sh/parse.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/parse.c - done parse.o generated - make path.o - make sh/path.c - prev FEATURE/time - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev exec_attr.h implicit dontcare virtual - prev FEATURE/dynamic - prev include/test.h - prev include/history.h - prev include/jobs.h - prev include/io.h - prev include/path.h - prev include/variables.h - prev include/nval.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev include/fcin.h - prev include/defs.h - prev shopt.h - done sh/path.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/path.c - done path.o generated - make string.o - make sh/string.c - prev ${PACKAGE_ast_INCLUDE}/wctype.h - prev include/national.h - prev include/lexstates.h - prev include/shtable.h - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done sh/string.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/string.c - done string.o generated - make streval.o - make sh/streval.c - prev FEATURE/externs - prev ${PACKAGE_ast_INCLUDE}/error.h - prev include/streval.h - prev shopt.h - done sh/streval.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/streval.c - done streval.o generated - make subshell.o - make sh/subshell.c - prev include/path.h - prev include/variables.h - prev include/jobs.h - prev include/shlex.h - prev include/shnodes.h - prev include/fault.h - prev include/io.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev include/defs.h - prev shopt.h - done sh/subshell.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/subshell.c - done subshell.o generated - make tdump.o - make sh/tdump.c - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev include/io.h - prev include/path.h - prev include/shnodes.h - prev include/defs.h - prev shopt.h - done sh/tdump.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/tdump.c - done tdump.o generated - make timers.o - make sh/timers.c - prev FEATURE/time - prev FEATURE/sigfeatures - prev include/defs.h - prev include/fault.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/sig.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done sh/timers.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/timers.c - done timers.o generated - make trestore.o - make sh/trestore.c - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev include/io.h - prev include/path.h - prev include/shnodes.h - prev include/defs.h - prev shopt.h - done sh/trestore.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/trestore.c - done trestore.o generated - make waitevent.o - make sh/waitevent.c - prev include/defs.h - prev shopt.h - done sh/waitevent.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/waitevent.c - done waitevent.o generated - make xec.o - make sh/xec.c - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - prev include/streval.h - prev FEATURE/locale - prev FEATURE/externs - prev FEATURE/time - prev include/builtins.h - prev include/test.h - prev include/jobs.h - prev include/shnodes.h - prev include/io.h - prev include/name.h - prev include/path.h - prev include/variables.h - prev include/fcin.h - prev include/defs.h - prev shopt.h - done sh/xec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/xec.c - done xec.o generated - make limits.o - make data/limits.c - prev include/ulimit.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done data/limits.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -c data/limits.c - done limits.o generated - make msg.o - make data/msg.c - prev include/edit.h - prev include/jobs.h - prev include/builtins.h - prev include/history.h - prev include/timeout.h - prev include/shlex.h - prev include/io.h - prev include/path.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done data/msg.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/msg.c - done msg.o generated - make strdata.o - make data/strdata.c - make FEATURE/math implicit - make features/math.sh - prev data/math.tab implicit - done features/math.sh - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} -lm : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab - prev ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit - make ${INSTALLROOT}/src/lib/libast/FEATURE/float implicit - prev ${INSTALLROOT}/src/lib/libast/FEATURE/standards implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${INSTALLROOT}/src/lib/libast/FEATURE/float - done FEATURE/math generated - prev include/streval.h - prev ${PACKAGE_ast_INCLUDE}/ast_standards.h - prev shopt.h - done data/strdata.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/strdata.c - done strdata.o generated - make testops.o - make data/testops.c - prev include/test.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done data/testops.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/testops.c - done testops.o generated - make keywords.o - make data/keywords.c - prev include/shlex.h - prev include/shell.h - prev shopt.h - done data/keywords.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/keywords.c - done keywords.o generated - make options.o - make data/options.c - prev include/shtable.h - prev include/name.h - prev include/defs.h - prev shopt.h - done data/options.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/options.c - done options.o generated - make signals.o - make data/signals.c - prev include/jobs.h - prev include/defs.h - prev shopt.h - done data/signals.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/signals.c - done signals.o generated - make aliases.o - make data/aliases.c - prev FEATURE/dynamic - prev include/defs.h - prev shopt.h - done data/aliases.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/aliases.c - done aliases.o generated - make builtins.o - make data/builtins.c - prev FEATURE/poll - prev FEATURE/cmds - prev include/jobs.h - prev include/builtins.h - prev include/version.h - prev include/name.h - prev include/ulimit.h - prev include/shtable.h - prev include/defs.h - prev shopt.h - done data/builtins.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/builtins.c - done builtins.o generated - make variables.o - make data/variables.c - prev include/builtins.h - prev include/variables.h - prev include/defs.h - prev include/name.h - prev include/shtable.h - prev include/shell.h - prev FEATURE/dynamic - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done data/variables.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/variables.c - done variables.o generated - make lexstates.o - make data/lexstates.c - prev include/lexstates.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done data/lexstates.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -c data/lexstates.c - done lexstates.o generated - make emacs.o - make edit/emacs.c - prev include/terminal.h - prev include/edit.h - prev include/history.h - prev include/io.h - prev include/defs.h - prev ${PACKAGE_ast_INCLUDE}/releaseflags.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev shopt.h - done edit/emacs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/emacs.c - done emacs.o generated - make vi.o - make edit/vi.c - prev include/lexstates.h - prev FEATURE/time - prev include/terminal.h - prev include/edit.h - prev include/history.h - prev include/io.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - prev include/defs.h - prev shopt.h - done edit/vi.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/vi.c - done vi.o generated - make hexpand.o - make edit/hexpand.c - prev include/edit.h - prev include/defs.h - prev shopt.h - done edit/hexpand.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/hexpand.c - done hexpand.o generated - exec - ${AR} rc libshell.a cd_pwd.o cflow.o enum.o getopts.o hist.o misc.o mkservice.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o - exec - ${AR} rc libshell.a history.o init.o io.o jobs.o lex.o macro.o name.o nvtree.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o waitevent.o xec.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o aliases.o builtins.o variables.o lexstates.o emacs.o vi.o hexpand.o - exec - (ranlib libshell.a) >/dev/null 2>&1 || true - done libshell.a generated + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_map.h + prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + make ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/option.h implicit + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/stk.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h + done + make ${PACKAGE_ast_INCLUDE}/cmd.h implicit + prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit + make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit + prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + prev ${PACKAGE_ast_INCLUDE}/stk.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/times.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/aso.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/tmx.h implicit + make ${PACKAGE_ast_INCLUDE}/tv.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/tm.h implicit + prev ${PACKAGE_ast_INCLUDE}/times.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + done + make ${PACKAGE_ast_INCLUDE}/ast_float.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/ast_dir.h implicit + make ${PACKAGE_ast_INCLUDE}/dirent.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_dirent.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h + done + make ${PACKAGE_ast_INCLUDE}/wait.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit + prev ${PACKAGE_ast_INCLUDE}/sig.h implicit + prev ${PACKAGE_ast_INCLUDE}/glob.h implicit + prev ${PACKAGE_ast_INCLUDE}/releaseflags.h implicit + make ${PACKAGE_ast_INCLUDE}/lc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_tty.h implicit + + note * + note * Library dependencies + note * + + bind -ldll + bind -lcmd + bind -last + bind -lm dontcare + bind -lnsl dontcare + + make shell.req + prev ${INSTALLROOT}/bin/mkreq + exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} : ${LDFLAGS} : \ + exec - shell dll cmd ast m jobs i socket nsl secdb network + done + + note * + note * Feature tests + note * + + setv iffe_run iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS}' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run + + make features/time + prev ${PACKAGE_ast_INCLUDE}/times.h + done + + make features/dynamic + prev ${PACKAGE_ast_INCLUDE}/dlldefs.h + done + + loop F options externs sigfeatures time dynamic locale cmds poll rlimits + make FEATURE/${F} implicit + prev features/${F} + exec - ${iffe_run} ${<} + done + done + + make FEATURE/math implicit + make features/math.sh + prev ${PACKAGE_ast_INCLUDE}/ast_float.h + prev data/math.tab implicit + done + exec - ${iffe_run} ${<} data/math.tab + done + + note * + note * Generate a shopt.h compile-time options header from SHOPT.sh and probe results. + note * + + make shopt.h notrace implicit + prev FEATURE/options + prev SHOPT.sh + prev Mamfile + note * + note * the SHOPT.sh file calls the SHOPT function once for each option + note * + exec - writedef() + exec - { + exec - echo "${3:-#ifndef SHOPT_$1}" + exec - echo "# define SHOPT_$1 $2" + exec - echo "#endif" + exec - echo + exec - } + exec - + exec - SHOPT() + exec - { + exec - n=${1%%=*} # name + exec - v=${1#*=} # value + exec - # probe certain options if they don't have a value configured + exec - case $1 in + exec - 'MULTIBYTE=') + exec - # by default, SHOPT_MULTIBYTE is the opposite of AST_NOMULTIBYE + exec - writedef MULTIBYTE 1 '#if !defined(SHOPT_MULTIBYTE) && !AST_NOMULTIBYTE' ;; + exec - 'DEVFD=') + exec - # if /dev/fd/n exposes file descriptor n, make SHOPT_DEVFD use this for + exec - # process substitutions instead of FIFOs, which are not as secure + exec - # WARNING: do not use 'test -e' for this test (too many shells break it + exec - # by failing to test for the physical existence of /dev/fd/9 in the FS) + exec - ls -d /dev/fd/9 9<&0 >/dev/null 2>&1 && writedef DEVFD 1 ;; + exec - 'TEST_L=') + exec - # if external 'test' supports lowercase -l as equivalent to -L, enable + exec - # SHOPT_TEST_L so ksh supports it for compatibility with local scripts + exec - ln -s /dev/null "$EXECROOT/link$$" + exec - if env test -l "$EXECROOT/link$$" && env test ! -l . + exec - then writedef TEST_L 1 + exec - fi 2>/dev/null + exec - rm -f "$EXECROOT/link$$" ;; + exec - 'PRINTF_LEGACY=') + exec - # if external 'printf' allows POSIX-ignorant syntax (i.e., a format operand + exec - # starting with '-' without prior '--'), enable code for backward compat + exec - case $(env printf '-zut%s\n' alors 2>/dev/null) in + exec - -zutalors) + exec - writedef PRINTF_LEGACY 1 ;; + exec - esac ;; + exec - 'SYSRC=') + exec - # if one of these exists, make SHOPT_SYSRC load /etc/ksh.kshrc by default + exec - if test -f /etc/ksh.kshrc || test -f /etc/bash.bashrc + exec - then writedef SYSRC 1 + exec - fi ;; + exec - # some other SHOPTs may be probed for using feature tests in features/options + exec - *=?*) + exec - writedef "$n" "$v" ;; + exec - esac + exec - echo "* SHOPT_$n = ${v:-(probe)}" >&2 # show in make.out + exec - } + exec - + exec - exec >shopt.h + exec - echo '/* Generated from ksh93/SHOPT.sh by ksh93/Mamfile */' + exec - echo + exec - . "$PACKAGEROOT/src/cmd/ksh93/SHOPT.sh" + exec - cat <<-EOF + exec - #include "FEATURE/options" + exec - + exec - /* overrides */ + exec - #if SHOPT_SCRIPTONLY + exec - # undef SHOPT_ACCT + exec - # undef SHOPT_AUDIT + exec - # undef SHOPT_ESH + exec - # undef SHOPT_HISTEXPAND + exec - # undef SHOPT_SYSRC + exec - # undef SHOPT_VSH + exec - #endif + exec - #if !_sys_acct + exec - # undef SHOPT_ACCT + exec - #endif + exec - EOF + done shopt.h + + note * + note * ksh93 C header (*.h) dependencies + note * + + make include/fault.h implicit + prev FEATURE/sigfeatures + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sig.h + done + + make include/history.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/nval.h implicit + prev ${PACKAGE_ast_INCLUDE}/option.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/name.h implicit + prev include/nval.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/shell.h implicit + prev include/fault.h + prev ${PACKAGE_ast_INCLUDE}/stk.h + prev include/history.h + prev ${PACKAGE_ast_INCLUDE}/cmd.h + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + prev include/nval.h + prev include/name.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/shtable.h implicit + done + + make include/builtins.h implicit + prev include/shtable.h + prev FEATURE/dynamic + prev ${PACKAGE_ast_INCLUDE}/option.h + done + + make include/regress.h implicit + done + + make include/argnod.h implicit + done + + make include/defs.h implicit + prev include/regress.h + prev include/shtable.h + prev include/shell.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev include/name.h + prev include/argnod.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev FEATURE/externs + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/test.h implicit + prev include/shtable.h + prev include/defs.h + done + + make include/path.h implicit + prev include/defs.h + prev include/nval.h + done + + make include/variables.h implicit + prev FEATURE/dynamic + prev ${PACKAGE_ast_INCLUDE}/option.h + prev include/nval.h + done + + make include/shnodes.h implicit + prev include/argnod.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/national.h implicit + done + + make include/terminal.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_tty.h + done + + make include/edit.h implicit + prev include/national.h + prev include/terminal.h + prev ${PACKAGE_ast_INCLUDE}/sig.h + prev FEATURE/locale + prev FEATURE/cmds + done + + make include/io.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/jobs.h implicit + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + prev include/terminal.h + prev ${PACKAGE_ast_INCLUDE}/aso.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/streval.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_float.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + + make include/lexstates.h implicit + prev ${PACKAGE_ast_INCLUDE}/wctype.h + prev ${PACKAGE_ast_INCLUDE}/wchar.h + prev FEATURE/locale + done + + make include/ulimit.h implicit + prev FEATURE/rlimits + prev FEATURE/time + done + + make include/shlex.h implicit + prev include/lexstates.h + prev include/shtable.h + prev include/shnodes.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + done + + make include/fcin.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h + done + + make include/version.h implicit + prev ${PACKAGE_ast_INCLUDE}/releaseflags.h + done + + make include/timeout.h implicit + done + + note * + note * ksh93 C source (*.c) dependencies + note * + + make sh/pmain.c + prev FEATURE/externs + prev include/shell.h + prev shopt.h + done + + make bltins/cd_pwd.c + prev include/test.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev include/builtins.h + prev include/name.h + prev include/path.h + prev include/variables.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make bltins/cflow.c + prev include/builtins.h + prev include/shnodes.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev include/defs.h + prev shopt.h + done + + make bltins/enum.c + prev include/defs.h + prev shopt.h + done + + make bltins/getopts.c + prev include/builtins.h + prev include/nval.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/variables.h + prev include/defs.h + prev shopt.h + done + + make bltins/hist.c + prev include/edit.h + prev include/builtins.h + prev include/history.h + prev include/name.h + prev include/io.h + prev include/variables.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev include/defs.h + prev shopt.h + done + + make bltins/misc.c + prev ${PACKAGE_ast_INCLUDE}/times.h + prev FEATURE/time + prev FEATURE/locale + prev include/jobs.h + prev include/builtins.h + prev include/history.h + prev include/name.h + prev include/io.h + prev include/path.h + prev include/shnodes.h + prev include/variables.h + prev include/defs.h + prev shopt.h + done + + make bltins/mkservice.c + prev ${PACKAGE_ast_INCLUDE}/cmd.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/nval.h + prev include/defs.h + prev shopt.h + done + + make bltins/print.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev include/streval.h + prev include/builtins.h + prev include/history.h + prev include/name.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make bltins/read.c + prev include/edit.h + prev include/terminal.h + prev include/history.h + prev include/builtins.h + prev include/name.h + prev include/io.h + prev include/lexstates.h + prev include/variables.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make bltins/sleep.c + prev FEATURE/poll + prev FEATURE/time + prev include/builtins.h + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make bltins/trap.c + prev include/builtins.h + prev include/jobs.h + prev include/defs.h + prev shopt.h + done + + make bltins/test.c + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev FEATURE/poll + prev FEATURE/externs + prev include/builtins.h + prev include/test.h + prev include/terminal.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/regex.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make bltins/typeset.c + prev FEATURE/dynamic + prev include/variables.h + prev include/builtins.h + prev include/history.h + prev include/name.h + prev include/path.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make bltins/ulimit.c + prev include/ulimit.h + prev include/name.h + prev include/builtins.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make bltins/umask.c + prev include/builtins.h + prev include/shell.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make bltins/whence.c + prev include/builtins.h + prev include/shlex.h + prev include/path.h + prev include/name.h + prev include/shtable.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make sh/main.c + prev FEATURE/externs + prev FEATURE/time + prev include/timeout.h + prev include/history.h + prev include/shnodes.h + prev include/shlex.h + prev include/jobs.h + prev include/io.h + prev include/path.h + prev include/variables.h + prev include/defs.h + prev include/fcin.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/nvdisc.c + prev include/shlex.h + prev include/io.h + prev include/path.h + prev include/builtins.h + prev include/variables.h + prev include/defs.h + prev shopt.h + done + + make sh/nvtype.c + prev include/builtins.h + prev include/variables.h + prev include/io.h + prev include/defs.h + prev shopt.h + done + + make sh/arith.c + prev include/builtins.h + prev include/variables.h + prev include/streval.h + prev include/name.h + prev include/lexstates.h + prev include/defs.h + prev shopt.h + done + + make sh/args.c + prev include/io.h + prev include/shlex.h + prev FEATURE/poll + prev include/edit.h + prev include/terminal.h + prev include/builtins.h + prev include/jobs.h + prev include/path.h + prev include/defs.h + prev shopt.h + done + + make sh/array.c + prev include/name.h + prev include/defs.h + prev shopt.h + done + + make edit/completion.c + prev include/history.h + prev include/edit.h + prev include/io.h + prev include/path.h + prev include/lexstates.h + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + prev include/defs.h + prev shopt.h + done + + make sh/defs.c + prev include/timeout.h + prev include/edit.h + prev include/shlex.h + prev include/jobs.h + prev include/defs.h + prev shopt.h + done + + make edit/edit.c + prev include/shlex.h + prev include/edit.h + prev include/history.h + prev include/terminal.h + prev include/io.h + prev include/variables.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev FEATURE/time + prev include/fault.h + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/expand.c + prev include/path.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/ast_dir.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/glob.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev include/test.h + prev include/variables.h + prev include/defs.h + prev shopt.h + done + + make bltins/regress.c + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev include/builtins.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/defs.h + prev shopt.h + done + + make sh/fault.c + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + prev include/ulimit.h + prev include/builtins.h + prev include/path.h + prev include/jobs.h + prev include/variables.h + prev include/shlex.h + prev include/history.h + prev include/io.h + prev include/fcin.h + prev include/defs.h + prev shopt.h + done + + make sh/fcin.c + prev include/fcin.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make edit/history.c + prev ${PACKAGE_ast_INCLUDE}/stdio.h + prev include/history.h + prev include/io.h + prev include/builtins.h + prev include/path.h + prev include/variables.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev FEATURE/time + prev ${PACKAGE_ast_INCLUDE}/sfio.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/init.c + prev ${PACKAGE_ast_INCLUDE}/wctype.h + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + prev include/version.h + prev include/lexstates.h + prev FEATURE/externs + prev FEATURE/dynamic + prev FEATURE/time + prev include/builtins.h + prev include/shlex.h + prev include/io.h + prev include/jobs.h + prev include/edit.h + prev include/name.h + prev include/fault.h + prev include/path.h + prev include/variables.h + prev ${PACKAGE_ast_INCLUDE}/regex.h + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev include/defs.h + prev shopt.h + done + + make sh/io.c + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev FEATURE/poll + prev FEATURE/dynamic + prev FEATURE/externs + prev include/timeout.h + prev include/edit.h + prev include/history.h + prev include/shnodes.h + prev include/shlex.h + prev include/jobs.h + prev include/io.h + prev include/path.h + prev include/variables.h + prev ${PACKAGE_ast_INCLUDE}/regex.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev include/fcin.h + prev include/defs.h + prev shopt.h + done + + make sh/jobs.c + prev include/history.h + prev include/jobs.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/wait.h + prev include/defs.h + prev shopt.h + done + + make sh/lex.c + prev include/shlex.h + prev include/io.h + prev include/lexstates.h + prev include/test.h + prev include/argnod.h + prev include/shell.h + prev include/defs.h + prev include/nval.h + prev include/fcin.h + prev ${PACKAGE_ast_INCLUDE}/releaseflags.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/macro.c + prev include/streval.h + prev include/national.h + prev include/path.h + prev include/shnodes.h + prev include/jobs.h + prev include/io.h + prev include/shlex.h + prev include/variables.h + prev include/name.h + prev ${PACKAGE_ast_INCLUDE}/regex.h + prev include/fcin.h + prev include/defs.h + prev shopt.h + done + + make sh/name.c + prev include/builtins.h + prev include/shnodes.h + prev include/streval.h + prev FEATURE/externs + prev include/timeout.h + prev include/lexstates.h + prev include/path.h + prev include/variables.h + prev include/defs.h + prev shopt.h + done + + make sh/nvtree.c + prev include/lexstates.h + prev include/argnod.h + prev include/name.h + prev include/defs.h + prev shopt.h + done + + make sh/parse.c + prev include/path.h + prev include/test.h + prev include/builtins.h + prev include/history.h + prev include/shlex.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/fcin.h + prev include/shell.h + prev include/defs.h + prev include/version.h + prev shopt.h + done + + make sh/path.c + prev FEATURE/time + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev FEATURE/dynamic + prev include/test.h + prev include/history.h + prev include/jobs.h + prev include/io.h + prev include/path.h + prev include/variables.h + prev include/nval.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev include/fcin.h + prev include/defs.h + prev shopt.h + done + + make sh/string.c + prev ${PACKAGE_ast_INCLUDE}/wctype.h + prev include/national.h + prev include/lexstates.h + prev include/shtable.h + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/lc.h + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/streval.c + prev FEATURE/externs + prev ${PACKAGE_ast_INCLUDE}/error.h + prev include/streval.h + prev shopt.h + done + + make sh/subshell.c + prev include/path.h + prev include/variables.h + prev include/jobs.h + prev include/shlex.h + prev include/shnodes.h + prev include/fault.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev include/defs.h + prev shopt.h + done + + make sh/tdump.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev include/io.h + prev include/path.h + prev include/shnodes.h + prev include/defs.h + prev shopt.h + done + + make sh/timers.c + prev FEATURE/time + prev FEATURE/sigfeatures + prev include/defs.h + prev include/fault.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/sig.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make sh/trestore.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev include/io.h + prev include/path.h + prev include/shnodes.h + prev include/defs.h + prev shopt.h + done + + make sh/waitevent.c + prev include/defs.h + prev shopt.h + done + + make sh/xec.c + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + prev include/streval.h + prev FEATURE/locale + prev FEATURE/externs + prev FEATURE/time + prev include/builtins.h + prev include/test.h + prev include/jobs.h + prev include/shnodes.h + prev include/io.h + prev include/name.h + prev include/path.h + prev include/variables.h + prev include/fcin.h + prev include/defs.h + prev shopt.h + done + + make data/limits.c + prev include/ulimit.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make data/msg.c + prev include/edit.h + prev include/jobs.h + prev include/builtins.h + prev include/history.h + prev include/timeout.h + prev include/shlex.h + prev include/io.h + prev include/path.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make data/strdata.c + prev FEATURE/math + prev include/streval.h + prev ${PACKAGE_ast_INCLUDE}/ast_standards.h + prev shopt.h + done + + make data/testops.c + prev include/test.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make data/keywords.c + prev include/shlex.h + prev include/shell.h + prev shopt.h + done + + make data/options.c + prev include/shtable.h + prev include/name.h + prev include/defs.h + prev shopt.h + done + + make data/signals.c + prev include/jobs.h + prev include/defs.h + prev shopt.h + done + + make data/aliases.c + prev FEATURE/dynamic + prev include/defs.h + prev shopt.h + done + + make data/builtins.c + prev FEATURE/poll + prev FEATURE/cmds + prev include/jobs.h + prev include/builtins.h + prev include/version.h + prev include/name.h + prev include/ulimit.h + prev include/shtable.h + prev include/defs.h + prev shopt.h + done + + make data/variables.c + prev include/builtins.h + prev include/variables.h + prev include/defs.h + prev include/name.h + prev include/shtable.h + prev include/shell.h + prev FEATURE/dynamic + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make data/lexstates.c + prev include/lexstates.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make edit/emacs.c + prev include/terminal.h + prev include/edit.h + prev include/history.h + prev include/io.h + prev include/defs.h + prev ${PACKAGE_ast_INCLUDE}/releaseflags.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev shopt.h + done + + make edit/vi.c + prev include/lexstates.h + prev FEATURE/time + prev include/terminal.h + prev include/edit.h + prev include/history.h + prev include/io.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + prev include/defs.h + prev shopt.h + done + + make edit/hexpand.c + prev include/edit.h + prev include/defs.h + prev shopt.h + done + + make sh/shcomp.c + prev include/terminal.h + prev include/shnodes.h + prev include/path.h + prev include/defs.h + prev include/shell.h + prev include/version.h + prev shopt.h + done + + note * + note * Set common compiler invocation arguments + note * + + setv compile ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${DEBUG+-DDEBUG=${DEBUG}} -DSH_DICT=${SH_DICT} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c + + note * + note * Build the library + note * + + make libshell.a + + loop OBJ args arith array defs expand fault fcin init io jobs lex macro main name nvdisc nvtree nvtype parse path streval string subshell tdump timers trestore waitevent xec + make ${OBJ}.o + prev sh/${OBJ}.c + exec - ${compile} ${<} + done + done + + loop OBJ cd_pwd cflow enum getopts hist misc mkservice print read regress sleep test trap typeset ulimit umask whence + make ${OBJ}.o + prev bltins/${OBJ}.c + exec - ${compile} ${<} + done + done + + loop OBJ completion edit emacs hexpand history vi + make ${OBJ}.o + prev edit/${OBJ}.c + exec - ${compile} ${<} + done + done + + loop OBJ aliases builtins keywords lexstates limits msg options signals strdata testops variables + make ${OBJ}.o + prev data/${OBJ}.c + exec - ${compile} ${<} + done + done + + note * + note * Link the library + note * + exec - if test -f ${@} + exec - then ${AR} rc ${@} ${?} # add changed *.o + exec - else ${AR} rc ${@} ${^} # add all *.o + exec - fi || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + + note * save for dylink + setv _libshell_object_files_ ${^} + done libshell.a + + note * Set the mam_libshell variable + bind -lshell + + shim - link_binary() + shim - { + shim - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} \ + shim - ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} \ + shim - -o "$@" ${mam_libshell} ${mam_libnsl} ${mam_libast} ${mam_libm} + shim - } + + make ksh bind -lshell - exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libast} -lm - done ksh generated + make pmain.o + prev sh/pmain.c + exec - ${compile} ${<} + done + exec - link_binary ksh pmain.o + done ksh + make shcomp + bind -lshell make shcomp.o - make sh/shcomp.c - prev include/terminal.h - prev include/shnodes.h - prev include/path.h - prev include/defs.h - prev include/shell.h - prev include/version.h - prev shopt.h - done sh/shcomp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=${SH_DICT} -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/shcomp.c - done shcomp.o generated - prev ksh - exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} -lm - done shcomp generated - make shell + prev sh/shcomp.c + exec - ${compile} ${<} + done + exec - link_binary shcomp shcomp.o + done shcomp + + note * + note * Dynamically linked version, if supported + note * + + make ${INSTALLROOT}/dyn/lib/libshell${mam_cc_SUFFIX_SHARED} dontcare prev libshell.a - done shell virtual - prev libshell.a - make ${INSTALLROOT}/bin - exec - if test ! -d ${INSTALLROOT}/bin - exec - then mkdir -p ${INSTALLROOT}/bin - exec - fi - done ${INSTALLROOT}/bin generated - make ${INSTALLROOT}/bin/ksh - prev ${INSTALLROOT}/bin + prev shell.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED}' + exec - dylink -m shell -v ${DYLIB_VERSION} -s ${mam_cc_SUFFIX_SHARED} $(sed 1d shell.req) ${_libshell_object_files_} + done + + make ${INSTALLROOT}/dyn/bin/ksh dontcare prev ksh - exec - ${STDCMP} 2>/dev/null -s ksh ${INSTALLROOT}/bin/ksh || { ${STDMV} ${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh.old 2>/dev/null || true; ${STDCP} ksh ${INSTALLROOT}/bin/ksh ;} - done ${INSTALLROOT}/bin/ksh generated - make ${INSTALLROOT}/man/man1 - exec - if test ! -d ${INSTALLROOT}/man/man1 - exec - then mkdir -p ${INSTALLROOT}/man/man1 - exec - fi - done ${INSTALLROOT}/man/man1 generated + prev shell.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED} ${mam_cc_EXPORT_DYNAMIC}' + exec - dylink -e ksh $(cat shell.req) ${mam_libnsl} ${mam_libm} pmain.o + done + + make ${INSTALLROOT}/dyn/bin/shcomp dontcare + prev shcomp + prev shell.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED} ${mam_cc_EXPORT_DYNAMIC}' + exec - dylink -e shcomp $(cat shell.req) ${mam_libnsl} ${mam_libm} shcomp.o + done + + note * + note * Pre-install + note * + + loop DIR bin include/ast lib/lib man/man1 man/man3 fun etc + make ${INSTALLROOT}/${DIR} + exec - mkdir -p ${@} + done + done + loop EXE ksh shcomp + make ${INSTALLROOT}/bin/${EXE} + prev ${EXE} + note * macOS throws code signature error if 'cp' overwrites Mach-O binary; must remove first + exec - rm -f ${@} && cp ${<} ${@} + done + done make ${INSTALLROOT}/man/man1/sh.1 - prev ${INSTALLROOT}/man/man1 prev sh.1 - exec - ${STDCMP} 2>/dev/null -s sh.1 ${INSTALLROOT}/man/man1/sh.1 || { ${STDMV} ${INSTALLROOT}/man/man1/sh.1 ${INSTALLROOT}/man/man1/sh.1.old 2>/dev/null || true; ${STDCP} sh.1 ${INSTALLROOT}/man/man1/sh.1 ;} - done ${INSTALLROOT}/man/man1/sh.1 generated - make ${INSTALLROOT}/lib - exec - if test ! -d ${INSTALLROOT}/lib - exec - then mkdir -p ${INSTALLROOT}/lib - exec - fi - done ${INSTALLROOT}/lib generated - make ${INSTALLROOT}/lib/libshell.a archive - prev ${INSTALLROOT}/lib + exec - cp -f ${<} ${@} + done + make ${INSTALLROOT}/lib/libshell.a prev libshell.a - exec - ${STDCMP} 2>/dev/null -s libshell.a ${INSTALLROOT}/lib/libshell.a || { ${STDMV} ${INSTALLROOT}/lib/libshell.a ${INSTALLROOT}/lib/libshell.a.old 2>/dev/null || true; ${STDCP} libshell.a ${INSTALLROOT}/lib/libshell.a ;} - exec - (ranlib ${INSTALLROOT}/lib/libshell.a) >/dev/null 2>&1 || true - done ${INSTALLROOT}/lib/libshell.a generated - make ${INSTALLROOT}/man/man3 - exec - if test ! -d ${INSTALLROOT}/man/man3 - exec - then mkdir -p ${INSTALLROOT}/man/man3 - exec - fi - done ${INSTALLROOT}/man/man3 generated - make ${INSTALLROOT}/man/man3/shell.3 - prev ${INSTALLROOT}/man/man3 - prev shell.3 - exec - ${STDCMP} 2>/dev/null -s shell.3 ${INSTALLROOT}/man/man3/shell.3 || { ${STDMV} ${INSTALLROOT}/man/man3/shell.3 ${INSTALLROOT}/man/man3/shell.3.old 2>/dev/null || true; ${STDCP} shell.3 ${INSTALLROOT}/man/man3/shell.3 ;} - done ${INSTALLROOT}/man/man3/shell.3 generated - make ${INSTALLROOT}/man/man3/nval.3 - prev nval.3 - exec - ${STDCMP} 2>/dev/null -s nval.3 ${INSTALLROOT}/man/man3/nval.3 || { ${STDMV} ${INSTALLROOT}/man/man3/nval.3 ${INSTALLROOT}/man/man3/nval.3.old 2>/dev/null || true; ${STDCP} nval.3 ${INSTALLROOT}/man/man3/nval.3 ;} - done ${INSTALLROOT}/man/man3/nval.3 generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + exec - cp -f ${<} ${@} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done + loop MAN3PG shell nval + make ${INSTALLROOT}/man/man3/${MAN3PG}.3 + prev ${MAN3PG}.3 + exec - cp -f ${<} ${@} + done + done make ${INSTALLROOT}/lib/lib/shell - prev ${INSTALLROOT}/lib/lib prev shell.req - exec - ${STDCMP} 2>/dev/null -s shell.req ${INSTALLROOT}/lib/lib/shell || { ${STDMV} ${INSTALLROOT}/lib/lib/shell ${INSTALLROOT}/lib/lib/shell.old 2>/dev/null || true; ${STDCP} shell.req ${INSTALLROOT}/lib/lib/shell ;} - done ${INSTALLROOT}/lib/lib/shell generated - make ${PACKAGE_ast_INCLUDE} - exec - if test ! -d ${PACKAGE_ast_INCLUDE} - exec - then mkdir -p ${PACKAGE_ast_INCLUDE} - exec - fi - done ${PACKAGE_ast_INCLUDE} generated - make ${PACKAGE_ast_INCLUDE}/nval.h - prev ${PACKAGE_ast_INCLUDE} - prev include/nval.h - exec - if ! ${STDCMP} -s include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h - exec - then ${STDCP} include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/nval.h generated - make ${PACKAGE_ast_INCLUDE}/shell.h - prev include/shell.h - exec - if ! ${STDCMP} -s include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h - exec - then ${STDCP} include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/shell.h generated - make ${PACKAGE_ast_INCLUDE}/history.h - prev include/history.h - exec - if ! ${STDCMP} -s include/history.h ${PACKAGE_ast_INCLUDE}/history.h - exec - then ${STDCP} include/history.h ${PACKAGE_ast_INCLUDE}/history.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/history.h generated - make ${INSTALLROOT}/bin/shcomp - prev shcomp - exec - ${STDCMP} 2>/dev/null -s shcomp ${INSTALLROOT}/bin/shcomp || { ${STDMV} ${INSTALLROOT}/bin/shcomp ${INSTALLROOT}/bin/shcomp.old 2>/dev/null || true; ${STDCP} shcomp ${INSTALLROOT}/bin/shcomp ;} - done ${INSTALLROOT}/bin/shcomp generated - make ${INSTALLROOT}/fun - exec - if test ! -d ${INSTALLROOT}/fun - exec - then mkdir -p ${INSTALLROOT}/fun - exec - fi - done ${INSTALLROOT}/fun generated - make ${INSTALLROOT}/fun/autocd - prev ${INSTALLROOT}/fun - prev fun/autocd - exec - ${STDCMP} 2>/dev/null -s fun/autocd ${INSTALLROOT}/fun/autocd || { ${STDMV} ${INSTALLROOT}/fun/autocd ${INSTALLROOT}/fun/autocd.old 2>/dev/null || true; ${STDCP} fun/autocd ${INSTALLROOT}/fun/autocd && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/autocd ;} - done ${INSTALLROOT}/fun/autocd generated - make ${INSTALLROOT}/fun/cd - prev ${INSTALLROOT}/fun - prev fun/cd - exec - ${STDCMP} 2>/dev/null -s fun/cd ${INSTALLROOT}/fun/cd || { ${STDMV} ${INSTALLROOT}/fun/cd ${INSTALLROOT}/fun/cd.old 2>/dev/null || true; ${STDCP} fun/cd ${INSTALLROOT}/fun/cd && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/cd ;} - done ${INSTALLROOT}/fun/cd generated - make ${INSTALLROOT}/fun/dirs - prev ${INSTALLROOT}/fun - prev fun/dirs - exec - ${STDCMP} 2>/dev/null -s fun/dirs ${INSTALLROOT}/fun/dirs || { ${STDMV} ${INSTALLROOT}/fun/dirs ${INSTALLROOT}/fun/dirs.old 2>/dev/null || true; ${STDCP} fun/dirs ${INSTALLROOT}/fun/dirs && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/dirs ;} - done ${INSTALLROOT}/fun/dirs generated - make ${INSTALLROOT}/fun/man - prev ${INSTALLROOT}/fun - prev fun/man - exec - ${STDCMP} 2>/dev/null -s fun/man ${INSTALLROOT}/fun/man || { ${STDMV} ${INSTALLROOT}/fun/man ${INSTALLROOT}/fun/man.old 2>/dev/null || true; ${STDCP} fun/man ${INSTALLROOT}/fun/man && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/man ;} - done ${INSTALLROOT}/fun/man generated - make ${INSTALLROOT}/fun/mcd - prev ${INSTALLROOT}/fun - prev fun/mcd - exec - ${STDCMP} 2>/dev/null -s fun/mcd ${INSTALLROOT}/fun/mcd || { ${STDMV} ${INSTALLROOT}/fun/mcd ${INSTALLROOT}/fun/mcd.old 2>/dev/null || true; ${STDCP} fun/mcd ${INSTALLROOT}/fun/mcd && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/mcd ;} - done ${INSTALLROOT}/fun/mcd generated - make ${INSTALLROOT}/fun/popd - prev fun/popd - exec - ${STDCMP} 2>/dev/null -s fun/popd ${INSTALLROOT}/fun/popd || { ${STDMV} ${INSTALLROOT}/fun/popd ${INSTALLROOT}/fun/popd.old 2>/dev/null || true; ${STDCP} fun/popd ${INSTALLROOT}/fun/popd && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/popd ;} - done ${INSTALLROOT}/fun/popd generated - make ${INSTALLROOT}/fun/pushd - prev fun/pushd - exec - ${STDCMP} 2>/dev/null -s fun/pushd ${INSTALLROOT}/fun/pushd || { ${STDMV} ${INSTALLROOT}/fun/pushd ${INSTALLROOT}/fun/pushd.old 2>/dev/null || true; ${STDCP} fun/pushd ${INSTALLROOT}/fun/pushd && ${STDCHMOD} ugo+x ${INSTALLROOT}/fun/pushd ;} - done ${INSTALLROOT}/fun/pushd generated -done install virtual -make test - make test.ksh + exec - cp -f ${<} ${@} + done + loop HDR nval shell history + make ${PACKAGE_ast_INCLUDE}/${HDR}.h + prev include/${HDR}.h + exec - cp -f ${<} ${@} + done + done + loop FUN autocd cd dirs man mcd popd pushd + make ${INSTALLROOT}/fun/${FUN} + prev fun/${FUN} + exec - cp -f ${<} ${@} && chmod ugo+x ${@} + done + done + make ${INSTALLROOT}/etc/kshrc + prev kshrc.sh + exec - cp -f ${<} ${@} + done +done install + +note * +note * Run regression tests. +note * + +make test dontcare virtual + prev install + make test.ksh virtual prev tests/shtests - exec - cd "$PACKAGEROOT/src/cmd/ksh93/tests" - exec - exec "$SHELL" shtests - done test.ksh virtual -done test dontcare virtual + exec - cd "$PACKAGEROOT/src/cmd/ksh93/tests" && ./shtests + done +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/README -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/README
Changed
@@ -127,10 +127,13 @@ NOECHOE off Disable the '-e' option to the 'echo' command, unless SHOPT_ECHOPRINT is enabled. - OLDTERMIO off Use either termios or termio at runtime. - OPTIMIZE on Optimize loop invariants for with for and while loops. + PRINTF_LEGACY The printf built-in accepts a format operand that starts + with '-' without the standard preceding '--' options + terminator. This is for compatibility with local scripts. + Enabled by default if the OS's printf(1) is POSIX-ignorant. + P_SUID 0 If set, all real UIDs greater than or equal to this value will require the -p option to run the shell setuid/setgid.
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/SHOPT.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/SHOPT.sh
Changed
@@ -16,7 +16,7 @@ SHOPT CMDLIB_DIR= # '"/opt/ast/bin"' # virtual directory prefix for path-bound builtins SHOPT CRNL= # accept MS Windows newlines (<cr><nl>) for <nl> SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions -SHOPT DYNAMIC=0 # dynamic loading for builtins +SHOPT DYNAMIC=1 # dynamic loading for builtins SHOPT ECHOPRINT= # make echo equivalent to print SHOPT EDPREDICT=0 # History pattern search menu (type #<pattern>, then ESC <number> TAB). Experimental. SHOPT ESH=1 # emacs/gmacs edit mode @@ -29,9 +29,9 @@ SHOPT MULTIBYTE= # multibyte character handling SHOPT NAMESPACE=1 # allow namespaces SHOPT NOECHOE=0 # turn off 'echo -e' when SHOPT_ECHOPRINT is disabled -SHOPT OLDTERMIO= # support both TCGETA and TCGETS SHOPT OPTIMIZE=1 # optimize loop invariants SHOPT P_SUID=0 # real UIDs >= this value require -p for setugid (to turn off, use empty, not 0) +SHOPT PRINTF_LEGACY= # allow noncompliant printf(1) syntax (format arg starting with '-' without prior '--') SHOPT REGRESS= # enable __regress__ builtin and instrumented intercepts for testing SHOPT REMOTE= # enable --rc if running as a remote shell SHOPT SCRIPTONLY=0 # build ksh for running scripts only; compile out the interactive shell
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/TYPES -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/TYPES
Changed
@@ -1,11 +1,10 @@ +### User-defined variable types in ksh93 ### -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. +The ability for users to define types is available as of ksh version 93t. +Here is an overview of how types are defined and used in ksh93. -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 type can be defined either by a shared library or by using the -T option +option to the shell's typeset command. 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.
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/cd_pwd.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/cd_pwd.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -171,7 +171,7 @@ #endif /* _WINIX */ if(*stkptr(sh.stk,PATH_OFFSET)!='/') { - char *last=(char*)stkfreeze(sh.stk,1); + char *last = stkfreeze(sh.stk,1); stkseek(sh.stk,PATH_OFFSET); sfputr(sh.stk,oldpwd,-1); /* don't add '/' if oldpwd is / itself */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/cflow.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/cflow.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -65,19 +65,25 @@ argv += opt_info.index; if(*argv) { - long l = strtol(*argv, NULL, 10); + int r; + intmax_t l = strtoll(*argv, NULL, 10); if(do_exit) + { n = (int)(l & SH_EXITMASK); /* exit: apply bitmask before conversion to avoid undefined int overflow */ - else if((long)(n = (int)l) != l) /* return: convert to int and check for overflow (should be safe enough) */ + if (sh.intrap) + sh.intrap_exit_n = 1; + } + else if(r = (int)l, l != (intmax_t)r) /* return: convert to int and check for overflow (should be safe enough) */ { errormsg(SH_DICT,ERROR_warn(0),"%s: out of range",*argv); n = 128; /* overflow is undefined, so use a consistent status for this */ } + else + n = r; } else { - /* no argument: pass down $? (but in a trap action, pass down the pre-trap $?) */ - n = sh.intrap ? sh.oldexit : sh.savexit; + n = sh.savexit; /* no argument: pass down $? */ if(do_exit) n &= SH_EXITMASK; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/enum.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/enum.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,7 +22,7 @@ const char sh_optenum = "-?\n@(#)$Id: " ENUM_ID " $\n" -"--catalog?" ERROR_CATALOG "" +"--catalog?" SH_DICT "" "+NAME?enum - create an enumeration type" "+DESCRIPTION?\benum\b is a declaration command that creates one or more " "enumeration type declaration commands named \atypename\a. Variables " @@ -56,7 +56,7 @@ static const char enum_type = "-?\n@(#)$Id: " ENUM_ID " $\n" -"--catalog?" ERROR_CATALOG "" +"--catalog?" SH_DICT "" "+NAME?\f?\f - create an instance of type \b\f?\f\b" "+DESCRIPTION?The \b\f?\f\b declaration command creates a variable for " "each \aname\a with enumeration type \b\f?\f\b, a type that has been " @@ -217,7 +217,7 @@ Namval_t *np; } optdisc; - cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY); + cmdinit(argc, argv, context, SH_DICT, ERROR_NOTIFY); for (;;) { switch (optget(argv, sh_optenum))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/getopts.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/getopts.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -41,7 +41,7 @@ #endif /* SHOPT_NAMESPACE */ { int savtop = stktell(stkp); - char *savptr = stkfreeze(stkp,0); + void *savptr = stkfreeze(stkp,0); sfputc(stkp,'$'); sfputc(stkp,'('); sfputr(stkp,s,')');
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/hist.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/hist.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -213,7 +213,7 @@ errormsg(SH_DICT,ERROR_system(1),e_create,fname); UNREACHABLE(); } - outfile= sfnew(NULL,sh.outbuff,IOBSIZE,fdo,SF_WRITE); + outfile= sfnew(NULL,sh.outbuff,IOBSIZE,fdo,SFIO_WRITE); arg = "\n"; nflag++; } @@ -279,7 +279,7 @@ errormsg(SH_DICT,ERROR_exit(1),e_toodeep,"history"); UNREACHABLE(); } - iop = sfnew(NULL,buff,IOBSIZE,fdo,SF_READ); + iop = sfnew(NULL,buff,IOBSIZE,fdo,SFIO_READ); sh_eval(iop,1); /* this will close fdo */ hist_depth--; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/misc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/misc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -64,6 +64,8 @@ static void noexport(Namval_t* np, void *data) { NOT_USED(data); + if(sh.subshell && !sh.subshare) + sh_assignok(np,0); nv_offattr(np,NV_EXPORT); } @@ -77,11 +79,9 @@ int b_exec(int argc,char *argv, Shbltin_t *context) { int n; - struct checkpt *pp; const char *pname; int clear = 0; char *arg0 = 0; - NOT_USED(argc); NOT_USED(context); sh.st.ioset = 0; while (n = optget(argv, *argv0=='r' ? sh_optredirect : sh_optexec)) switch (n) @@ -115,16 +115,13 @@ /* from here on, it's 'exec' with args, so we're replacing the shell */ if(sh_isoption(SH_RESTRICTED)) - { errormsg(SH_DICT,ERROR_exit(1),e_restricted,argv0); - UNREACHABLE(); - } else { struct argnod *arg=sh.envlist; Namval_t* np; char *cp; - if(sh.subshell && !sh.subshare) + if(arg0 && sh.subshell && !sh.subshare) sh_subfork(); if(clear) nv_scan(sh.var_tree,noexport,0,NV_EXPORT,NV_EXPORT); @@ -148,14 +145,25 @@ /* if the main shell is about to be replaced, decrease SHLVL to cancel out a subsequent increase */ if(!sh.realsubshell) (*SHLVL->nvalue.ip)--; - /* force bad exec to terminate shell */ - pp = (struct checkpt*)sh.jmplist; - pp->mode = SH_JMPEXIT; + sh_onstate(SH_EXEC); + if(sh.subshell && !sh.subshare) + { + struct dolnod *dp = stkalloc(sh.stk, sizeof(struct dolnod) + ARG_SPARE*sizeof(char*) + argc*sizeof(char*)); + struct comnod *t = stkalloc(sh.stk,sizeof(struct comnod)); + memset(t, 0, sizeof(struct comnod)); + dp->dolnum = argc; + dp->dolbot = ARG_SPARE; + memcpy(dp->dolval+ARG_SPARE, argv, (argc+1)*sizeof(char*)); + t->comarg.dp = dp; + sh_exec((Shnode_t*)t,sh_isstate(SH_ERREXIT)); + sh_offstate(SH_EXEC); + siglongjmp(*sh.jmplist,SH_JMPEXIT); + } sh_sigreset(2); sh_freeup(); path_exec(pname,argv,NULL); } - return 1; + UNREACHABLE(); } int b_let(int argc,char *argv,Shbltin_t *context) @@ -312,7 +320,7 @@ else { buffer = sh_malloc(IOBSIZE+1); - iop = sfnew(NULL,buffer,IOBSIZE,fd,SF_READ); + iop = sfnew(NULL,buffer,IOBSIZE,fd,SFIO_READ); sh_offstate(SH_NOFORK); sh_eval(iop,sh_isstate(SH_PROFILE)?SH_FUNEVAL:0); } @@ -578,7 +586,7 @@ return 0; } -#ifdef _cmd_universe +#if _cmd_universe /* * There are several universe styles that are masked by the getuniv(), * setuniv() calls.
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/mkservice.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/mkservice.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -210,7 +210,7 @@ static int waitnotify(int fd, long timeout, int rw) { - Sfio_t *special=0, **pstream; + Sfio_t *special=0, **pstream; int i; if (fd >= 0) @@ -228,7 +228,7 @@ *pstream++ = sh_fd2sfio(file_listi); } for(i=0; i < pstream-poll_list; i++) - sfset(poll_listi,SF_WRITE,0); + sfset(poll_listi,SFIO_WRITE,0); nready = ready = 0; errno = 0; #ifdef DEBUG @@ -245,7 +245,7 @@ sfputc(sfstderr,'\n'); #endif for(i=0; i < pstream-poll_list; i++) - sfset(poll_listi,SF_WRITE,1); + sfset(poll_listi,SFIO_WRITE,1); if(nready<=0) return errno? -1: 0; if(special && poll_list0==special) @@ -279,7 +279,7 @@ static int Accept(Service_t *sp, int accept_fd) { Namval_t* nq = sp->discACCEPT; - int fd; + int fd; fd = fcntl(accept_fd, F_DUPFD, 10); if (fd >= 0) @@ -307,7 +307,7 @@ static int Action(Service_t *sp, int fd, int close) { Namval_t* nq; - int r=0; + int r=0; if(close) nq = sp->discCLOSE; @@ -329,7 +329,7 @@ static int Error(Service_t *sp, int level, const char* arg, ...) { - va_list ap; + va_list ap; va_start(ap, arg); if(sp->node)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/print.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/print.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2014 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -176,9 +176,9 @@ Namval_t *vname=0; Optdisc_t disc; exitval = 0; + memset(&disc, 0, sizeof(disc)); disc.version = OPT_VERSION; disc.infof = infof; - opt_info.disc = &disc; if(argc>0) { options = sh_optprint; @@ -197,6 +197,15 @@ goto skip; } } + opt_info.disc = &disc; +#if SHOPT_PRINTF_LEGACY + /* POSIX-ignorant printf(1) compat, prong 1: prevent option parsing if first arg looks like format operand */ + if(argc<0 && argv1 && (strchr(argv1,'%') || strchr(argv1,'\\'))) + { + opt_info.index = 1; + goto skipopts; + } +#endif /* SHOPT_PRINTF_LEGACY */ while((n = optget(argv,options))) switch(n) { case 'n': @@ -215,6 +224,7 @@ /* print to history file */ if(!sh_histinit()) { + opt_info.disc = NULL; errormsg(SH_DICT,ERROR_system(1),e_history); UNREACHABLE(); } @@ -251,6 +261,7 @@ vname = nv_open(opt_info.arg, sh.var_tree, NV_VARNAME); if(!vname) { + opt_info.disc = NULL; errormsg(SH_DICT, ERROR_exit(2), e_create, opt_info.arg); UNREACHABLE(); } @@ -262,6 +273,14 @@ vflag='C'; break; case ':': +#if SHOPT_PRINTF_LEGACY + /* POSIX-ignorant printf(1) compat, prong 2: treat erroneous first option as operand */ + if(argc<0 && (opt_info.index==1 || opt_info.index==2 && argv10=='-' && argv11=='-')) + { + opt_info.index = 1; + goto skipopts; + } +#endif /* SHOPT_PRINTF_LEGACY */ /* The following is for backward compatibility */ if(strcmp(opt_info.name,"-R")==0) { @@ -277,6 +296,7 @@ nflag++; argv++; } + opt_info.disc = NULL; goto skip2; } } @@ -284,9 +304,14 @@ errormsg(SH_DICT,2, "%s", opt_info.arg); break; case '?': + opt_info.disc = NULL; errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg); UNREACHABLE(); } +#if SHOPT_PRINTF_LEGACY +skipopts: +#endif /* SHOPT_PRINTF_LEGACY */ + opt_info.disc = NULL; argv += opt_info.index; if(error_info.errors || (argc<0 && !(format = *argv++))) { @@ -331,13 +356,13 @@ if(!(outfile=sh.sftablefd)) { sh_onstate(SH_NOTRACK); - n = SF_WRITE|((n&IOREAD)?SF_READ:0); + n = SFIO_WRITE|((n&IOREAD)?SFIO_READ:0); sh.sftablefd = outfile = sfnew(NULL,sh.outbuff,IOBSIZE,fd,n); sh_offstate(SH_NOTRACK); - sfpool(outfile,sh.outpool,SF_WRITE); + sfpool(outfile,sh.outpool,SFIO_WRITE); } /* turn off share to guarantee atomic writes for printf */ - n = sfset(outfile,SF_SHARE|SF_PUBLIC,0); + n = sfset(outfile,SFIO_SHARE|SFIO_PUBLIC,0); printf_v: if(format) { @@ -350,7 +375,7 @@ pdata.hdr.reloadf = reload; pdata.nextarg = argv; sh_offstate(SH_STOPOK); - pool=sfpool(sfstderr,NULL,SF_WRITE); + pool=sfpool(sfstderr,NULL,SFIO_WRITE); do { pdata.argv0 = pdata.nextarg; @@ -362,7 +387,7 @@ if(pdata.nextarg == nullarg && pdata.argsize>0) if(sfwrite(outfile,stkptr(sh.stk,stktell(sh.stk)),pdata.argsize) < 0) exitval = 1; - sfpool(sfstderr,pool,SF_WRITE); + sfpool(sfstderr,pool,SFIO_WRITE); if (pdata.err) exitval = 1; } @@ -400,8 +425,8 @@ #endif /* !SHOPT_SCRIPTONLY */ else { - if(n&SF_SHARE) - sfset(outfile,SF_SHARE|SF_PUBLIC,1); + if(n&SFIO_SHARE) + sfset(outfile,SFIO_SHARE|SFIO_PUBLIC,1); if (sfsync(outfile) < 0) exitval = 1; } @@ -1099,7 +1124,6 @@ */ static int reload(int argn, char fmt, void* v, Sffmt_t* fe) { - union types_t* value = (union types_t*)v; struct printf* pp = (struct printf*)fe; int r; int n;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/read.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/read.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -50,13 +50,13 @@ struct read_save { - char **argv; - char *prompt; - int fd; - int plen; - int flags; - ssize_t len; - long timeout; + char **argv; + char *prompt; + int fd; + int plen; + int flags; + ssize_t len; + Sflong_t timeout; }; int b_read(int argc,char *argv, Shbltin_t *context) @@ -66,7 +66,7 @@ const char *msg = e_file+4; int r, flags=0, fd=0; ssize_t len=0; - long timeout = 1000*sh.st.tmout; + Sflong_t timeout = 1000*(Sflong_t)sh.st.tmout; int save_prompt, fixargs=context->invariant; struct read_save *rp; static char default_prompt3 = {ESC,ESC}; @@ -178,7 +178,7 @@ } bypass: sh.prompt = default_prompt; - if(r && (sh.prompt=(char*)sfreserve(sfstderr,r,SF_LOCKR))) + if(r && (sh.prompt=(char*)sfreserve(sfstderr,r,SFIO_LOCKR))) { memcpy(sh.prompt,prompt,r); sfwrite(sfstderr,sh.prompt,r-1); @@ -212,7 +212,7 @@ * <flags> is union of -A, -r, -s, and contains delimiter if not '\n' * <timeout> is the number of milliseconds until timeout */ -int sh_readline(char **names, volatile int fd, int flags, ssize_t size, long timeout) +int sh_readline(char **names, volatile int fd, int flags, ssize_t size, Sflong_t timeout) { ssize_t c; unsigned char *cp; @@ -277,11 +277,11 @@ } else if(flags&C_FLAG) { - char *sp = np->nvenv; + void *sp = np->nvmeta; delim = -1; nv_unset(np); if(!nv_isattr(np,NV_MINIMAL)) - np->nvenv = sp; + np->nvmeta = sp; nv_setvtree(np); } else @@ -349,9 +349,9 @@ flags |= NN_FLAG; size = nv_size(np); } - was_write = (sfset(iop,SF_WRITE,0)&SF_WRITE)!=0; + was_write = (sfset(iop,SFIO_WRITE,0)&SFIO_WRITE)!=0; if(fd==0) - was_share = (sfset(iop,SF_SHARE,sh.redir0!=2)&SF_SHARE)!=0; + was_share = (sfset(iop,SFIO_SHARE,sh.redir0!=2)&SFIO_SHARE)!=0; if(timeout || (sh.fdstatusfd&(IOTTY|IONOSEEK))) { sh_pushcontext(&buff,1); @@ -361,6 +361,14 @@ if(timeout) timeslot = sh_timeradd(timeout,0,timedout,iop); } +#if !SHOPT_SCRIPTONLY + if((flags&S_FLAG) && !sh.hist_ptr) + { + sh_histinit(); + if(!sh.hist_ptr) + flags &= ~S_FLAG; + } +#endif if(flags&(N_FLAG|NN_FLAG)) { char buf256,*var=buf,*cur,*end,*up,*v; @@ -373,7 +381,7 @@ else end = var + sizeof(buf) - 1; up = cur = var; - if((sfset(iop,SF_SHARE,1)&SF_SHARE) && fd!=0) + if((sfset(iop,SFIO_SHARE,1)&SFIO_SHARE) && fd!=0) was_share = 1; if(size==0) { @@ -400,7 +408,7 @@ else { f = 1; - if(cp = sfreserve(iop,c,SF_LOCKR)) + if(cp = sfreserve(iop,c,SFIO_LOCKR)) m = sfvalue(iop); else if(flags&NN_FLAG) { @@ -411,7 +419,7 @@ else { c = sfvalue(iop); - m = (cp = sfreserve(iop,c,SF_LOCKR)) ? sfvalue(iop) : 0; + m = (cp = sfreserve(iop,c,SFIO_LOCKR)) ? sfvalue(iop) : 0; } } if(m>0 && (flags&N_FLAG) && !binary && (v=memchr(cp,'\n',m))) @@ -491,7 +499,7 @@ var = sh_memdup(var,c+1); nv_putval(np,var,NV_RAW); nv_setsize(np,c); - if(!nv_isattr(np,NV_IMPORT|NV_EXPORT) && (mp=(Namval_t*)np->nvenv)) + if(!nv_isattr(np,NV_MINIMAL|NV_EXPORT) && (mp = np->nvmeta)) nv_setsize(mp,c); } } @@ -516,14 +524,6 @@ } if(timeslot) sh_timerdel(timeslot); -#if !SHOPT_SCRIPTONLY - if((flags&S_FLAG) && !sh.hist_ptr) - { - sh_histinit(); - if(!sh.hist_ptr) - flags &= ~S_FLAG; - } -#endif if(cp) { cpmax = cp + c; @@ -843,9 +843,9 @@ if(timeout || (sh.fdstatusfd&(IOTTY|IONOSEEK))) sh_popcontext(&buff); if(was_write) - sfset(iop,SF_WRITE,1); + sfset(iop,SFIO_WRITE,1); if(!was_share) - sfset(iop,SF_SHARE,0); + sfset(iop,SFIO_SHARE,0); if((sh.fdstatusfd&IOTTY) && !keytrap) tty_cooked(fd); #if !SHOPT_SCRIPTONLY
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/test.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/test.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -613,7 +613,7 @@ goto skip; if(sh.userid==sh.euserid && sh.groupid==sh.egroupid) return access(name,mode); -#ifdef _lib_setreuid +#if _lib_setreuid /* swap the real UID to effective, check access then restore */ /* first swap real and effective GID, if different */ if(sh.groupid==sh.euserid || setregid(sh.egroupid,sh.groupid)==0) @@ -649,7 +649,7 @@ mode <<= 6; else if(sh.egroupid == statb.st_gid) mode <<= 3; -#ifdef _lib_getgroups +#if _lib_getgroups /* on some systems you can be in several groups */ else { @@ -665,7 +665,7 @@ maxgroups = (int)astconf_long(CONF_NGROUPS_MAX); } } - groups = (gid_t*)stkalloc(sh.stk,(maxgroups+1)*sizeof(gid_t)); + groups = stkalloc(sh.stk,(maxgroups+1)*sizeof(gid_t)); n = getgroups(maxgroups,groups); while(--n >= 0) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/trap.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/trap.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -339,7 +339,7 @@ static int sig_number(const char *string) { const Shtable_t *tp; - int n,o,sig=0; + int n, o, sig=0; char *last, *name; if(isdigit(*string)) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/typeset.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/typeset.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -186,7 +186,7 @@ if(flag&NV_TAGGED) { if(xflag) - return 0; /* do nothing for 'alias -tx' */ + return 0; /* do nothing for 'alias -tx' */ if(tdata.pflag) { troot = sh_subtracktree(0); /* use existing hash table */ @@ -225,7 +225,7 @@ memset(&tdata,0,sizeof(tdata)); troot = sh.var_tree; - if(ntp) /* custom declaration command added using enum */ + if(ntp) /* type declaration command added using 'typeset -T' or 'enum' */ { tdata.tp = ntp->tp; opt_info.disc = (Optdisc_t*)ntp->optinfof; @@ -233,7 +233,7 @@ } else if(argv00 != 't') /* not <t>ypeset */ { - char **new_argv = (char **)stkalloc(sh.stk, (argc + 2) * sizeof(char*)); + char **new_argv = stkalloc(sh.stk, (argc + 2) * sizeof(char*)); error_info.id = new_argv0 = SYSTYPESET->nvname; if(argv00 == 'a') /* <a>utoload == typeset -fu */ new_argv1 = "-fu"; @@ -249,7 +249,7 @@ new_argv1 = "-n"; else { - errormsg(SH_DICT, ERROR_exit(128), "internal error"); + errormsg(SH_DICT, ERROR_PANIC, e_internal); UNREACHABLE(); } for (n = 1; n <= argc; n++) @@ -549,7 +549,7 @@ } else if(nv_isnull(tdata.tp) && sh.envlist) /* only create a type command if there were assignment(s) */ nv_newtype(tdata.tp); - tdata.tp->nvenv = tdata.help; + tdata.tp->nvmeta = tdata.help; flag &= ~NV_TYPE; if(nv_isattr(tdata.tp,NV_TAGGED)) { @@ -647,8 +647,8 @@ char *last = 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); - Dt_t *save_vartree; - Namval_t *save_namespace; + Dt_t *save_vartree = NULL; + Namval_t *save_namespace = NULL; if(flag&NV_GLOBAL) { save_vartree = sh.var_tree; @@ -766,7 +766,7 @@ if(troot==sh.track_tree && tp->aflag=='-') { sh_offstate(SH_DEFPATH); /* 'command -p hash foo' should work to create 'foo=/bin/foo' */ - path_settrackedalias(name,path_absolute(name,NULL,0)); + path_settrackedalias(name,path_absolute(name,NULL,2)); continue; } if(troot==sh.alias_tree && sh.subshell && !sh.subshare && strchr(name,'=')) @@ -790,7 +790,7 @@ } if(nv_isnull(np) && !nv_isarray(np) && nv_isattr(np,NV_NOFREE)) nv_offattr(np,NV_NOFREE); - else if(tp->tp && !nv_isattr(np,NV_MINIMAL|NV_EXPORT) && (mp=(Namval_t*)np->nvenv) && (ap=nv_arrayptr(mp)) && (ap->nelem&ARRAY_TREE)) + else if(tp->tp && !nv_isattr(np,NV_MINIMAL|NV_EXPORT) && (mp = np->nvmeta) && (ap = nv_arrayptr(mp)) && (ap->nelem & ARRAY_TREE)) { errormsg(SH_DICT,ERROR_exit(1),e_typecompat,nv_name(np)); UNREACHABLE(); @@ -958,7 +958,7 @@ } if(tp->help && !nv_isattr(np,NV_MINIMAL|NV_EXPORT)) { - np->nvenv = tp->help; + np->nvmeta = tp->help; nv_onattr(np,NV_EXPORT); } if(last) @@ -1352,13 +1352,22 @@ if(jmpval==0) { #if SHOPT_NAMESPACE - if(sh.namespace && troot==sh.fun_tree && *name!='.') + if(sh.namespace && troot==sh.fun_tree && !sh.prefix && *name!='.') { + char *nsname; + Namval_t *np2; /* prefix the namespace name */ - sfputr(sh.stk,nv_name(sh.namespace),'.'); - sfputr(sh.stk,name,'\0'); - name = stkfreeze(sh.stk,0); + sfputr(sh.strbuf,nv_name(sh.namespace),'.'); + sfputr(sh.strbuf,name,'\0'); + nsname = sfstruse(sh.strbuf); + np = nv_search(nsname,troot,NV_NOSCOPE); + if(troot!=sh.fun_base && !np && (np2=nv_search(nsname,troot,0)) && is_afunction(np2)) + { /* create dummy virtual subshell node without NV_FUNCTION attribute */ + nv_open(nsname,troot,NV_NOSCOPE); + return r; + } } + if(!np) #endif /* SHOPT_NAMESPACE */ np=nv_open(name,troot,NV_NOADD|nflag); } @@ -1421,8 +1430,8 @@ } else if(troot==sh.alias_tree) r = 1; - else if(troot==sh.fun_tree && troot!=sh.fun_base && (np=nv_search(name,sh.fun_tree,0)) && is_afunction(np)) - nv_open(name,troot,NV_NOSCOPE); /* create dummy virtual subshell node without NV_FUNCTION attribute */ + else if(troot==sh.fun_tree && troot!=sh.fun_base && !np && (np=nv_search(name,troot,0)) && is_afunction(np)) + nv_open(name,troot,NV_NOSCOPE); /* create dummy virtual subshell node without NV_FUNCTION attribute */ } return r; } @@ -1605,7 +1614,7 @@ if(flag==NV_LTOU || flag==NV_UTOL) tp->scanmask |= NV_UTOL|NV_LTOU; namec = nv_scan(root, nullscan, tp, tp->scanmask, flag&~NV_IARRAY); - argv = tp->argnam = (char**)stkalloc(sh.stk,(namec+1)*sizeof(char*)); + argv = tp->argnam = stkalloc(sh.stk,(namec+1)*sizeof(char*)); namec = nv_scan(root, pushname, tp, tp->scanmask, flag&~NV_IARRAY); if(mbcoll()) strsort(argv,namec,strcoll);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/ulimit.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/ulimit.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -68,13 +68,13 @@ char *limit; int mode=0, n; unsigned long hit = 0; -#ifdef _lib_getrlimit +#if _lib_getrlimit struct rlimit rlp; #endif /* _lib_getrlimit */ const Limit_t* tp; char* conf; int label, unit, nosupport, ret=0; - rlim_t i; + rlim_t i=0; char tmp41; Optdisc_t disc; NOT_USED(context); @@ -160,7 +160,7 @@ } else { -#ifdef _lib_getrlimit +#if _lib_getrlimit if(getrlimit(n,&rlp) <0) { errormsg(SH_DICT,ERROR_system(1),e_number,limit); @@ -188,7 +188,7 @@ { if(!nosupport) { -#ifdef _lib_getrlimit +#if _lib_getrlimit if(getrlimit(n,&rlp)<0) { errormsg(SH_DICT,ERROR_system(0),e_limit,tp->description); @@ -200,7 +200,7 @@ if(mode&SOFT) i = rlp.rlim_cur; #else -# ifdef _lib_ulimit +# if _lib_ulimit n--; # endif /* _lib_ulimit */ i = -1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/bltins/whence.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/bltins/whence.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -322,7 +322,7 @@ sfputr(sfstdout,is_pathbound_builtin ? "builtin" : "file",'\n'); else sfputr(sfstdout,sh_fmtq(cp),'\n'); - free((char*)cp); + free((void*)cp); } else if(aflag<=1) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/data/builtins.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/data/builtins.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -119,7 +119,7 @@ "times", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(times), "ulimit", NV_BLTIN|BLT_ENV, bltin(ulimit), "umask", NV_BLTIN|BLT_ENV, bltin(umask), -#ifdef _cmd_universe +#if _cmd_universe "universe", NV_BLTIN|BLT_ENV, bltin(universe), #endif /* _cmd_universe */ "wait", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(wait), @@ -393,7 +393,7 @@ "+NAME?alias - define or display aliases" "+DESCRIPTION?\balias\b creates or redefines alias definitions " "or writes the existing alias definitions to standard output. " - "An alias definitions provides a string value that will replace " + "An alias definition provides a string value that will replace " "a command name when the command is read. Alias names can " "contain any printable character which is not special to the shell. " "If an alias value ends in a space or tab, then the word " @@ -410,9 +410,7 @@ "be executed before the command that references the alias is read." "p?Causes the output to be in the form of alias commands that can be used " "as input to the shell to recreate the current aliases." -"t?Each \aname\a is looked up as a command in \b$PATH\b and its path is " - "added to the hash table as a 'tracked alias'. If no \aname\a is " - "given, this prints the hash table. See \bhash(1)\b." +"t?Same as \bhash\b(1)." "x?This option is obsolete. In most contexts the \b-x\b option is ignored, " "although when it's combined with \b-t\b it will make \balias\b do " "nothing." @@ -654,13 +652,14 @@ ; const char sh_optexec = -"-1c?\n@(#)$Id: exec (ksh 93u+m) 2020-06-11 $\n" +"-1c?\n@(#)$Id: exec (ksh 93u+m) 2024-03-04 $\n" "--catalog?" SH_DICT "" "+NAME?exec - execute command, open/close and duplicate file descriptors" "+DESCRIPTION?\bexec\b is a special built-in command that can be used to " "manipulate file descriptors or to replace the current shell " "with a new command." -"+?If \acommand\a is specified, then the current shell process will be " +"+?If \acommand\a is specified, then \acommand\a is searched on PATH as " + "an external command and the current shell process will be " "replaced by \acommand\a rather than running \acommand\a and waiting " "for it to complete. Note that there is no need to use " "\bexec\b to enhance performance since the shell implicitly " @@ -994,14 +993,15 @@ ; const char sh_opthash = -"-1c?\n@(#)$Id: hash (ksh 93u+m) 2021-01-07 $\n" +"-1c?\n@(#)$Id: hash (ksh 93u+m) 2024-06-30 $\n" "--catalog?" SH_DICT "" "+NAME?hash - display the locations of recently used programs" "+DESCRIPTION?\bhash\b displays or modifies the hash table with the " "locations of recently used programs. If given no arguments, it lists " "all command/path associations (a.k.a. 'tracked aliases') in the hash " "table. Otherwise, \bhash\b performs a \bPATH\b search for each " - "\autility\a supplied and adds the result to the hash table." + "\autility\a supplied and adds the result to the hash table. " + "Any \autility\a that is not found is silently ignored." "r?Empty the hash table. This can also be achieved by resetting \bPATH\b." "\n" "\nutility...\n" @@ -1252,28 +1252,25 @@ ; const char sh_optprintf = -"-1c?\n@(#)$Id: printf (ksh 93u+m) 2023-03-23 $\n" +"-1c?\n@(#)$Id: printf (ksh 93u+m) 2024-02-11 $\n" "--catalog?" SH_DICT "" "+NAME?printf - write formatted output" "+DESCRIPTION?\bprintf\b writes each \astring\a operand to " "standard output using \aformat\a to control the output format." -"+?The \aformat\a operands supports the full range of ANSI C formatting " +#if SHOPT_PRINTF_LEGACY +"+?For backward compatibility with this system's external \bprintf\b(1) " + "command, this built-in version allows the \aformat\a operand to " + "start with a \b-\b without a prior \b--\b options terminator " + "argument, provided no \aoptions\a are given. " + "This is not portable and should be avoided in new scripts." +#else +"+?Note that the \aformat\a operand cannot start with a \b-\b unless it is " + "preceded by a \b--\b options terminator argument." +#endif +"+?The \aformat\a operand supports the full range of ANSI C formatting " "specifiers plus the following additional specifiers:{" "+%b?Each character in the \astring\a operand is processed " - "specially as follows:{" - "+\\a?Alert character." - "+\\b?Backspace character." - "+\\c?Terminate output without appending newline. " - "The remaining \astring\a operands are ignored." - "+\\f?Formfeed character." - "+\\n?Newline character." - "+\\t?Tab character." - "+\\v?Vertical tab character." - "+\\\\?Backslash character." - "+\\E?Escape character (ASCII octal 033)." - "+\\0\ax\a?The 8-bit character whose ASCII code is " - "the 1-, 2-, or 3-digit octal number \ax\a." - "}" + "for \b\\\b codes as in \bprint\b(1)." "+%q?Output \astring\a quoted in a manner that it can be read in " "by the shell to get back the same string. However, empty " "strings resulting from missing \astring\a operands will " @@ -1415,8 +1412,8 @@ "specifiers will be treated as if empty strings were supplied, " "numeric conversions will be treated as if 0 were supplied, and " "time conversions will be treated as if \bnow\b were supplied." -"+?\bprintf\b is equivalent to \bprint -f\b which allows additional " - "options to be specified." +"+?Except for the \b-v\b option, \bprintf\b is equivalent to \bprint -f\b " + "which allows additional options to be specified." "v:name?Put the output in the variable \aname\a instead of writing to " "standard output. \aname\a may include an array subscript (note that " "the square brackets should be quoted to avoid pathname expansion)." @@ -1679,12 +1676,14 @@ "the following:{" "+0?The script or command line to be executed consists entirely " "of zero or more blank lines or comments." - "+>1-125?A noninteractive shell detected a syntax error, a variable " + "+1-125?A noninteractive shell detected a syntax error, a variable " "assignment error, or an error in a special built-in." "+126?\b-c\b and \b-s\b were not specified and the command script " "was found on \bPATH\b but was not executable." "+127?\b-c\b and \b-s\b were not specified and the command script " "corresponding to \aarg\a could not be found." + "+128?An unrecoverable system or internal error occurred." + "+>128?The shell was terminated by a signal." "}" "+SEE ALSO?\bset\b(1), \bbuiltin\b(1)" @@ -1740,7 +1739,7 @@ "positional parameters remaining will be reduced by the " "number of places that are shifted." "+?If \an\a is given, it will be evaluated as an arithmetic expression " - "to determinate the number of places to shift. It is an error " + "to determine the number of places to shift. It is an error " "to shift more than the number of positional parameters or a " "negative number of places." "\n"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/data/math.tab -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/data/math.tab
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2013 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -18,7 +18,7 @@ # <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) 2013-08-11 +# @(#)math.tab (ksh 93u+m) 2024-03-20 f 1 acos f 1 acosh f 1 asin @@ -39,7 +39,7 @@ f 1 expm1 f 1 fabs abs f 2 fdim -f 1 finite +i 1 finite f 1 float f 1 floor f 3 fma
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/data/msg.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/data/msg.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -85,7 +85,7 @@ const char e_subscript = "%s: subscript out of range"; const char e_toodeep = "%s: recursion too deep"; const char e_access = "permission denied"; -#ifdef _cmd_universe +#if _cmd_universe const char e_nouniverse = "universe not accessible"; #endif /* _cmd_universe */ const char e_direct = "bad directory"; @@ -129,6 +129,7 @@ const char e_eneedsarg = "-e - requires single argument"; const char e_limit = "%s: could not get limit"; const char e_overlimit = "%s: limit exceeded"; +const char e_internal = "internal error"; const char e_badsyntax = "incorrect syntax"; const char e_badwrite = "write to %d failed"; const char e_staticfun = "%s: defined as a static function in type %s and cannot be redefined";
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/data/strdata.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/data/strdata.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -68,14 +68,28 @@ */ const char strval_states64 = { + /* nul soh stx etx eot enq ack bel */ A_EOF, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, + + /* bs ht/tab nl/lf vt ff cr so si */ A_REG, 0, 0, A_REG, A_REG, A_REG, A_REG, A_REG, + + /* dle dc1 dc2 dc3 dc4 nak syn etb */ A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, + + /* can em sub esc fs gs rs us */ A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, A_REG, + /* space ! " # $ % & ' */ 0, A_NOT, 0, A_REG, A_REG, A_MOD, A_AND, A_LIT, + + /* ( ) * + , - . / */ A_LPAR, A_RPAR, A_TIMES,A_PLUS, A_COMMA,A_MINUS,A_DOT, A_DIV, + + /* 0 1 2 3 4 5 6 7 */ A_DIG, A_DIG, A_DIG, A_DIG, A_DIG, A_DIG, A_DIG, A_DIG, + + /* 8 9 : ; < = > ? */ A_DIG, A_DIG, A_COLON,A_REG, A_LT, A_ASSIGN,A_GT, A_QUEST };
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/data/variables.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/data/variables.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * *
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/edit/completion.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/edit/completion.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -36,7 +36,7 @@ static char *fmtx(const char *string) { const char *cp = string; - int n,c; + int n = 0, c; int pos = 0; unsigned char *state = (unsigned char*)sh_lexstates2; int offset = stktell(sh.stk); @@ -277,8 +277,8 @@ ep->e_nlist = 0; } } - comptr = (struct comnod*)stkalloc(sh.stk,sizeof(struct comnod)); - ap = (struct argnod*)stkseek(sh.stk,ARGVAL); + comptr = stkalloc(sh.stk,sizeof(struct comnod)); + ap = stkseek(sh.stk,ARGVAL); #if SHOPT_MULTIBYTE { int c = *cur; @@ -311,7 +311,7 @@ goto done; } comptr->comtyp = COMSCAN; - comptr->comarg = ap; + comptr->comarg.ap = ap; ap->argflag = (ARG_MAC|ARG_EXP); ap->argnxt.ap = 0; ap->argchn.cp = 0; @@ -368,7 +368,7 @@ } if(addstar) sfputc(sh.stk,addstar); - ap = (struct argnod*)stkfreeze(sh.stk,1); + ap = stkfreeze(sh.stk,1); } if(mode!='*') sh_onoption(SH_MARKDIRS); @@ -589,6 +589,7 @@ return rval; } +#if SHOPT_ESH || SHOPT_VSH /* * look for edit macro named _i * if found, puts the macro definition into lookahead buffer and returns 1 @@ -629,6 +630,7 @@ } return 0; } +#endif /* SHOPT_ESH || SHOPT_VSH */ /* * Enter the fc command on the current history line @@ -652,7 +654,7 @@ hist_flush(sh.hist_ptr); } cp = strcopy((char*)ep->e_inbuf,e_runvi); - cp = strcopy(cp, fmtbase((intmax_t)ep->e_hline,10,0)); + cp = strcopy(cp, fmtint(ep->e_hline,1)); #if SHOPT_VSH ep->e_eol = ((unsigned char*)cp - (unsigned char*)ep->e_inbuf)-(sh_isoption(SH_VI)!=0); #else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/edit/edit.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/edit/edit.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2014 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,7 +32,7 @@ #include <ccode.h> #include <fault.h> #include "FEATURE/time" -#ifdef _hdr_utime +#if _hdr_utime # include <utime.h> # include <ls.h> #endif @@ -45,8 +45,10 @@ #include "edit.h" #include "shlex.h" +#if SHOPT_ESH || SHOPT_VSH static char *cursor_up; /* move cursor up one line */ static char *erase_eos; /* erase to end of screen */ +#endif /* SHOPT_ESH || SHOPT_VSH */ #if SHOPT_MULTIBYTE # define is_cntrl(c) ((c<=STRIP) && iscntrl(c)) @@ -103,28 +105,6 @@ #define ECHOMODE 3 #define SYSERR -1 -#if SHOPT_OLDTERMIO -# undef tcgetattr -# undef tcsetattr -#endif /* SHOPT_OLDTERMIO */ - -#ifdef RT -# define VENIX 1 -#endif /* RT */ - - -#ifdef _hdr_sgtty -# ifdef TIOCGETP - static int l_mask; - static struct tchars l_ttychars; - static struct ltchars l_chars; - static char l_changed; /* set if mode bits changed */ -# define L_CHARS 4 -# define T_CHARS 2 -# define L_MASK 1 -# endif /* TIOCGETP */ -#endif /* _hdr_sgtty */ - static int keytrap(Edit_t *,char*, int, int, int); #ifndef _POSIX_DISABLE @@ -147,7 +127,7 @@ Sfio_t *sp; ep->e_savefd = -1; if(fd < 0 || fd > sh.lim.open_max || sh.fdstatusfd == IOCLOSE - || (sp = sh.sftablefd) && (sfset(sp,0,0) & SF_STRING)) + || (sp = sh.sftablefd) && (sfset(sp,0,0) & SFIO_STRING)) return 0; return tty_get(fd,&tty)==0; } @@ -218,18 +198,6 @@ return; if(fd < 0) fd = ep->e_savefd; -#ifdef L_MASK - /* restore flags */ - if(l_changed&L_MASK) - ioctl(fd,TIOCLSET,&l_mask); - if(l_changed&T_CHARS) - /* restore alternate break character */ - ioctl(fd,TIOCSETC,&l_ttychars); - if(l_changed&L_CHARS) - /* restore alternate break character */ - ioctl(fd,TIOCSLTC,&l_chars); - l_changed = 0; -#endif /* L_MASK */ /*** don't do tty_set unless ttyparm has valid data ***/ if(tty_set(fd, TCSANOW, &ttyparm) == SYSERR) return; @@ -246,9 +214,6 @@ int tty_raw(int fd, int echomode) { int echo = echomode; -#ifdef L_MASK - struct ltchars lchars; -#endif /* L_MASK */ Edit_t *ep = (Edit_t*)(sh.ed_context); if(ep->e_raw==RAWMODE) return echo?-1:0; @@ -256,95 +221,57 @@ return echo?0:-1; if(tty_get(fd,&ttyparm) == SYSERR) return -1; -#if L_MASK || VENIX - if(ttyparm.sg_flags&LCASE) - return -1; - if(!(ttyparm.sg_flags&ECHO)) - { - if(!echomode) - return -1; - echo = 0; - } - nttyparm = ttyparm; - if(!echo) - nttyparm.sg_flags &= ~(ECHO | TBDELAY); -# ifdef CBREAK - nttyparm.sg_flags |= CBREAK; -# else - nttyparm.sg_flags |= RAW; -# endif /* CBREAK */ - ep->e_erase = ttyparm.sg_erase; - ep->e_kill = ttyparm.sg_kill; - ep->e_eof = cntl('D'); - ep->e_werase = cntl('W'); - ep->e_lnext = cntl('V'); - if( tty_set(fd, TCSADRAIN, &nttyparm) == SYSERR ) - return -1; - ep->e_ttyspeed = (ttyparm.sg_ospeed>=B1200?FAST:SLOW); -# ifdef TIOCGLTC - /* try to remove effect of ^V and ^Y and ^O */ - if(ioctl(fd,TIOCGLTC,&l_chars) != SYSERR) - { - lchars = l_chars; - lchars.t_lnextc = -1; - lchars.t_flushc = -1; - lchars.t_dsuspc = -1; /* no delayed stop process signal */ - if(ioctl(fd,TIOCSLTC,&lchars) != SYSERR) - l_changed |= L_CHARS; - } -# endif /* TIOCGLTC */ -#else if (!(ttyparm.c_lflag & ECHO )) { if(!echomode) return -1; echo = 0; } -# ifdef FLUSHO +#ifdef FLUSHO ttyparm.c_lflag &= ~FLUSHO; -# endif /* FLUSHO */ +#endif /* FLUSHO */ nttyparm = ttyparm; -# ifndef u370 +#ifndef u370 nttyparm.c_iflag &= ~(IGNPAR|PARMRK|INLCR|IGNCR|ICRNL); nttyparm.c_iflag |= BRKINT; -# else +#else nttyparm.c_iflag &= ~(IGNBRK|PARMRK|INLCR|IGNCR|ICRNL|INPCK); nttyparm.c_iflag |= (BRKINT|IGNPAR); -# endif /* u370 */ +#endif /* u370 */ if(echo) nttyparm.c_lflag &= ~(ICANON); else nttyparm.c_lflag &= ~(ICANON|ISIG|ECHO|ECHOK); nttyparm.c_ccVTIME = 0; nttyparm.c_ccVMIN = 1; -# ifdef VREPRINT +#ifdef VREPRINT nttyparm.c_ccVREPRINT = _POSIX_DISABLE; -# endif /* VREPRINT */ -# ifdef VDISCARD +#endif /* VREPRINT */ +#ifdef VDISCARD nttyparm.c_ccVDISCARD = _POSIX_DISABLE; -# endif /* VDISCARD */ -# ifdef VDSUSP +#endif /* VDISCARD */ +#ifdef VDSUSP nttyparm.c_ccVDSUSP = _POSIX_DISABLE; -# endif /* VDSUSP */ -# ifdef VWERASE +#endif /* VDSUSP */ +#ifdef VWERASE if(ttyparm.c_ccVWERASE == _POSIX_DISABLE) ep->e_werase = cntl('W'); else ep->e_werase = nttyparm.c_ccVWERASE; nttyparm.c_ccVWERASE = _POSIX_DISABLE; -# else +#else ep->e_werase = cntl('W'); -# endif /* VWERASE */ -# ifdef VLNEXT +#endif /* VWERASE */ +#ifdef VLNEXT if(ttyparm.c_ccVLNEXT == _POSIX_DISABLE ) ep->e_lnext = cntl('V'); else ep->e_lnext = nttyparm.c_ccVLNEXT; nttyparm.c_ccVLNEXT = _POSIX_DISABLE; -# else +#else ep->e_lnext = cntl('V'); -# endif /* VLNEXT */ +#endif /* VLNEXT */ ep->e_intr = ttyparm.c_ccVINTR; ep->e_eof = ttyparm.c_ccVEOF; ep->e_erase = ttyparm.c_ccVERASE; @@ -352,7 +279,6 @@ if( tty_set(fd, TCSADRAIN, &nttyparm) == SYSERR ) return -1; ep->e_ttyspeed = (cfgetospeed(&ttyparm)>=B1200?FAST:SLOW); -#endif ep->e_raw = (echomode?ECHOMODE:RAWMODE); return 0; } @@ -375,7 +301,7 @@ return cols; } -/* E_FLUSH() +/* ED_FLUSH() * * Flush the output buffer. * @@ -614,7 +540,7 @@ static char *oldterm; Namval_t *np = nv_search("TERM",sh.var_tree,0); char *term = NULL; - if(nv_isattr(np,NV_EXPORT)) + if(np && nv_isattr(np,NV_EXPORT)) term = nv_getval(np); if(!term) term = ""; @@ -655,12 +581,12 @@ ep->e_outlast = ep->e_outptr + MAXLINE; return; } - qlen = sfset(sfstderr,SF_READ,0); - /* make sure SF_READ not on */ - ep->e_outbase = ep->e_outptr = (char*)sfreserve(sfstderr,SF_UNBOUND,SF_LOCKR); + qlen = sfset(sfstderr,SFIO_READ,0); + /* make sure SFIO_READ not on */ + ep->e_outbase = ep->e_outptr = (char*)sfreserve(sfstderr,SFIO_UNBOUND,SFIO_LOCKR); ep->e_outlast = ep->e_outptr + sfvalue(sfstderr); if(qlen) - sfset(sfstderr,SF_READ,1); + sfset(sfstderr,SFIO_READ,1); sfwrite(sfstderr,ep->e_outptr,0); ep->e_eol = reedit; if(ep->e_default && (pp = nv_getval(ep->e_default))) @@ -675,11 +601,12 @@ } } -static void ed_putstring(Edit_t *ep, const char *str) +void ed_putstring(Edit_t *ep, const char *str) { int c; - while(c = *str++) - ed_putchar(ep,c); + mbinit(); + while (c = mbchar(str)) + ed_putchar(ep, c < 0 ? '?' : c); } static void ed_nputchar(Edit_t *ep, int n, int c) @@ -785,7 +712,7 @@ } if(rv < 0) { -#ifdef _hdr_utime +#if _hdr_utime # define fixtime() if(isdevtty)utime(ep->e_tty,&utimes) int isdevtty=0; struct stat statb; @@ -929,7 +856,7 @@ */ int ed_getchar(Edit_t *ep,int mode) { - int n, c; + int n = 0, c; char readinLOOKAHEAD+1; if(!ep->e_lookahead) { @@ -946,10 +873,7 @@ if((c = ep->e_lbuf--ep->e_lookahead) < 0) { if(mode<=0 && -c == ep->e_intr) - { killpg(getpgrp(),SIGINT); - siglongjmp(ep->e_env, UINTR); - } if(mode<=0 && sh.st.trapSH_KEYTRAP /* workaround for <https://github.com/ksh93/ksh/issues/307>: * do not trigger KEYBD for non-ASCII in multibyte locale */ @@ -1014,31 +938,20 @@ #endif /* SHOPT_ESH || SHOPT_VSH */ #if SHOPT_ESH || SHOPT_VSH + /* - * put a character into the output buffer + * put a byte into the output buffer */ -void ed_putchar(Edit_t *ep,int c) +#if SHOPT_MULTIBYTE +static void ed_putbyte(Edit_t *ep,int c) +#else +void ed_putchar(Edit_t *ep,int c) +#endif /* SHOPT_MULTIBYTE */ { - char buf8; char *dp = ep->e_outptr; - int i,size=1; if(!dp) return; - buf0 = c; -#if SHOPT_MULTIBYTE - /* check for place holder */ - if(c == MARKER) - return; - if((size = mbconv(buf, (wchar_t)c)) > 1) - { - for (i = 0; i < (size-1); i++) - *dp++ = bufi; - c = bufi; - } - else - buf0 = c; -#endif /* SHOPT_MULTIBYTE */ *dp++ = c; *dp = '\0'; if(dp >= ep->e_outlast) @@ -1046,6 +959,25 @@ else ep->e_outptr = dp; } + +#if SHOPT_MULTIBYTE +/* + * put a character into the output buffer + */ + +void ed_putchar(Edit_t *ep,int c) +{ + char buf8; + int size, i; + /* check for placeholder */ + if(c == MARKER) + return; + size = mbconv(buf, (wchar_t)c); + for (i = 0; i < size; i++) + ed_putbyte(ep,bufi); +} +#endif /* SHOPT_MULTIBYTE */ + #endif /* SHOPT_ESH || SHOPT_VSH */ #if SHOPT_ESH || SHOPT_VSH @@ -1311,7 +1243,7 @@ char bufferMAXLINE*sizeof(genchar) = ""; c = ed_external(src,buffer); -#ifdef _lib_wcscpy +#if _lib_wcscpy wcscpy((wchar_t *)dest,(const wchar_t *)buffer); #else strcopy(dest,buffer); @@ -1374,81 +1306,6 @@ } #endif /* (SHOPT_ESH || SHOPT_VSH) && SHOPT_MULTIBYTE */ -#if SHOPT_OLDTERMIO - -# include <sys/termio.h> - -#ifndef ECHOCTL -# define ECHOCTL 0 -#endif /* !ECHOCTL */ -#define ott ep->e_ott - -/* - * For backward compatibility only - * This version will use termios when possible, otherwise termio - */ - -int tcgetattr(int fd, struct termios *tt) -{ - Edit_t *ep = (Edit_t*)(sh.ed_context); - int r,i; - ep->e_tcgeta = 0; - ep->e_echoctl = (ECHOCTL!=0); - if((r=ioctl(fd,TCGETS,tt))>=0 || errno!=EINVAL) - return r; - if((r=ioctl(fd,TCGETA,&ott)) >= 0) - { - tt->c_lflag = ott.c_lflag; - tt->c_oflag = ott.c_oflag; - tt->c_iflag = ott.c_iflag; - tt->c_cflag = ott.c_cflag; - for(i=0; i<NCC; i++) - tt->c_cci = ott.c_cci; - ep->e_tcgeta++; - ep->e_echoctl = 0; - } - return r; -} - -int tcsetattr(int fd,int mode,struct termios *tt) -{ - Edit_t *ep = (Edit_t*)(sh.ed_context); - int r; - if(ep->e_tcgeta) - { - int i; - ott.c_lflag = tt->c_lflag; - ott.c_oflag = tt->c_oflag; - ott.c_iflag = tt->c_iflag; - ott.c_cflag = tt->c_cflag; - for(i=0; i<NCC; i++) - ott.c_cci = tt->c_cci; - if(tt->c_lflag&ECHOCTL) - { - ott.c_lflag &= ~(ECHOCTL|IEXTEN); - ott.c_iflag &= ~(IGNCR|ICRNL); - ott.c_iflag |= INLCR; - ott.c_ccVEOF= ESC; /* ESC -> eof char */ - ott.c_ccVEOL = '\r'; /* CR -> eol char */ - ott.c_ccVEOL2 = tt->c_ccVEOF; /* EOF -> eol char */ - } - switch(mode) - { - case TCSANOW: - mode = TCSETA; - break; - case TCSADRAIN: - mode = TCSETAW; - break; - case TCSAFLUSH: - mode = TCSETAF; - } - return ioctl(fd,mode,&ott); - } - return ioctl(fd,mode,tt); -} -#endif /* SHOPT_OLDTERMIO */ - /* * Execute keyboard trap on given buffer <inbuff> of given size <isize> * <mode> < 0 for vi insert mode @@ -1720,6 +1577,10 @@ return ed; } +/* + * ioctl, tcgetattr and tcsetattr are mapped to these versions in terminal.h + */ + #undef ioctl int sh_ioctl(int fd, int cmd, void* val, int sz) { @@ -1746,22 +1607,20 @@ return r; } -#ifdef _lib_tcgetattr -# undef tcgetattr +#undef tcgetattr int sh_tcgetattr(int fd, struct termios *tty) - { +{ int r,err = errno; while((r=tcgetattr(fd,tty)) < 0 && errno==EINTR) errno = err; return r; - } +} -# undef tcsetattr +#undef tcsetattr int sh_tcsetattr(int fd, int cmd, struct termios *tty) - { +{ int r,err = errno; while((r=tcsetattr(fd,cmd,tty)) < 0 && errno==EINTR) errno = err; return r; - } -#endif +}
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/edit/emacs.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/edit/emacs.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -171,7 +171,6 @@ static void draw(Emacs_t*,Draw_t); static int escape(Emacs_t*,genchar*, int); -static void putstring(Emacs_t*,char*); static void search(Emacs_t*,genchar*,int); static void setcursor(Emacs_t*,int, int); static void show_info(Emacs_t*,const char*); @@ -599,7 +598,7 @@ if (ep->terminal == PAPER) { putchar(ep->ed,'\n'); - putstring(ep,Prompt); + ed_putstring(ep->ed,Prompt); } c = ed_getchar(ep->ed,0); if (c != usrkill) @@ -613,7 +612,7 @@ { ep->terminal = PAPER; putchar(ep->ed,'\n'); - putstring(ep,Prompt); + ed_putstring(ep->ed,Prompt); } } continue; @@ -659,9 +658,7 @@ { hline = hismin+1; beep(); -#ifndef ESH_NFIRST continue; -#endif } goto common; @@ -784,14 +781,6 @@ draw(ep,UPDATE); } -static void putstring(Emacs_t* ep,char *sp) -{ - int c; - while (c= *sp++) - putchar(ep->ed,c); -} - - static int escape(Emacs_t* ep,genchar *out,int count) { int i,value; @@ -1348,7 +1337,7 @@ } return; -# define itos(i) fmtbase((intmax_t)(i),0,0) /* want signed conversion */ +# define itos(i) fmtint(i,0) /* want signed conversion */ case cntl('H'): /* ^X^H show history info */ { @@ -1547,10 +1536,10 @@ #define BOTH '*' #define UPPER '>' - genchar *sptr; /* Pointer within screen */ + genchar *sptr; /* Pointer within screen */ genchar nscreen2*MAXLINE; /* New entire screen */ genchar *ncursor; /* New cursor */ - genchar *nptr; /* Pointer to New screen */ + genchar *nptr; /* Pointer to New screen */ char longline; /* Line overflow */ genchar *logcursor; genchar *nscend; /* end of logical screen */ @@ -1574,7 +1563,7 @@ return; } *ep->cursor = '\0'; - putstring(ep,Prompt); /* start with prompt */ + ed_putstring(ep->ed,Prompt); /* start with prompt */ } /*********************
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/edit/history.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/edit/history.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2014 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -15,6 +15,7 @@ * Johnothan King <johnothanking@protonmail.com> * * hyenias <58673227+hyenias@users.noreply.github.com> * * Govind Kamat <govind_kamat@yahoo.com> * +* Vincent Mihalkovic <vmihalko@redhat.com> * * * ***********************************************************************/ /* @@ -275,7 +276,7 @@ sh.hist_ptr = hist_ptr = hp; hp->histsize = maxlines; hp->histmask = histmask; - hp->histfp= sfnew(NULL,hp->histbuff,HIST_BSIZE,fd,SF_READ|SF_WRITE|SF_APPENDWR|SF_SHARE); + hp->histfp= sfnew(NULL,hp->histbuff,HIST_BSIZE,fd,SFIO_READ|SFIO_WRITE|SFIO_APPENDWR|SFIO_SHARE); memset((char*)hp->histcmds,0,sizeof(off_t)*(hp->histmask+1)); hp->histind = 1; hp->histcmds1 = 2; @@ -337,7 +338,7 @@ #endif /* SHOPT_ACCTFILE */ #if SHOPT_AUDIT { - char buffSF_BUFSIZE; + char buffSFIO_BUFSIZE; hp->auditfp = 0; if(sh_isstate(SH_INTERACTIVE) && (hp->auditmask=sh_checkaudit(hp,SHOPT_AUDITFILE, buff, sizeof(buff)))) { @@ -353,8 +354,9 @@ if(fd>=0) { fcntl(fd,F_SETFD,FD_CLOEXEC); - hp->tty = sh_strdup(isatty(2)?ttyname(2):"notty"); - hp->auditfp = sfnew(NULL,NULL,-1,fd,SF_WRITE); + const char* tty = ttyname(2); + hp->tty = sh_strdup(tty?tty:"notty"); + hp->auditfp = sfnew(NULL,NULL,-1,fd,SFIO_WRITE); } } } @@ -376,7 +378,7 @@ sfclose(hp->auditfp); } #endif /* SHOPT_AUDIT */ - free((char*)hp); + free(hp); hist_ptr = 0; sh.hist_ptr = 0; #if SHOPT_ACCTFILE @@ -460,7 +462,7 @@ if(newp <=oldp) break; } - if(!(buff=(char*)sfreserve(hist_old->histfp,SF_UNBOUND,0))) + if(!(buff=(char*)sfreserve(hist_old->histfp,SFIO_UNBOUND,0))) break; *(endbuff=(cp=buff)+sfvalue(hist_old->histfp)) = 0; /* copy to null byte */ @@ -478,7 +480,7 @@ } hist_cancel(hist_new); sfclose(hist_old->histfp); - free((char*)hist_old); + free(hist_old); return hist_ptr = hist_new; } @@ -494,7 +496,7 @@ goto begin; /* skip to marker command and return the number */ /* numbering commands occur after a null and begin with HIST_CMDNO */ - while(cp=buff=(unsigned char*)sfreserve(iop,SF_UNBOUND,SF_LOCKR)) + while(cp=buff=(unsigned char*)sfreserve(iop,SFIO_UNBOUND,SFIO_LOCKR)) { n = sfvalue(iop); *(endbuff=cp+n) = 0; @@ -556,7 +558,7 @@ char *cp,*first,*endbuff; int incmd = 0; off_t count = hp->histcnt; - int oldind,n,skip=0; + int oldind=0,n,skip=0; off_t last = sfseek(hp->histfp,0,SEEK_END); if(last < count) { @@ -568,7 +570,7 @@ } again: sfseek(hp->histfp,count,SEEK_SET); - while(cp=(char*)sfreserve(hp->histfp,SF_UNBOUND,0)) + while(cp=(char*)sfreserve(hp->histfp,SFIO_UNBOUND,0)) { n = sfvalue(hp->histfp); *(endbuff = cp+n) = 0; @@ -685,7 +687,7 @@ char *buff; if(hp) { - if(buff=(char*)sfreserve(hp->histfp,0,SF_LOCKR)) + if(buff=(char*)sfreserve(hp->histfp,0,SFIO_LOCKR)) { hp->histflush = sfvalue(hp->histfp)+1; sfwrite(hp->histfp,buff,0); @@ -1102,7 +1104,7 @@ int newfd,oldfd; History_t *hp = (History_t*)handle; NOT_USED(data); - if(type==SF_WRITE) + if(type==SFIO_WRITE) { if(errno==ENOSPC || hp->histwfail++ >= 10) return 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/edit/vi.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/edit/vi.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -181,8 +181,6 @@ static void getline(Vi_t*,int); static int getrchar(Vi_t*); static int mvcursor(Vi_t*,int); -static void pr_string(Vi_t*,const char*); -static void putstring(Vi_t*,int, int); static void refresh(Vi_t*,int); static void replace(Vi_t*,int, int); static void restore_v(Vi_t*); @@ -205,17 +203,14 @@ int ed_viread(void *context, int fd, char *shbuf, int nchar, int reedit) { Edit_t *ed = (Edit_t*)context; - int i; /* general variable */ - int term_char=0; /* read() termination character */ + int i; /* general variable */ Vi_t *vp = ed->e_vi; char promptPRSIZE+2; /* prompt */ genchar Physical2*MAXLINE; /* physical image */ - genchar UbufMAXLINE; /* used for U command */ - genchar ubufMAXLINE; /* used for u command */ + genchar UbufMAXLINE; /* used for U command */ + genchar ubufMAXLINE; /* used for u command */ genchar WindowMAXLINE; /* window image */ int Globals9; /* local global variables */ - int esc_or_hang=0; /* <ESC> or hangup */ - char cntl_char=0; /* TRUE if control character present */ if(!vp) { ed->e_vi = vp = sh_newof(0,Vi_t,1,0); @@ -1692,34 +1687,6 @@ return 1; } -/* - * print a string - */ - -static void pr_string(Vi_t *vp, const char *sp) -{ - /*** copy string sp ***/ - char *ptr = editb.e_outptr; - while(*sp) - *ptr++ = *sp++; - editb.e_outptr = ptr; - return; -} - -/*{ PUTSTRING( column, nchars ) - * - * Put nchars starting at column of physical into the workspace - * to be printed. - * -}*/ - -static void putstring(Vi_t *vp,int col, int nchars) -{ - while( nchars-- ) - putchar(physicalcol++); - return; -} - /*{ VI_REDRAW( ) * * Print the prompt and force a total refresh. @@ -1732,7 +1699,7 @@ void vi_redraw(void *ep) { Vi_t *vp = (Vi_t*)ep; - pr_string(vp,Prompt); + ed_putstring(vp->ed,Prompt); window0 = '\0'; cur_phys = vp->first_wind; vp->ofirst_wind = INVALID; @@ -2661,7 +2628,7 @@ #if SHOPT_MULTIBYTE static int _isalph(int v) { -#ifdef _lib_iswalnum +#if _lib_iswalnum return iswalnum(v) || v=='_'; #else return (v&~STRIP) || isalnum(v) || v=='_';
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/externs -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/features/externs
Changed
@@ -1,9 +1,12 @@ -hdr nc,exec_attr +hdr nc mem exception.name,_exception.name math.h -lib setreuid,setregid,nice,fork,spawnveg,fchdir -lib pathnative,pathposix,fts_notify +lib setreuid,setregid,nice,fork,fchdir +lib pathnative,pathposix lib memcntl sys/mman.h -lib getexecuser,free_execattr exec_attr.h -lsecdb + +# for main.c fixargs(): +lib,sys pstat +lib setproctitle reference unistd.h @@ -80,7 +83,7 @@ int bytec; error_info.id="_arg_extrabytes test (child)"; - argv = (char **)stkalloc(stkstd, (argmax / 2 + 1) * sizeof(char*)); + argv = stkalloc(stkstd, (argmax / 2 + 1) * sizeof(char*)); argc = bytec = 0; while(bytec < argmax) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/math.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/features/math.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2013 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -122,7 +122,9 @@ eval `iffe $iffeflags -c "$cc" - num $nums $iffehdrs $iffelibs 2>&$stderr` cat <<! +#if __clang__ #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif /* : : generated by $command from $table : : */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/options -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/features/options
Changed
@@ -15,3 +15,6 @@ return !r; } }end + +# for SHOPT_ACCT: +sys acct
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/poll -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/features/poll
Changed
@@ -7,7 +7,7 @@ typ socklen_t unistd.h sys/socket.h = unsigned int tst pipe_socketpair note{ use socketpair() for peekable pipe() }end execute{ #include <ast.h> - #include <signal.h> + #include <sig.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/wait.h> @@ -123,31 +123,21 @@ } }end cat{ - #ifdef _lib_poll - # define poll _SYS_poll - #else - # undef _hdr_poll - # undef _sys_poll - #endif /* _lib_poll */ - #ifdef _hdr_poll + #if _hdr_poll # include <poll.h> #else - # ifdef _sys_poll + # if _sys_poll # include <sys/poll.h> # endif /* _sys_poll */ #endif /* _hdr_poll */ - #ifdef _lib_poll - # undef poll - extern int poll(struct pollfd*,unsigned long,int); - #endif /* _lib_poll */ - #ifdef _lib_select + #if _lib_select # ifndef FD_ZERO # define FD_ZERO(x) (*(x)=0) # endif /* FD_ZERO */ # ifndef FD_SET # define FD_SET(n,x) (*(x)|=(1L<<(n))) # endif /* FD_SET */ - # ifndef _typ_fd_set + # if !_typ_fd_set typedef long fd_set; # endif /* _typ_fd_set */ #endif /* _lib_select */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/features/sigfeatures -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/features/sigfeatures
Changed
@@ -2,10 +2,10 @@ typ sigset_t ast.h signal.h mem sigvec.sv_mask signal.h cat{ - #ifndef _mem_sigvec_sv_mask + #if !_mem_sigvec_sv_mask # undef _lib_sigvec #endif - #ifdef _lib_sigprocmask + #if _lib_sigprocmask # define sh_sigaction(s,action) do { sigset_t ss;\ sigemptyset(&ss); \ if(s) sigaddset(&ss,(s)); \ @@ -15,14 +15,14 @@ # define sigblock(s) sh_sigaction(s,SIG_BLOCK) # define sig_begin() sh_sigaction(0,SIG_SETMASK) #else - # ifndef _lib_sigblock + # if !_lib_sigblock # define sigblock(s) # endif - # ifdef _lib_sigsetmask + # if _lib_sigsetmask # define sigrelease(s) sigsetmask(0) # define sig_begin() sigsetmask(0) # else - # ifdef _lib_sigrelse + # if _lib_sigrelse # define sigrelease sigrelse # define sig_begin() # else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/fun/autocd -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/fun/autocd
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2021-2023 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -36,7 +35,7 @@ then eval "set -- $1" fi # if the result is one word and it's not a command, then autocd - if (($#==1)) && ! command -v "$1" >/dev/null && -d $1 + if (($#==1)) && ! whence -q "$1" && -d $1 then printf 'cd -- %q\n' "$1" >&2 CDPATH= cd -- "$1" return 2 # status 2 == do not execute original command
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/fun/man -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/fun/man
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2021-2023 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -24,6 +23,9 @@ # to your regular 'man' command so you won't notice a difference. Result: you # can just use 'man somecommand' for everything. # +# If you want to pass extra options to your operating system's "man" command, +# put those in the .sh.manopts variable. +# # This function only handles 'man' commands with a single argument. If more # or less than one argument is given, it passes control to the system's 'man'. # @@ -59,10 +61,10 @@ builtin_has_selfdoc() { - $(unset -f -- "$1" 2>/dev/null; whence -t -- "$1") == builtin \ + $(unset -f -- "$1"; whence -t -- "$1") == builtin \ && ! $1 =~ ^(:|true|false|echo)$ \ && $'\n'$(builtin)$'\n' == *$'\n'"$(unset -f -- "$1"; whence -- "$1")"$'\n'* - } + } 2>/dev/null # Check if a binary or script has --man self-documentation by grepping # for an AST optget(3) usage string. @@ -86,8 +88,17 @@ show_selfdoc() { - typeset -x ERROR_OPTIONS=emphasis - export LINES COLUMNS + typeset -x COLUMNS=$COLUMNS # export in local scope + if ((stdout_on_terminal)); then + # enable emphasis only for pagers that support ANSI escapes + typeset pager=${PAGER:-less} + case ${pager##*/} in + less | less:blank:* | most | most:blank:* ) + typeset -x ERROR_OPTIONS=emphasis ;; + esac + else + COLUMNS=80 + fi case $1 in test ) command test '--??man' -- ;; ) command '--??man' -- ;; @@ -102,9 +113,21 @@ pager() { - typeset IFS # local default split... - set -o noglob # ...and no pathname expansion... - ${PAGER:-less -R} # ...so we can safely split $PAGER + typeset pager=${MANPAGER:-${PAGER-}} + ((!stdout_on_terminal)) && pager=cat + case $pager in + '') pager="less $lessopt" ;; + less | */less | less:blank:* | */less:blank:*) + pager+=" $lessopt" ;; + esac + command -- $pager + } + + # Shorthand for invoking the OS man(1) command on the default system PATH. + + os_man() + { + command -p man ${.sh.manopts-} "$@" } # Try if a system manual page in a section exists. Unfortunately, we @@ -115,7 +138,7 @@ try_os_man() { - $2 != */* && $(command man -s "$1" "$2" 2>/dev/null) == *$'\n'*$'\n'*$'\n'* + $2 != */* && $(os_man -s "$1" "$2" 2>/dev/null) == *$'\n'*$'\n'*$'\n'* } # The main function puts it all together. When given a single argument, @@ -128,18 +151,18 @@ main() { - if (($# != 1)); then - command man "$@" + if (($# != 1)) || $1 == -* ; then + os_man "$@" elif builtin_has_selfdoc "$1"; then show_selfdoc "$1" | pager elif try_os_man 1 "$1"; then - command man -s 1 "$1" + os_man -s 1 "$1" elif try_os_man 8 "$1"; then - command man -s 8 "$1" + os_man -s 8 "$1" elif extcmd_has_selfdoc "$1"; then show_selfdoc "$1" | pager else - command man "$1" + os_man "$1" fi } } @@ -160,6 +183,13 @@ function man { + typeset IFS # local default split... + set -o noglob # ...and no pathname expansion, for safe field splitting + # set stdout_on_terminal to 1 if standard output is on a terminal; + # this needs flagging now as show_selfdoc() will have stdout on a pipe + -t 1 + typeset -si stdout_on_terminal=$((! $?)) + # and off we go .man.main "$@" } @@ -171,3 +201,38 @@ print "WARNING: this man wrapper function requires ksh 93u+m 2021-12-27 or later" >&2 sleep 1 fi + +# Check if 'less' has an -R option. Some versions have only -r. +# In the man namespace functions above, ${.man.lessopt} is simply $lessopt. +if echo test | less -R >/dev/null 2>&1; then + .man.lessopt=-R +else + .man.lessopt=-r +fi + +# Check for QNX, which uses 'use' instead of 'man'. +# Override .man.main function with QNX version. +# Instead of .sh.manotps, 'use' options may be set in .sh.useopts. + +if command -pv use >/dev/null && $(command -p uname -s) == QNX +then namespace man + { + unset -f os_man try_os_man + os_use() + { + command -p use ${.sh.useopts-} "$@" + } + main() + { + if (($# != 1)) || $1 == -* ; then + os_use "$@" + elif builtin_has_selfdoc "$1" || extcmd_has_selfdoc "$1"; then + show_selfdoc "$1" | pager + elif os_use "$1" >/dev/null 2>&1; then + os_use "$1" | pager + else + os_use "$1" # show error without pager + fi + } + } +fi
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/argnod.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/argnod.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -38,7 +38,11 @@ { int comtyp; struct ionod *comio; - struct argnod *comarg; + union + { + struct argnod *ap; /* use if (comtyp&COMSCAN) */ + struct dolnod *dp; /* use if (!(comtyp&COMSCAN)) */ + } comarg; struct argnod *comset; void *comnamp; void *comnamq; @@ -70,7 +74,7 @@ int dolmax; /* size of dolval array */ int dolnum; /* number of elements */ int dolbot; /* current first element */ - struct dolnod *dolnxt; /* used when list are chained */ + struct dolnod *dolnxt; /* used when lists are chained */ char *dolval1; /* array of value pointers */ }; @@ -117,7 +121,11 @@ #define ARG_ARRAY 0x2 /* for typeset -a */ /* The following can be passed as options to sh_macexpand() */ #define ARG_ARITH 0x100 /* arithmetic expansion */ +#if SHOPT_OPTIMIZE #define ARG_OPTIMIZE 0x200 /* try to optimize */ +#else +#define ARG_OPTIMIZE 0 +#endif /* SHOPT_OPTIMIZE */ #define ARG_NOGLOB 0x400 /* no file name expansion */ #define ARG_ARRAYOK 0x1000 /* $xsub ==> ${xsub} */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/builtins.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/builtins.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -96,7 +96,7 @@ extern int b_read(int, char*,Shbltin_t*); extern int b_ulimit(int, char*,Shbltin_t*); extern int b_umask(int, char*,Shbltin_t*); -#ifdef _cmd_universe +#if _cmd_universe extern int b_universe(int, char*,Shbltin_t*); #endif /* _cmd_universe */ extern int b_wait(int, char*,Shbltin_t*); @@ -123,6 +123,7 @@ extern const char e_nosupport; extern const char e_limit; extern const char e_overlimit; +extern const char e_internal; extern const char e_eneedsarg; extern const char e_oneoperand; @@ -130,7 +131,7 @@ extern const char e_toodeep; extern const char e_badname; extern const char e_badsyntax; -#ifdef _cmd_universe +#if _cmd_universe extern const char e_nouniverse; #endif /* _cmd_universe */ extern const char e_histopen; @@ -190,7 +191,7 @@ extern const char sh_optumask; extern const char sh_optunalias; extern const char sh_optwait; -#ifdef _cmd_universe +#if _cmd_universe extern const char sh_optuniverse; #endif /* _cmd_universe */ extern const char sh_optunset;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/defs.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/defs.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -115,7 +115,6 @@ extern void sh_chktrap(void); extern int sh_debug(const char*,const char*,const char*,char *const,int); extern char **sh_envgen(void); -extern void sh_envnolocal(Namval_t*,void*); extern Sfdouble_t sh_arith(const char*); extern void *sh_arithcomp(char*); extern pid_t sh_fork(int,int*); @@ -132,7 +131,7 @@ extern char *sh_mactry(char*); extern int sh_mathstd(const char*); extern void sh_printopts(Shopt_t,int,Shopt_t*); -extern int sh_readline(char**,volatile int,int,ssize_t,long); +extern int sh_readline(char**,volatile int,int,ssize_t,Sflong_t); extern Sfio_t *sh_sfeval(char*); extern void sh_setmatch(const char*,int,int,int,int); extern void sh_scope(struct argnod*, int);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/edit.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/edit.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -109,16 +109,11 @@ int e_fd; /* file descriptor */ int e_ttyspeed; /* line speed, also indicates tty parameters are valid */ int e_tabcount; -#ifdef _hdr_utime +#if _hdr_utime ino_t e_tty_ino; dev_t e_tty_dev; char *e_tty; #endif -#if SHOPT_OLDTERMIO - char e_echoctl; - char e_tcgeta; - struct termio e_ott; -#endif int *e_globals; /* global variables */ genchar *e_window; /* display window image */ char e_inmacro; /* processing macro expansion */ @@ -179,6 +174,7 @@ #define TCAP_ERASE_EOS "cd" extern void ed_putchar(Edit_t*, int); +extern void ed_putstring(Edit_t*, const char*); extern void ed_ringbell(void); extern void ed_setup(Edit_t*,int, int); extern void ed_flush(Edit_t*); @@ -191,7 +187,9 @@ extern int ed_emacsread(void*, int, char*, int, int); extern Edpos_t ed_curpos(Edit_t*, genchar*, int, int, Edpos_t); extern int ed_setcursor(Edit_t*, genchar*, int, int, int); +#if SHOPT_ESH || SHOPT_VSH extern int ed_macro(Edit_t*,int); +#endif extern int ed_expand(Edit_t*, char,int*,int*,int,int); extern int ed_fulledit(Edit_t*); extern void *ed_open(void);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/io.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/io.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -25,7 +25,7 @@ #include <sfio.h> #ifndef IOBSIZE -# define IOBSIZE (SF_BUFSIZE*sizeof(char*)) +# define IOBSIZE (SFIO_BUFSIZE*sizeof(char*)) #endif /* IOBSIZE */ #define IOMAXTRY 20
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/lexstates.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/lexstates.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -115,14 +115,14 @@ # define mbwide() (0) # define LEN 1 # define SETLEN(x) (x) -# define isaname(c) ((c) < 0 ? 0 : sh_lexstatesST_NAMEc == 0) -# define isaletter(c) ((c) < 0 ? 0 : (sh_lexstatesST_DOLc == S_ALP && (c) != '.')) +# define isaname(c) (((c) < 0 || (c) > 255) ? 0 : sh_lexstatesST_NAMEc == 0) +# define isaletter(c) (((c) < 0 || (c) > 255) ? 0 : (sh_lexstatesST_DOLc == S_ALP && (c) != '.')) #endif #define STATE(s,c) (smbwide() ? ((c = fcmbget(&LEN)), LEN > 1 ? 'a' : c) : (c = fcget())) -#define isadigit(c) ((c) < 0 ? 0 : sh_lexstatesST_DOLc == S_DIG) +#define isadigit(c) (((c) < 0 || (c) > 255) ? 0 : sh_lexstatesST_DOLc == S_DIG) #define isastchar(c) ((c) == '@' || (c) == '*') -#define isexp(c) ((c) < 0 ? 0 : (sh_lexstatesST_MACROc == S_PAT || (c) == '$' || (c) == '`')) -#define ismeta(c) ((c) < 0 ? 0 : sh_lexstatesST_NAMEc == S_BREAK) +#define isexp(c) (((c) < 0 || (c) > 255) ? 0 : (sh_lexstatesST_MACROc == S_PAT || (c) == '$' || (c) == '`')) +#define ismeta(c) (((c) < 0 || (c) > 255) ? 0 : sh_lexstatesST_NAMEc == S_BREAK) extern char *sh_lexstatesST_NONE; extern const char *sh_lexrstatesST_NONE;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/name.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/name.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,7 +24,7 @@ #define _NV_PRIVATE \ Namfun_t *nvfun; /* pointer to trap functions */ \ union Value nvalue; /* value field */ \ - char *nvenv; /* pointer to environment name */ + void *nvmeta; /* pointer to any of various kinds of type-dependent data */ #include <ast.h> #include <cdt.h> @@ -116,7 +116,7 @@ /* attributes of Namval_t items */ /* The following attributes are for internal use */ -#define NV_NOCHANGE (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE|NV_ARRAY) +#define NV_NOCHANGE (NV_EXPORT|NV_MINIMAL|NV_RDONLY|NV_TAGGED|NV_NOFREE|NV_ARRAY) #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 */ @@ -130,7 +130,7 @@ #define NV_STATICF NV_INTEGER /* static class function */ #define NV_NOPRINT (NV_LTOU|NV_UTOL) /* do not print */ -#define NV_NOALIAS (NV_NOPRINT|NV_IMPORT) +#define NV_NOALIAS (NV_NOPRINT|NV_MINIMAL) #define NV_NOEXPAND NV_RJUST /* do not expand alias */ #define NV_BLTIN (NV_NOPRINT|NV_EXPORT) #define BLT_ENV (NV_RDONLY) /* non-stoppable, @@ -138,7 +138,7 @@ #define BLT_SPC (NV_LJUST) /* special built-ins */ #define BLT_EXIT (NV_RJUST) /* exit value can be > 255 or < 0 */ #define BLT_DCL (NV_TAGGED) /* declaration command */ -#define BLT_NOSFIO (NV_IMPORT) /* doesn't use sfio */ +#define BLT_NOSFIO (NV_MINIMAL) /* 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 is_abuiltin(n) (nv_isattr(n,NV_BLTIN|NV_INTEGER)==NV_BLTIN) @@ -187,6 +187,13 @@ #if SHOPT_OPTIMIZE extern void nv_optimize(Namval_t*); extern void nv_optimize_clear(Namval_t*); +# define nv_setoptimize(v) (sh.argaddr=(v)) +# define nv_getoptimize() (sh.argaddr) +#else +# define nv_optimize(np) /* no-op */ +# define nv_optimize_clear(np) /* no-op */ +# define nv_setoptimize(argaddr) /* no-op */ +# define nv_getoptimize() NULL #endif /* SHOPT_OPTIMIZE */ extern void nv_outname(Sfio_t*,char*, int); extern void nv_unref(Namval_t*);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/nval.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/nval.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -137,8 +137,12 @@ #define NV_ARRAY 0x400 /* node is an array */ #define NV_REF 0x4000 /* reference bit */ #define NV_TABLE 0x800 /* node is a dictionary table */ -#define NV_IMPORT 0x1000 /* value imported from environment */ -#define NV_MINIMAL NV_IMPORT /* node does not contain all fields */ +#define NV_MINIMAL 0x1000 /* node does not contain all fields */ +#if SHOPT_OPTIMIZE +#define NV_NOOPTIMIZE NV_TABLE /* disable loop invariants optimizer */ +#else +#define NV_NOOPTIMIZE 0 +#endif #define NV_INTEGER 0x2 /* integer attribute */ /* The following attributes are valid only when NV_INTEGER is off */ @@ -196,12 +200,15 @@ #define NV_UINT16P (NV_LJUST|NV_UNSIGN|NV_SHORT|NV_INTEGER) #define NV_UINT16 (NV_UNSIGN|NV_SHORT|NV_INTEGER) #define NV_INT32 (NV_INTEGER) -#define NV_UNT32 (NV_UNSIGN|NV_INTEGER) +#define NV_UINT32 (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) #define NV_LDOUBLE (NV_LONG|NV_DOUBLE) +/* check/isolate all the bit flags used for numeric types */ +#define nv_isnum(np) (nv_isattr(np,NV_INTEGER)?nv_isattr(np,NV_DOUBLE|NV_INTEGER|NV_LJUST|NV_LONG|NV_SHORT|NV_UNSIGN):0) + /* name-value pair macros */ #define nv_isattr(np,f) ((np)->nvflag & (f)) #define nv_onattr(n,f) ((n)->nvflag |= (f))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/path.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/path.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -118,15 +118,10 @@ extern const char e_autoloadfrom; #if SHOPT_ACCT -# include "FEATURE/acct" -# ifdef _sys_acct extern void sh_accinit(void); extern void sh_accbegin(const char*); extern void sh_accend(void); extern void sh_accsusp(void); -# else -# undef SHOPT_ACCT -# endif /* _sys_acct */ #endif /* SHOPT_ACCT */ #endif /*! PATH_OFFSET */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/shell.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/shell.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -82,6 +82,7 @@ #define SH_COMPLETE 19 /* set for command completion */ #define SH_XARG 21 /* set while in xarg (command -x) mode */ #define SH_NOTILDEXP 22 /* set to disable tilde expansion */ +#define SH_EXEC 23 /* set while in exec(1) */ /* * Shell options (set -o). Used with sh_isoption(), sh_onoption(), sh_offoption(). @@ -298,7 +299,6 @@ char *comdiv; /* points to sh -c argument */ char *prefix; /* prefix for compound assignment */ sigjmp_buf *jmplist; /* longjmp return stack */ - int oldexit; /* saves pre-trap exit status for 'exit' default in trap actions */ pid_t bckpid; /* background process id */ pid_t cpid; pid_t spid; /* subshell process id */ @@ -308,6 +308,7 @@ int savesig; unsigned char *sigflag; /* pointer to signal states */ char intrap; /* set while executing a trap action */ + char intrap_exit_n; /* set if 'exit n' within trap */ char forked; char binscript; char funload; @@ -341,7 +342,8 @@ int xargmin; int xargmax; int xargexit; - int nenv; + int save_env_n; /* number of saved pointers to environment variables with invalid names */ + char **save_env; /* saved pointers to environment variables with invalid names */ mode_t mask; void *init_context; void *mac_context; @@ -349,9 +351,7 @@ void *arg_context; void *pathlist; void *cdpathlist; - char **argaddr; char cond_expan; /* set while processing ${var=val}, ${var:=val}, ${var?err}, ${var:?err} */ - void *optlist; struct sh_scoped global; struct checkpt checkbase; Shinit_f userinit; @@ -383,6 +383,10 @@ /* nv_putsub() hack for nv_create() to avoid double arithmetic evaluation */ char nv_putsub_already_called_sh_arith; int nv_putsub_idx; /* saves array index obtained by nv_putsub() using sh_arith() */ +#if SHOPT_OPTIMIZE + char **argaddr; /* pointer to arguments for the loop invariants optimizer */ + void *optlist; /* linked list of invariant nodes */ +#endif #if SHOPT_FILESCAN char *cur_line; #endif /* SHOPT_FILESCAN */ @@ -423,7 +427,7 @@ extern void sh_subfork(void); extern Shell_t *sh_init(int,char*,Shinit_f); -extern int sh_reinit(char*); +extern void sh_reinit(void); extern int sh_eval(Sfio_t*,int); extern void sh_delay(double,int); extern void *sh_parse(Sfio_t*,int);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/shlex.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/shlex.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -79,6 +79,7 @@ int digits; /* numerical value with word token */ char aliasok; /* on when alias is legal */ char assignok; /* on when name=value is legal */ + int varnamelength; /* length of variable name in assignment */ char inexec; /* on when processing exec */ char intypeset; /* 1 when processing typeset, 2 when processing enum */ char comp_assign; /* in compound assignment */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/shnodes.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/shnodes.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -46,7 +46,6 @@ #define TTEST (010<<COMBITS) #define TPAREN (TBINARY|TUNARY) #define TSHIFT (COMBITS+4) -#define TNSPACE (TFUN|COMSCAN) #define TCOM 0 #define TPAR 1 @@ -66,6 +65,9 @@ #define TTIME 13 #define TSETIO 14 #define TFUN 15 +#if SHOPT_NAMESPACE +#define TNSPACE (TFUN|COMSCAN) +#endif /* this node is a proforma for those that follow */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/terminal.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/terminal.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -20,167 +20,11 @@ #ifndef _terminal_ #define _terminal_ 1 -#include "FEATURE/ttys" /* * terminal interface - * complicated by the fact that there are so many variations - * This will use POSIX <termios.h> interface where available */ -#ifdef _hdr_termios -# include <termios.h> -# if __sgi__ || sgi /* special hack to eliminate ^M problem */ -# ifndef ECHOCTL -# define ECHOCTL ECHOE -# endif /* ECHOCTL */ -# ifndef CNSUSP -# define CNSUSP CNSWTCH -# endif /* CNSUSP */ -# endif /* sgi */ -# ifdef _NEXT_SOURCE -# define _lib_tcgetattr 1 -# define _lib_tcgetpgrp 1 -# endif /* _NEXT_SOURCE */ -#else -# if defined(_sys_termios) && defined(_lib_tcgetattr) -# include <sys/termios.h> -# define _hdr_termios -# else -# undef _sys_termios -# endif /* _sys_termios */ -#endif /* _hdr_termios */ - -#ifdef _hdr_termios -# undef _hdr_sgtty -# undef tcgetattr -# undef tcsetattr -# undef tcgetpgrp -# undef tcsetpgrp -# undef cfgetospeed -# ifndef TCSANOW -# define TCSANOW TCSETS -# define TCSADRAIN TCSETSW -# define TCSAFLUSH TCSETSF -# endif /* TCSANOW */ - /* The following corrects bugs in some implementations */ -# if defined(TCSADFLUSH) && !defined(TCSAFLUSH) -# define TCSAFLUSH TCSADFLUSH -# endif /* TCSADFLUSH */ -# ifndef _lib_tcgetattr -# undef tcgetattr -# define tcgetattr(fd,tty) ioctl(fd, TCGETS, tty) -# undef tcsetattr -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) -# undef cfgetospeed -# define cfgetospeed(tp) ((tp)->c_cflag & CBAUD) -# endif /* _lib_tcgetattr */ -# undef TIOCGETC -# if SHOPT_OLDTERMIO /* use both termios and termio */ -# ifdef _hdr_termio -# include <termio.h> -# else -# ifdef _sys_termio -# include <sys/termio.h> -# define _hdr_termio 1 -# else -# undef SHOPT_OLDTERMIO -# endif /* _sys_termio */ -# endif /* _hdr_termio */ -# endif /* SHOPT_OLDTERMIO */ -#else -# define cfgetospeed(tp) ((tp)->c_cflag & CBAUD) -# undef SHOPT_OLDTERMIO -# ifdef _hdr_termio -# include <termio.h> -# else -# ifdef _sys_termio -# include <sys/termio.h> -# define _hdr_termio 1 -# endif /* _sys_termio */ -# endif /* _hdr_termio */ -# ifdef _hdr_termio -# define termios termio -# undef TIOCGETC -# define tcgetattr(fd,tty) ioctl(fd, TCGETA, tty) -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) - -# ifdef _sys_bsdtty -# include <sys/bsdtty.h> -# endif /* _sys_bsdtty */ -# else -# ifdef _hdr_sgtty -# include <sgtty.h> -# ifndef LPENDIN -# ifdef _sys_nttyio -# include <sys/nttyio.h> -# endif /* _sys_nttyio */ -# endif /* LPENDIN */ -# define termios sgttyb -# ifdef TIOCSETN -# undef TCSETAW -# endif /* TIOCSETN */ -# ifdef TIOCGETP -# define tcgetattr(fd,tty) ioctl(fd, TIOCGETP, tty) -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) -# else -# define tcgetattr(fd,tty) gtty(fd, tty) -# define tcsetattr(fd,action,tty) stty(fd, tty) -# endif /* TIOCGETP */ -# endif /* _hdr_sgtty */ -# endif /* hdr_termio */ - -# ifndef TCSANOW -# ifdef TCSETAW -# define TCSANOW TCSETA -# ifdef u370 - /* delays are too long, don't wait for output to drain */ -# define TCSADRAIN TCSETA -# else -# define TCSADRAIN TCSETAW -# endif /* u370 */ -# define TCSAFLUSH TCSETAF -# else -# ifdef TIOCSETN -# define TCSANOW TIOCSETN -# define TCSADRAIN TIOCSETN -# define TCSAFLUSH TIOCSETP -# endif /* TIOCSETN */ -# endif /* TCSETAW */ -# endif /* TCSANOW */ -#endif /* _hdr_termios */ - -/* set ECHOCTL if driver can echo control characters as ^c */ -#ifdef LCTLECH -# ifndef ECHOCTL -# define ECHOCTL LCTLECH -# endif /* !ECHOCTL */ -#endif /* LCTLECH */ -#ifdef LNEW_CTLECH -# ifndef ECHOCTL -# define ECHOCTL LNEW_CTLECH -# endif /* !ECHOCTL */ -#endif /* LNEW_CTLECH */ -#ifdef LNEW_PENDIN -# ifndef PENDIN -# define PENDIN LNEW_PENDIN -# endif /* !PENDIN */ -#endif /* LNEW_PENDIN */ - -#ifdef _sys_filio -# ifndef FIONREAD -# include <sys/filio.h> -# endif /* FIONREAD */ -#endif /* _sys_filio */ -/* set FIORDCHK if you can check for characters in input queue */ -#ifdef FIONREAD -# ifndef FIORDCHK -# define FIORDCHK FIONREAD -# endif /* !FIORDCHK */ -#endif /* FIONREAD */ - -#if _sys_ioctl -#include <sys/ioctl.h> -#endif +#include <ast_tty.h> extern int tty_alt(int); extern void tty_cooked(int); @@ -189,13 +33,14 @@ extern int tty_check(int); extern int tty_set(int, int, struct termios*); extern int sh_ioctl(int,int,void*,int); -#undef ioctl -#define ioctl(a,b,c) sh_ioctl(a,b,c,sizeof(c)) -#ifdef _lib_tcgetattr - extern int sh_tcgetattr(int,struct termios*); - extern int sh_tcsetattr(int,int,struct termios*); -# define tcgetattr(a,b) sh_tcgetattr(a,b) -# define tcsetattr(a,b,c) sh_tcsetattr(a,b,c) -#endif +extern int sh_tcgetattr(int,struct termios*); +extern int sh_tcsetattr(int,int,struct termios*); + +#undef ioctl +#undef tcgetattr +#undef tcsetattr +#define ioctl(a,b,c) sh_ioctl(a,b,c,sizeof(c)) +#define tcgetattr(a,b) sh_tcgetattr(a,b) +#define tcsetattr(a,b,c) sh_tcsetattr(a,b,c) #endif /* _terminal_ */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/ulimit.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/ulimit.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -39,7 +39,7 @@ # endif # undef _lib_ulimit #else -# ifdef _sys_vlimit +# if _sys_vlimit # include <sys/vlimit.h> # undef _lib_ulimit # define RLIMIT_FSIZE LIM_FSIZE @@ -51,7 +51,7 @@ # define RLIMIT_RSS LIM_MAXRSS # endif /* LIM_MAXRSS */ # else -# ifdef _lib_ulimit +# if _lib_ulimit # define vlimit ulimit # endif /* _lib_ulimit */ # endif /* _lib_vlimit */ @@ -74,7 +74,7 @@ #else # define _no_ulimit #endif -#ifndef _typ_rlim_t +#if !_typ_rlim_t typedef long rlim_t; #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/variables.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/variables.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * *
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/include/version.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/include/version.h
Changed
@@ -17,8 +17,8 @@ #include <releaseflags.h> #define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */ -#define SH_RELEASE_SVER "1.0.8" /* semantic version number: https://semver.org */ -#define SH_RELEASE_DATE "2024-01-01" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_SVER "1.0.9" /* semantic version number: https://semver.org */ +#define SH_RELEASE_DATE "2024-07-02" /* must be in this format for $((.sh.version)) */ #define SH_RELEASE_CPYR "(c) 2020-2024 Contributors to ksh " SH_RELEASE_FORK /* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/kshrc.sh
Added
@@ -0,0 +1,240 @@ +######################################################################## +# # +# This file is part of the ksh 93u+m package # +# Copyright (c) 2022-2024 Contributors to ksh 93u+m # +# and is licensed under the # +# Eclipse Public License, Version 2.0 # +# # +# A copy of the License is available at # +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # +# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # +# # +# Martijn Dekker <martijn@inlv.org> # +# Johnothan King <johnothanking@protonmail.com> # +# # +######################################################################## + +# A nice default .kshrc for 'bin/package use' +# Feel free to adapt and use as your own ~/.kshrc + +# Enable ** patterns +set --globstar + +# Disable \ escaping annoyance if supported +# (e.g. \ breaks a subsequent arrow key). +# This will be disabled by default in 93u+m/1.1 +# You can always use the 'stty lnext' character (^V). + -o ?backslashctrl && set --nobackslashctrl + +# create a namespace for global kshrc stuff +typeset .rc + +.rc.me=${0##*/} # a $0 without dir that won't change in functions +.rc.uid=${ id -u; } +.rc.host=${ uname -n; } +.rc.host=${.rc.host%%.*} # remove domain +.rc.tty=${ tty; } +.rc.tty=${.rc.tty#/dev/} + +if -v INSTALLROOT +then # do not intefere with the regular ksh history + -d $INSTALLROOT/var || mkdir -p "$INSTALLROOT/var" + HISTFILE=$INSTALLROOT/var/sh_history_${.rc.tty//\//_} +fi + +if ((.sh.version < 20230403)) +then print -r "${.rc.me}: ${.sh.version} is too old for this kshrc; reducing" >&2 + if ((.sh.version < 20220201)) # later ksh does this itself + then ! -o vi && ! -o emacs && ! -o gmacs && -o ?emacs && set --emacs + fi + PS1='<$?>!:${PWD#${PWD%/*/*/*}/} $ ' + return +fi + +# Formatting and colour codes +.rc.fmt=( + reset=$'\E0m' + underline=$'\E4m' + bold=$'\E1m' + + magenta=$'\E35m' + blue=$'\E34m' + cyan=$'\E36m' + red=$'\E31m' + + status0=$'\E32m' # zero exit status: green + status1=$'\E31m' # nonzero exit status: red +) + +# extend tilde expansion functionality: +# define some nice default shortcuts and add some warnings +function .sh.tilde.get +{ + case ${.sh.tilde} in + '~tmp') .sh.value=${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}} ;; + '~doc') .sh.value=~/Documents ;; + '~ast') -v INSTALLROOT && .sh.value=$INSTALLROOT ;; + '~today') + printf -v .sh.value "%s/Documents/Projects/%(%Y-%m-%d)T" "$HOME" "now" + if ! -d ${.sh.value} && ! -L ${.sh.value} ; then + printf '%s: creating directory %q\n' "${.rc.me}" "${.sh.value}" >&2 + mkdir -p "${.sh.value}" + fi ;; + \~*!:alnum:._-*) + printf '%s: warning: %s: bad username\n' "${.rc.me}" "${.sh.tilde#\~}" >&2 ;; + \~*) eval ".sh.value=${.sh.tilde}" # perform default expansion + if ${.sh.value} == "${.sh.tilde}" ; then + printf '%s: warning: %s: unknown username\n' "${.rc.me}" "${.sh.tilde#\~}" >&2 + fi ;; + esac +} + +# RELPWD expands to relative current working directory with ~ support +# and configurable number of pathname components kept +function RELPWD.get +{ + typeset del ellip=$'\u2026' v=$PWD keep=${RELPWD.keep} + ((${#ellip}==1)) || ellip='...' + ($v == "$HOME" || $v == "$HOME"/*) && $HOME != / && v=\~${v#"$HOME"} + if -n $keep + then del=${v%/$keep}/ + $v == /*/$keep && v=$ellip/${v#"$del"} + $v == \~/*/$keep && v=\~/$ellip/${v#"$del"} + fi + .sh.value=$v +} +# convert <=1 to *, 2 to */*, 3 to */*/*, etc. +function RELPWD.keep.set +{ + typeset -si i n + let "(n=${.sh.value}) ? 1 : 1" 2>/dev/null || n=3 + ((n>64)) && n=64 # sanity check + ((n<1)) && .sh.value='' && return + .sh.value='*' + for ((i=2; i <= n; i++)) + do .sh.value+='/*' + done +} +# change this anytime to set number of pathname components kept +# set to 0 to keep all (but still change your home directory to ~) +RELPWD.keep=3 + +# get the current git branch +function GITBRANCH.get +{ + command -v git >/dev/null || return + .sh.value=${ git branch --show-current 2>/dev/null; } && return + # fallback for old git versions without --show-current: + .sh.value=${ git branch 2>/dev/null; } + case $'\n'${.sh.value} in + *$'\n* '*) + .sh.value=$'\n'${.sh.value} + .sh.value=${.sh.value#*$'\n* '} + .sh.value=${.sh.value%%$'\n'*} + ;; + *) .sh.value='' + ;; + esac +} + +# ${.rc.status} is a nicely formatted/coloured $? +function .rc.status.get +{ + typeset e=$? + typeset clr=${.rc.fmtstatus$((e > 0))} + typeset q1=$'\u00AB' q2=$'\u00BB' + ((${#q1}==1 && ${#q2}==1)) || q1='<' q2='>' + if ((e>256)) # add signal name + then typeset s=${ kill -l "$e"; } + $s == *A-Z* && e+="/SIG$s" + fi + .sh.value=${.rc.fmtreset}$q1$clr$e${.rc.fmtreset}$q2 +} + +# Regular (PS1) prompt. +typeset -sui .rc.ps2_lineno=0 +case ${.rc.uid} in +0) .rc.clr1=${.rc.fmtmagenta} .rc.clr2=${.rc.fmtred} .rc.char='#' ;; +*) .rc.clr1=${.rc.fmtblue} .rc.clr2=${.rc.fmtcyan} .rc.char='$' ;; +esac +# use single quotes to avoid expanding variables now, because PS1 is special: +# it expands variables in its value even without a discipline function. +# Also, '!' expands to the history file number (see 'man fc'). +PS1='${.rc.status}${.rc.clr1}!${.rc.fmtreset}:${.rc.clr2}${RELPWD}' +PS1+='${GITBRANCH:+${.rc.clr1}${GITBRANCH}}${.rc.fmtreset} ${.rc.char} ' + +function PS1.get +{ + # reset PS2 counter whenever PS1 is shown + .rc.ps2_lineno=0 +} + +# PS2 line continuation prompt. It does not expand anything by itself, +# but we can use a discipline function to make it act dynamically. +function PS2.get +{ + typeset clr1 clr2 char + case ${.rc.uid} in + 0) clr1=${.rc.fmtmagenta} clr2=${.rc.fmtred} ;; + *) clr1=${.rc.fmtblue} clr2=${.rc.fmtcyan} ;; + esac + char=$'\u22d7' # greater-than with dot (UTF-8) + ((${#char}==1)) || char='>' + ((.rc.ps2_lineno++)) + printf -v .sh.value ' %s%s%02d%s%s %c%s ' \ + "$clr1" \ + "${.rc.fmtunderline}" \ + .rc.ps2_lineno \ + "${.rc.fmtreset}" \ + "$clr2" \ + "$char" \ + "${.rc.fmtreset}" +} + +# Stuff for when this is run from 'bin/package use'. +if -v INSTALLROOT +then + # keeping ENV pointed here can cause breakage when other shells run, + # particularly as some shells load ENV even for scripts (contra POSIX) + unset ENV + + # make shipped functions available + case $FPATH: in + "$INSTALLROOT"/fun:*) + ;; + *) FPATH=$INSTALLROOT/fun${FPATH:+:$FPATH} ;; + esac + export FPATH + autoload autocd cd dirs man mcd popd pushd + + # Workaround for "System Integrity Protection" on macOS which filters + # out DYLD_* env vars whenever anything in /bin or /usr/bin is run, + # which kills env "$SHELL" for a preinstalled dynamically linked $SHELL + case $HOSTTYPE,${DYLD_LIBRARY_PATH+s} in + darwin.*,s) + function env + { + typeset -a opts + typeset -si i=0 + while $1 == -* && $1 != -- + do optsi++=$1 + case $1 in + -u | -S | -P) + (($# > 1)) && optsi++=$2 && shift ;; + esac + shift + done + command -p env "${opts@}" "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" "$@" + } + ;; + esac + + # Print welcome message + set -- ${.sh.version} + print -r "${.rc.fmtbold}Welcome to ksh ${.rc.fmtred}$3 ${.rc.fmtblue}$4${.rc.fmtreset} on ${.rc.fmtbold}${.rc.host} (${.rc.tty})${.rc.fmtreset}" + set -- + print -r -- "- Have a look at ${.rc.fmtbold}~ast/etc/kshrc${.rc.fmtreset} to see all the cool stuff activated here" + print -r -- "- Type '${.rc.fmtbold}builtin${.rc.fmtreset}' for a list of built-in commands (with and without path)" + print -r -- "- Autoloadable functions have been activated. Check them out in ${.rc.fmtbold}~ast/fun${.rc.fmtreset}" + print -r -- "- Get help: use '${.rc.fmtbold}man${.rc.fmtreset} ${.rc.fmtunderline}commandname${.rc.fmtreset}' for everything, even built-in commands" +fi
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh.1 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh.1
Changed
@@ -1104,9 +1104,6 @@ later with the .B typeset\^ special built-in command. -Exported variables pass their attributes to the environment so that a newly -invoked ksh that is a child or exec'd process of the current shell will -automatically import them, unless the \fBposix\fR shell option is on. .PP The shell supports both indexed and associative arrays. An element of an array variable is referenced by a @@ -1347,7 +1344,7 @@ is substituted. .TP \f3${@\fP\f2vname\^\fP\f3}\fP -Expands to the type name (See +Expands to the type name (see .I "Type Variables"\^ below) or attributes of the variable referred to by .IR vname . @@ -1943,11 +1940,16 @@ .TP .B .SM RANDOM -Each time this variable is referenced, a random integer, -uniformly distributed between 0 and 32767, is generated. -The sequence of random numbers can be initialized by assigning -a numeric value to +Each time this variable is referenced, a pseudorandom integer is generated, +uniformly distributed between 0 and 32767 (the 16-bit unsigned integer range) +except that the same number is never repeated twice in a row. +The sequence of pseudorandom numbers is reproducible +and can be initialized to a fixed starting point by assigning +a numeric seed value to .BR RANDOM . +Each time a new shell or subshell environment is entered (see +.I Subshells\^ +above), the sequence is automatically reset to a different point. .TP .B .SM REPLY @@ -2509,19 +2511,11 @@ (see above), are checked to see if they contain one or more of the brace patterns .BR {*,*} , -.BI { l1 .. l2 } -, -.BI { n1 .. n2 } -, -.BI { n1 .. n2 % -.IB fmt } -, -.BI { n1 .. n2 -.BI .. n3 } -, or -.BI { n1 .. n2 -.BI .. n3 % fmt } -, where +\f3{\fP\f2l1\fP\f3..\fP\f2l2\fP\f3}\fP, +\f3{\fP\f2n1\fP\f3..\fP\f2n2\fP\f3}\fP, +\f3{\fP\f2n1\fP\f3..\fP\f2n2\fP\f3%\fP\f2fmt\fP\f3}\fP, +\f3{\fP\f2n1\fP\f3..\fP\f2n2\fP\f3..\fP\f2n3\fP\f3}\fP, or +\f3{\fP\f2n1\fP\f3..\fP\f2n2\fP\f3..\fP\f2n3\fP\f3%\fP\f2fmt\fP\f3}\fP, where .B * represents any character, .IR l1\^ , l2\^ @@ -2571,7 +2565,7 @@ .B * must be quoted. .PP -In the seconds form, +In the second form, .I l1\^ and .I l2\^ @@ -2590,6 +2584,16 @@ .I n1\^ by .IR n3\^ . +The values of +.IR n1\^ , +.I n2\^ +and +.I n3\^ +are limited to the standard integer range as output by +.B "getconf INT_MIN" +and +.BR "getconf INT_MAX" ; +the behavior is undefined if this range is exceeded. The cases where .I n3\^ is not specified behave as if @@ -3147,20 +3151,22 @@ integer constant conventions although only single byte character constants are recognized and character casts are not recognized. -In addition constants can be of the form -\*(OK\f2base\f3#\^\f1\*(CK\f2n\^\fP +.PP +In addition, integer constants can be of the form +\f2base\f3#\^\f1\f2n\^\fP +or (for negative numbers) +\f3-\^\f2base\f3#\^\f1\f2n\^\fP, where .I base\^ is a decimal number between two and sixty-four -representing the arithmetic base -and +representing the arithmetic base, and .I n\^ -is a number in that base. +is an unsigned integer in that base. The digits above 9 are represented by the lower case letters, the upper case letters, .BR @ , and -.B _ +.BR _ , respectively. For bases less than or equal to 36, upper and lower case characters can be used interchangeably. @@ -3956,6 +3962,15 @@ .B typeset \-x commands. .PP +Exported variables pass their attributes though the environment so that a +newly invoked ksh that is a child or exec'd process of the current shell +will automatically import them, unless the \fBposix\fR shell option is on. +As of ksh 93u+m/1.0, this never includes the +.B readonly +attribute. +Passing attributes through the environment is deprecated +and this feature will be removed in ksh 93u+m/1.1. +.PP The environment for any .I simple-command\^ or function @@ -4029,6 +4044,18 @@ share all files and present working directory with the caller. +All changes to shell options are local to the function call. +The +.B errexit +option is turned off in the function's scope. +The same applies to the +.B xtrace +option, unless the +.B functrace +shell option is set +or the function was tagged using +.BR "typeset \-f \-t" . +The state of all other shell options is inherited from the caller. Traps caught by the caller are reset to their default action inside the function. A trap condition that is not caught or ignored by the @@ -4064,7 +4091,7 @@ syntax that are invoked with the \f3\s+2.\s-2\fP special built-in are executed in the caller's -environment and share all variables +environment and share all variables, options and traps with the caller. Errors within these function executions cause the script that contains them to abort. @@ -4540,16 +4567,6 @@ it is assumed to be a file containing shell commands. A separate shell is spawned to read it. All non-exported variables are removed in this case. -If the shell command -file doesn't have read permission, -or if the -.I setuid -and/or -.I setgid -bits are set on the file, -then the shell executes an agent whose job it is to -set up the permissions and execute the shell with the -shell command file passed down as an open file. If the .B .paths contains a line of the form @@ -6214,11 +6231,11 @@ alias substitution. With the .B \-t -option, each name is looked up as a command in -.B $PATH -and its path is added to the hash table as a 'tracked alias'. -If no name is given, this prints the hash table. See -.BR hash. +option, +.B alias +acts like +.BR hash ; +see there. Without the .B \-t option, @@ -6601,7 +6618,8 @@ .I arg\^ is given, the command specified by -the arguments is executed in place of this shell +the arguments is seaerched on PATH as an external command +and executed in place of the current shell without creating a new process. The value of the .SM @@ -6827,7 +6845,7 @@ .B # can only be specified as the first option. .TP -\f3hash\fP \*(OK \f3\-r\fP \f2\^\fP\*(CK \*(OK \f3utility\^\fP \*(CK +\f3hash\fP \*(OK \f3\-r\fP \f2\^\fP\*(CK \*(OK \f2utility\^\fP ... \*(CK .B hash displays or modifies the hash table with the locations of recently used programs. If given no arguments, it lists all command/path associations @@ -6838,6 +6856,9 @@ search for each .I utility\^ supplied and adds the result to the hash table. +Any +.I utility\^ +that is not found is silently ignored. The .B \-r option empties the hash table. This can also be achieved by resetting @@ -6975,6 +6996,9 @@ after the .BR \- . If the signal being sent is TERM (terminate) or HUP (hangup), +and the +.B posix +shell option is off, then the job or process will be sent a CONT (continue) signal if it is stopped. The argument @@ -7340,8 +7364,34 @@ characters (\fB\\n\fR). The \f2vname\fP argument should be a valid variable name, optionally with one or more array subscripts in square brackets. Note that square brackets should be quoted to avoid pathname expansion. +.PP +On some systems, the external +.BR printf (1) +command +allows the +.I format\^ +operand to begin with a +.B -\^ +without any preceding +.B --\^ +option terminator argument +for compatibility with ancient scripts, +provided no options are given. +On such systems, +.if \nZ=0 .BR sh 's +.if \nZ=1 .BR ksh 's +.if \nZ=2 .BR ksh93 's +built-in +.B printf\^ +may have been built to be as compatible with +this as possible while still allowing its options to be usable. +However, the POSIX standard requires adding the preceding +.B --\^ +to keep such a +.I format\^ +operand from being misinterpreted as options. +The obsolete syntax is not portable and should be avoided in new scripts. .RE - .TP \f3pwd\fP \*(OK \f3\-LP\fP \*(CK Outputs the value of the current working @@ -7912,7 +7962,12 @@ .B IFS variable; .IP \bu -causes file descriptors > 2 to be left open when invoking another program; +causes +.B redirect +and +.B exec +to open file descriptors > 2 without the close-on-exec flag, +so that they are left open when invoking another program; .IP \bu disables the \fB&>\fR redirection shorthand; .IP \bu @@ -7960,6 +8015,16 @@ built-in command, causing them to print a warning for operands that are not valid decimal, \fB0x\fR-prefixed hexadecimal or \fB0\fR-prefixed octal numbers; .IP \bu +stops the +.B kill +built-in command from automatically sending a +.B CONT +signal to stopped jobs or processes upon sending a +.B HUP +or +.B TERM +signal; +.IP \bu disables the special handling of \f3/dev/fd/\fP\f2n\fP in file existence and access test operators in \fBtest\fR/\fB\fR and \fB\fR, causing these to operate on the file \f3/dev/fd/\fP\f2n\fP in the file system;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/args.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/args.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -119,10 +119,11 @@ #endif Shopt_t newflags; int defaultflag=0, setflag=0, action=0, trace=(int)sh_isoption(SH_XTRACE); - Namval_t *np = NULL; - const char *cp; - int verbose,f; - Optdisc_t disc; + int invalidate_ifs = 0; + Namval_t *np = NULL; + const char *cp; + int verbose, f; + Optdisc_t disc; newflags=sh.options; memset(&disc, 0, sizeof(disc)); disc.version = OPT_VERSION; @@ -175,7 +176,7 @@ { off_option(&newflags,o); if(o==SH_POSIX) - sh_invalidate_ifs(); + invalidate_ifs = 1; } } } @@ -251,7 +252,7 @@ off_option(&newflags,SH_BRACEEXPAND); #endif on_option(&newflags,SH_LETOCTAL); - sh_invalidate_ifs(); + invalidate_ifs = 1; } on_option(&newflags,o); off_option(&sh.offoptions,o); @@ -269,7 +270,7 @@ on_option(&newflags,SH_BRACEEXPAND); #endif off_option(&newflags,SH_LETOCTAL); - sh_invalidate_ifs(); + invalidate_ifs = 1; } if(o==SH_XTRACE) trace = 0; @@ -294,6 +295,9 @@ } if(trace) sh_trace(argv,1); + /* Invalidating the IFS state table must be done after sh_trace, because xtrace reads IFS */ + if(invalidate_ifs) + sh_invalidate_ifs(); argc -= opt_info.index; argv += opt_info.index; if(action==PRINT) @@ -337,7 +341,7 @@ errormsg(SH_DICT,ERROR_system(3),e_create,ap->kiafile); UNREACHABLE(); } - if(!(lp->kiatmp=sftmp(2*SF_BUFSIZE))) + if(!(lp->kiatmp=sftmp(2*SFIO_BUFSIZE))) { errormsg(SH_DICT,ERROR_system(3),e_tmpcreate); UNREACHABLE(); @@ -639,21 +643,21 @@ const struct comnod *ac = comptr; int n; /* see if the arguments have already been expanded */ - if(!ac->comarg) + if(!ac->comarg.ap) { *nargs = 0; return &null; } else if(!(ac->comtyp&COMSCAN)) { - struct dolnod *ap = (struct dolnod*)ac->comarg; + struct dolnod *ap = ac->comarg.dp; *nargs = ap->dolnum; return ap->dolval+ap->dolbot; } *nargs = 0; if(ac) { - argp = ac->comarg; + argp = ac->comarg.ap; while(argp) { n = arg_expand(argp,&arghead,flag); @@ -681,7 +685,7 @@ * TODO: find/fix root cause, eliminate argi */ argn = *nargs + 1; /* allow room to prepend args */ - comargn=(char**)stkalloc(sh.stk,(unsigned)(argn+1)*sizeof(char*)); + comargn = stkalloc(sh.stk,(unsigned)(argn+1)*sizeof(char*)); comargm = comargn += argn; *comargn = NULL; if(!argp) @@ -724,7 +728,7 @@ int savestates = sh_getstate(); char savejobcontrol = job.jobcontrol; unsigned int savesubshell = sh.subshell; - ap = (struct argnod*)stkseek(sh.stk,ARGVAL); + ap = stkseek(sh.stk,ARGVAL); ap->argflag |= ARG_MAKE; ap->argflag &= ~ARG_RAW; fd = argp->argflag&ARG_RAW; @@ -751,8 +755,8 @@ chmod(sh.fifo,S_IRUSR|S_IWUSR); /* mkfifo + chmod works regardless of umask */ sfputr(sh.stk,sh.fifo,0); #endif /* SHOPT_DEVFD */ - sfputr(sh.stk,fmtbase((intmax_t)pvfd,10,0),0); - ap = (struct argnod*)stkfreeze(sh.stk,0); + sfputr(sh.stk,fmtint(pvfd,1),0); + ap = stkfreeze(sh.stk,0); sh.inpipe = sh.outpipe = 0; /* turn off job control */ sh_offstate(SH_INTERACTIVE);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/arith.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/arith.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -182,7 +182,7 @@ if(ap && !ap->table) ap->table = dtopen(&_Nvdisc,Dtoset); if(ap && ap->table && (nq=nv_search(nv_getsub(np),ap->table,NV_ADD))) - nq->nvenv = (char*)np; + nq->nvmeta = np; if(nq && nv_isnull(nq)) np = nv_arraychild(np,nq,0); } @@ -227,6 +227,7 @@ case ASSIGN: { Namval_t *np; + unsigned short attr; if (lvalue->sub && lvalue->nosub > 0) /* indexed array ARITH_ASSIGNOP */ { np = (Namval_t*)lvalue->sub; /* use saved subscript reference instead of last worked value */ @@ -253,8 +254,37 @@ if(lvalue->eflag) lvalue->ptr = nv_hasdisc(np,&ENUM_disc); lvalue->eflag = 0; - r=nv_getnum(np); lvalue->value = (char*)np; + /* + * The result (r) of an assignment is its value (n), cast to the type of the variable + * assigned to. We cannot simply reobtain the value with nv_getnum() to effectuate the + * typecast, because that may trigger a getnum discipline function with side effects. + * The order of checks below is essential due to how the bit masks work (see nval.h). + */ + attr = nv_isnum(np); + if(!attr || (attr & NV_LDOUBLE)==NV_LDOUBLE) /* long float */ + r = n; + else if((attr & NV_FLOAT)==NV_FLOAT) /* short float */ + r = (float)n; + else if((attr & NV_DOUBLE)==NV_DOUBLE) /* normal float */ + r = (double)n; + else if((attr & NV_UINT64)==NV_UINT64) /* long unsigned integer */ + r = (uintmax_t)n; + else if((attr & NV_UINT16)==NV_UINT16) /* short unsigned integer */ + r = (uint16_t)n; + else if((attr & NV_UINT32)==NV_UINT32) /* normal unsigned integer */ + r = (uint32_t)n; + else if((attr & NV_INT64)==NV_INT64) /* long signed integer */ + r = (intmax_t)n; + else if((attr & NV_INT16)==NV_INT16) /* short signed integer */ + r = (int16_t)n; + else if((attr & NV_INT32)==NV_INT32) /* normal signed integer */ + r = (int32_t)n; +#if _AST_release + else r = n; /* should never happen */ +#else + else abort(); +#endif break; } case LOOKUP:
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/array.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/array.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -378,7 +378,7 @@ sfprintf(sh.strbuf,"%d",ap->cur); cp = sfstruse(sh.strbuf); mp = nv_search(cp, ap->header.table, NV_ADD); - mp->nvenv = (char*)np; + mp->nvmeta = np; nv_arraychild(np,mp,0); } if(up->np && array_isbit(ap->bits,ap->cur,ARRAY_CHILD)) @@ -446,7 +446,7 @@ do { if(nq=nv_opensub(np)) - nq->nvenv = (void*)mp; + nq->nvmeta = mp; } while(nv_nextsub(np)); } @@ -665,7 +665,7 @@ { if(is_associative(ap)) (*ap->fun)(np, NULL, NV_AFREE); - else if(ap->table) + else if(ap->table && (!sh.subshell || sh.subshare)) { dtclose(ap->table); ap->table = 0; @@ -790,7 +790,7 @@ nv_disc(np,(Namfun_t*)fp, NV_FIRST); fp->nofree |= 1; nv_onattr(np,NV_ARRAY); - mp->nvenv = (char*)np; + mp->nvmeta = np; } /* @@ -807,7 +807,7 @@ int newsize = arsize(arp,maxi+1); if (maxi >= ARRAY_MAX) { - errormsg(SH_DICT,ERROR_exit(1),e_subscript, fmtbase((intmax_t)maxi,10,0)); + errormsg(SH_DICT,ERROR_exit(1),e_subscript,fmtint(maxi,1)); UNREACHABLE(); } i = (newsize-1)*sizeof(union Value)+newsize; @@ -1028,7 +1028,7 @@ if((tp=nv_type(np)) || c) { ap->nelem |= ARRAY_NOCLONE; - nq->nvenv = (char*)np; + nq->nvmeta = np; if(c=='t') nv_clone(tp,nq, 0); else @@ -1036,7 +1036,7 @@ nv_offattr(nq,NV_ARRAY); ap->nelem &= ~ARRAY_NOCLONE; } - nq->nvenv = (char*)np; + nq->nvmeta = np; if((fp=nq->nvfun) && fp->disc && fp->disc->setdisc && (fp = nv_disc(nq,fp,NV_POP))) free(fp); if(!ap->fun) @@ -1237,7 +1237,7 @@ sfprintf(sh.strbuf,"%d",ap->cur); cp = sfstruse(sh.strbuf); mp = nv_search(cp, ap->header.table, NV_ADD); - mp->nvenv = (char*)np; + mp->nvmeta = np; nv_arraychild(np,mp,0); nv_setvtree(mp); } @@ -1720,7 +1720,7 @@ return ap->cur; case NV_ACURRENT: if(ap->cur) - ap->cur->nvenv = (char*)np; + ap->cur->nvmeta = np; return ap->cur; case NV_ANAME: if(ap->cur) @@ -1749,7 +1749,7 @@ if((mp || (mp=nv_search(sp,ap->header.table,mode))) && nv_isnull(mp) && (mode&NV_ADD)) { nv_onattr(mp,type); - mp->nvenv = (char*)np; + mp->nvmeta = np; if((mode&NV_ADD) && nv_type(np)) nv_arraychild(np,mp,0); if(sh.subshell)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/expand.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/expand.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -115,7 +115,7 @@ */ if((ap = (struct argnod*)gp->gl_list) && !ap->argnxt.ap && strcmp(ap->argval,trimmedpat)==0) { - gp->gl_list = (globlist_t*)stkalloc(sh.stk,ARGVAL+strlen(pattern)+1); + gp->gl_list = stkalloc(sh.stk,ARGVAL+strlen(pattern)+1); memcpy(gp->gl_list,ap,ARGVAL); /* copy fields *before* argval/gl_path */ strcpy(gp->gl_list->gl_path,pattern); } @@ -149,9 +149,9 @@ continue; if(strmatch(cp=nv_name(np),pattern)) { - (void)stkseek(sh.stk,ARGVAL); + stkseek(sh.stk,ARGVAL); sfputr(sh.stk,cp,-1); - ap = (struct argnod*)stkfreeze(sh.stk,1); + ap = stkfreeze(sh.stk,1); ap->argbegin = NULL; ap->argchn.ap = *arghead; ap->argflag = ARG_RAW|ARG_MAKE; @@ -244,10 +244,10 @@ struct argnod *ap; struct argnod *top = 0; struct argnod *apin; - char *pat, *rescan; + char *pat = NULL, *rescan; char *format; char comma, range=0; - int first, last, incr, count = 0; + int first = 0, last = 0, incr = 0, count = 0; char tmp32, end1; todo->argchn.ap = 0; again: @@ -384,6 +384,8 @@ } endloop1: rescan = cp; + if(!pat) + abort(); cp = pat-1; *cp = 0; while(1) @@ -403,7 +405,7 @@ *(rescan - 1) = '}'; *(cp = end) = 0; } - if(incr*(first+incr) > last*incr) + if(incr < 0 ? (first + incr < last) : (first + incr > last)) *cp = '}'; else first += incr; @@ -429,13 +431,13 @@ brace = *cp; *cp = 0; sh_sigcheck(); - ap = (struct argnod*)stkseek(sh.stk,ARGVAL); + ap = stkseek(sh.stk,ARGVAL); ap->argflag = ARG_RAW; ap->argchn.ap = todo; sfputr(sh.stk,apin->argval,-1); sfputr(sh.stk,pat,-1); sfputr(sh.stk,rescan,-1); - todo = ap = (struct argnod*)stkfreeze(sh.stk,1); + todo = ap = stkfreeze(sh.stk,1); if(brace == '}') break; if(!range)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/fault.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/fault.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2014 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -128,7 +128,7 @@ sigrelease(sig); if(pp->mode != SH_JMPSUB) { - if(pp->mode < SH_JMPSUB) + if(pp->mode < SH_JMPSUB && !sh_isstate(SH_INTERACTIVE)) pp->mode = sh.subshell?SH_JMPSUB:SH_JMPFUN; else pp->mode = SH_JMPEXIT; @@ -495,7 +495,7 @@ char was_no_trapdontexec = !sh.st.trapdontexec; char save_chldexitsig = sh.chldexitsig; int staktop = stktell(sh.stk); - char *savptr = stkfreeze(sh.stk,0); + void *savptr = stkfreeze(sh.stk,0); struct checkpt buff; Fcin_t savefc; fcsave(&savefc); @@ -526,11 +526,7 @@ if(jmpval==SH_JMPSCRIPT) indone=0; else - { - if(jmpval==SH_JMPEXIT) - savxit = sh.exitval; jmpval=SH_JMPTRAP; - } } sh_popcontext(&buff); /* re-allow last-command exec optimisation unless the command we executed set a trap */ @@ -539,8 +535,10 @@ sh.intrap--; sfsync(sh.outpool); savxit_return = sh.exitval; - if(jmpval!=SH_JMPEXIT && jmpval!=SH_JMPFUN) - sh.exitval=savxit; + if(sh.intrap_exit_n) + sh.intrap_exit_n = 0; + else + sh.exitval = savxit; stkset(sh.stk,savptr,staktop); fcrestore(&savefc); if(was_history) @@ -571,6 +569,7 @@ sh.exitval |= (sig=sh.lastsig); if(pp && pp->mode>1) cursig = -1; + sh_offstate(SH_EXEC); if((sh.trapnote&SH_SIGTSTP) && job.jobcontrol) { /* ^Z detected by the shell */ @@ -617,7 +616,7 @@ } /* unlock output pool */ sh_offstate(SH_NOTRACK); - if(!(pool=sfpool(NULL,sh.outpool,SF_WRITE))) + if(!(pool=sfpool(NULL,sh.outpool,SFIO_WRITE))) pool = sh.outpool; /* can't happen? */ sfclrlock(pool); if(sh.lastsig==SIGPIPE) @@ -664,7 +663,6 @@ if(t=sh.st.trapcom0) { sh.st.trapcom0=0; /* should free but not long */ - sh.oldexit = savxit; sh_trap(t,0); savxit = sh.exitval; } @@ -694,7 +692,7 @@ /* generate fault termination code */ if(RLIMIT_CORE!=RLIMIT_UNKNOWN) { -#ifdef _lib_getrlimit +#if _lib_getrlimit struct rlimit rlp; getrlimit(RLIMIT_CORE,&rlp); rlp.rlim_cur = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/fcin.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/fcin.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -43,7 +43,7 @@ _Fcin.fcbuff = _Fcin.fcptr; _Fcin._fcfile = f; fcsave(&save); - if(!(buff=(char*)sfreserve(f,SF_UNBOUND,SF_LOCKR))) + if(!(buff=(char*)sfreserve(f,SFIO_UNBOUND,SFIO_LOCKR))) { fcrestore(&save); _Fcin.fcchar = 0; @@ -55,8 +55,8 @@ n = sfvalue(f); fcrestore(&save); sfread(f,buff,0); - _Fcin.fcoff = sftell(f);; - buff = (char*)sfreserve(f,SF_UNBOUND,SF_LOCKR); + _Fcin.fcoff = sftell(f); + buff = (char*)sfreserve(f,SFIO_UNBOUND,SFIO_LOCKR); _Fcin.fclast = (_Fcin.fcptr=_Fcin.fcbuff=(unsigned char*)buff)+n; if(sffileno(f) >= 0) *_Fcin.fclast = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/init.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/init.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -230,7 +230,7 @@ /* * Exception callback routine for stk(3) and sh_*alloc wrappers. */ -static noreturn char *nomemory(size_t s) +static noreturn void *nomemory(size_t s) { errormsg(SH_DICT, ERROR_SYSTEM|ERROR_PANIC, "out of memory (needed %llu bytes)", (uintmax_t)s); UNREACHABLE(); @@ -554,18 +554,6 @@ } } -/* Invalidate IFS state table */ -void sh_invalidate_ifs(void) -{ - Namval_t *np = sh_scoped(IFSNOD); - if(np) - { - struct ifs *ip = (struct ifs*)np->nvfun; - if(ip) - ip->ifsnp = 0; - } -} - /* * This is the lookup function for IFS * It keeps the sh.ifstable up to date @@ -673,7 +661,7 @@ static void put_rand(Namval_t* np,const char *val,int flags,Namfun_t *fp) { struct rand *rp = (struct rand*)fp; - long n; + Sfdouble_t n; sh_save_rand_seed(rp, 0); if(!val) { @@ -684,7 +672,7 @@ return; } if(flags&NV_INTEGER) - n = *(double*)val; + n = *(Sfdouble_t*)val; else n = sh_arith(val); srand(rp->rand_seed = (unsigned int)n); @@ -712,7 +700,7 @@ static char* get_rand(Namval_t* np, Namfun_t *fp) { intmax_t n = (intmax_t)nget_rand(np,fp); - return fmtbase(n, 10, 0); + return fmtint(n,1); } void sh_reseed_rand(struct rand *rp) @@ -753,7 +741,7 @@ return; } if(flags&NV_INTEGER) - n = (Sfdouble_t)(*(double*)val); + n = *(Sfdouble_t*)val; else n = sh_arith(val); sh.st.firstline += (int)(nget_lineno(np,fp) + 1 - n); @@ -762,7 +750,7 @@ static char* get_lineno(Namval_t* np, Namfun_t *fp) { intmax_t n = (intmax_t)nget_lineno(np,fp); - return fmtbase(n, 10, 0); + return fmtint(n,1); } static char* get_lastarg(Namval_t* np, Namfun_t *fp) @@ -778,7 +766,7 @@ { if(flags&NV_INTEGER) { - sfprintf(sh.strbuf,"%.*g",12,*((double*)val)); + sfprintf(sh.strbuf,"%.*Lg",12,*((Sfdouble_t*)val)); val = sfstruse(sh.strbuf); } if(val) @@ -789,7 +777,7 @@ nv_offattr(np,NV_NOFREE); sh.lastarg = (char*)val; nv_offattr(np,NV_EXPORT); - np->nvenv = 0; + np->nvmeta = NULL; } static void match2d(struct match *mp) @@ -798,22 +786,25 @@ int i; Namarr_t *ap; nv_disc(SH_MATCHNOD, &mp->hdr, NV_POP); - np = nv_namptr(mp->nodes, 0); - for(i=0; i < mp->nmatch; i++) + if(mp->nodes) { - np->nvname = mp->names + 3 * i; - if(i > 9) + np = nv_namptr(mp->nodes, 0); + for(i=0; i < mp->nmatch; i++) { - *np->nvname = '0' + i / 10; - np->nvname1 = '0' + (i % 10); + np->nvname = mp->names + 3 * i; + if(i > 9) + { + *np->nvname = '0' + i / 10; + np->nvname1 = '0' + (i % 10); + } + else + *np->nvname = '0' + i; + nv_putsub(np, NULL, 1); + nv_putsub(np, NULL, 0); + nv_putsub(SH_MATCHNOD, NULL, i); + nv_arraychild(SH_MATCHNOD, np, 0); + np = nv_namptr(np + 1, 0); } - else - *np->nvname = '0' + i; - nv_putsub(np, NULL, 1); - nv_putsub(np, NULL, 0); - nv_putsub(SH_MATCHNOD, NULL, i); - nv_arraychild(SH_MATCHNOD, np, 0); - np = nv_namptr(np + 1, 0); } if(ap = nv_arrayptr(SH_MATCHNOD)) ap->nelem = mp->nmatch; @@ -827,7 +818,7 @@ { Init_t *ip = sh.init_context; struct match *mp = &ip->SH_MATCH_init; - int i,n,x, savesub=sh.subshell; + int i,n,x, savesub=sh.subshell; Namarr_t *ap = nv_arrayptr(SH_MATCHNOD); Namval_t *np; if(sh.intrace) @@ -835,25 +826,28 @@ sh.subshell = 0; if(index<0) { - np = nv_namptr(mp->nodes,0); - if(mp->index==0) - match2d(mp); - for(i=0; i < mp->nmatch; i++) + if(mp->nodes) { - nv_disc(np,&mp->hdr,NV_LAST); - nv_putsub(np,NULL,mp->index); - for(x=mp->index; x >=0; x--) - { - n = i + x*mp->nmatch; - if(mp->match2*n+1>mp->match2*n) - nv_putsub(np,Empty,ARRAY_ADD|x); - } - if((ap=nv_arrayptr(np)) && array_elem(ap)==0) + np = nv_namptr(mp->nodes,0); + if(mp->index==0) + match2d(mp); + for(i=0; i < mp->nmatch; i++) { - nv_putsub(SH_MATCHNOD,NULL,i); - _nv_unset(SH_MATCHNOD,NV_RDONLY); + nv_disc(np,&mp->hdr,NV_LAST); + nv_putsub(np,NULL,mp->index); + for(x=mp->index; x >=0; x--) + { + n = i + x*mp->nmatch; + if(mp->match2*n+1>mp->match2*n) + nv_putsub(np,Empty,ARRAY_ADD|x); + } + if((ap=nv_arrayptr(np)) && array_elem(ap)==0) + { + nv_putsub(SH_MATCHNOD,NULL,i); + _nv_unset(SH_MATCHNOD,NV_RDONLY); + } + np = nv_namptr(np+1,0); } - np = nv_namptr(np+1,0); } sh.subshell = savesub; return; @@ -982,15 +976,7 @@ return mp->rvali; } -static char *name_match(Namval_t *np, Namfun_t *fp) -{ - int sub = nv_aindex(SH_MATCHNOD); - sfprintf(sh.strbuf,".sh.match%d",sub); - return sfstruse(sh.strbuf); -} - -static const Namdisc_t SH_MATCH_disc = { sizeof(struct match), 0, get_match, - 0,0,0,0,name_match }; +static const Namdisc_t SH_MATCH_disc = { sizeof(struct match), 0, get_match }; static char* get_version(Namval_t* np, Namfun_t *fp) { @@ -1001,7 +987,7 @@ { const char *cp = e_version + strlen(e_version)-10; int c; - Sflong_t t = 0; + Sflong_t t = 0; NOT_USED(fp); while (c = *cp++) @@ -1017,6 +1003,19 @@ static const Namdisc_t IFS_disc = { sizeof(struct ifs), put_ifs, get_ifs }; + +/* Invalidate IFS state table */ +void sh_invalidate_ifs(void) +{ + Namval_t *np = sh_scoped(IFSNOD); + if(np) + { + struct ifs *ip = (struct ifs*)nv_hasdisc(np, &IFS_disc); + if(ip) + ip->ifsnp = 0; + } +} + const Namdisc_t RESTRICTED_disc = { sizeof(Namfun_t), put_restricted }; static const Namdisc_t CDPATH_disc = { sizeof(Namfun_t), put_cdpath }; #if SHOPT_VSH || SHOPT_ESH @@ -1283,7 +1282,7 @@ sh.lex_context = sh_lexopen(0,1); sh.radixpoint = '.'; /* pre-locale init */ sh.strbuf = sfstropen(); - sh.stk = stkstd; + stkoverflow(sh.stk = stkstd, nomemory); sfsetbuf(sh.strbuf,NULL,64); error_info.catalog = e_dict; #if SHOPT_REGRESS @@ -1332,7 +1331,6 @@ sh_ioinit(); /* initialize signal handling */ sh_siginit(); - stkinstall(NULL,nomemory); /* set up memory for name-value pairs */ sh.init_context = nv_init(); /* initialize shell type */ @@ -1354,8 +1352,8 @@ sfprintf(sh.strbuf,"%s/.kshrc",nv_getval(HOME)); nv_putval(ENVNOD,sfstruse(sh.strbuf),NV_RDONLY); } - *SHLVL->nvalue.ip +=1; - nv_offattr(SHLVL,NV_IMPORT); + /* increase SHLVL */ + shlvl++; #if SHOPT_SPAWN { /* @@ -1509,32 +1507,67 @@ } /* + * Close all the dictionaries on a viewpath + */ +static void freeup_tree(Dt_t *tree) +{ + Dt_t *view; + while(view = dtview(tree, NULL)) + { + dtclose(tree); + tree = view; + } + dtclose(tree); +} + +/* * Reinitialize before executing a script without a #! path. - * This is done in a fork of the shell, so "exporting" is done by deleting all non-exported variables. + * This is done in a fork of the shell. */ -int sh_reinit(char *argv) +void sh_reinit(void) { Shopt_t opt; Namval_t *np,*npnext; Dt_t *dp; - int nofree; - char *savfpath = NULL; sh_onstate(SH_INIT); - sh.subshell = sh.realsubshell = sh.comsub = sh.curenv = sh.jobenv = sh.inuse_bits = sh.fn_depth = sh.dot_depth = 0; - sh.envlist = NULL; - sh.last_root = sh.var_tree; + sh_offstate(SH_FORKED); + /* Reset shell options; inherit some */ + memset(&opt,0,sizeof(opt)); + if(sh_isoption(SH_POSIX)) + on_option(&opt,SH_POSIX); +#if SHOPT_ESH + if(sh_isoption(SH_EMACS)) + on_option(&opt,SH_EMACS); + if(sh_isoption(SH_GMACS)) + on_option(&opt,SH_GMACS); +#endif +#if SHOPT_VSH + if(sh_isoption(SH_VI)) + on_option(&opt,SH_VI); +#endif + sh.options = opt; + /* Reset here-document */ if(sh.heredocs) { sfclose(sh.heredocs); sh.heredocs = 0; } - /* save FPATH and treat specially */ - if(nv_isattr(FPATHNOD,NV_EXPORT)) - savfpath = sh_strdup(nv_getval(FPATHNOD)); - _nv_unset(FPATHNOD,NV_RDONLY); - /* Remove non-exported variables, first pass (see sh_envnolocal() in name.c) */ - nv_scan(sh.var_tree,sh_envnolocal,NULL,NV_EXPORT,0); - nv_scan(sh.var_tree,sh_envnolocal,NULL,NV_ARRAY,NV_ARRAY); + /* Reset arguments */ + if(sh.arglist) + sh_argreset(sh.arglist,NULL); + sh.shname = error_info.id = sh_strdup(sh.st.dolv0); + /* Reset traps and signals */ + memset(sh.st.trapcom,0,(sh.st.trapmax+1)*sizeof(char*)); + sh_sigreset(0); + sh.st.filename = sh_strdup(sh.lastarg); + nv_delete(NULL, NULL, 0); + job.exitval = 0; + sh.inpipe = sh.outpipe = 0; + job_clear(); + job.in_critical = 0; + /* update $$, $PPID */ + sh.ppid = sh.current_ppid; + sh.pid = sh.current_pid; #if SHOPT_NAMESPACE if(sh.namespace) { @@ -1542,161 +1575,110 @@ if(dp==sh.var_tree) sh.var_tree = dtview(dp,0); _nv_unset(sh.namespace,NV_RDONLY); - sh.namespace = 0; + sh.namespace = NULL; } #endif /* SHOPT_NAMESPACE */ - /* Delete remaining non-exported, non-default variables; remove attributes from exported variables */ - for(np = dtfirst(sh.var_tree); np; np = npnext) + /* Delete aliases */ + for(np = dtfirst(sh.alias_tree); np; np = npnext) { - if((dp = sh.var_tree)->walk) - dp = dp->walk; - npnext = (Namval_t*)dtnext(sh.var_tree,np); - /* skip default variables (already handled by sh_envnolocal()) */ - if(np >= sh.bltin_nodes && np < &sh.bltin_nodesnvars) - continue; - if(nv_isattr(np,NV_EXPORT)) - { - if(sh_isoption(SH_POSIX)) - { - char *cp = NIL(char*); - /* do not export attributes */ - if(nv_isattr(np,NV_INTEGER)) /* any kind of numeric? */ - { - cp = sh_strdup(nv_getval(np)); /* save string value */ - _nv_unset(np,NV_RDONLY); /* free numeric value */ - } - nv_setattr(np,NV_EXPORT); /* turn off everything except export */ - if(cp) - np->nvalue.cp = cp; /* replace by string value */ - } - else - { - /* export all attributes except readonly */ - nv_offattr(np,NV_RDONLY); - } - /* unset discipline */ - if(np->nvfun && np->nvfun->disc) - np->nvfun->disc = NULL; - } - else - { - nofree = nv_isattr(np,NV_NOFREE); /* note: returns bitmask, not boolean */ - _nv_unset(np,NV_RDONLY); /* also clears NV_NOFREE attr, if any */ - nv_delete(np,dp,nofree); - } + if((dp = sh.alias_tree)->walk) + dp = dp->walk; /* the dictionary in which the item was found */ + npnext = (Namval_t*)dtnext(sh.alias_tree,np); + _nv_unset(np,NV_RDONLY); + nv_delete(np,dp,0); + } + /* Delete hash table entries */ + for(np = dtfirst(sh.track_tree); np; np = npnext) + { + if((dp = sh.track_tree)->walk) + dp = dp->walk; /* the dictionary in which the item was found */ + npnext = (Namval_t*)dtnext(sh.track_tree,np); + _nv_unset(np,NV_RDONLY); + nv_delete(np,dp,0); } /* Delete types */ for(np = dtfirst(sh.typedict); np; np = npnext) { if((dp = sh.typedict)->walk) - dp = dp->walk; + dp = dp->walk; /* the dictionary in which the item was found */ npnext = (Namval_t*)dtnext(sh.typedict,np); nv_delete(np,dp,0); } - /* Delete functions/built-ins. Note: fun_tree has a viewpath to bltin_tree */ + /* Unset all variables (don't delete yet) */ + for(np = dtfirst(sh.var_tree); np; np = npnext) + { + int nofree; + npnext = (Namval_t*)dtnext(sh.var_tree,np); + if(np==DOTSHNOD || np==L_ARGNOD) /* TODO: unset these without crashing */ + continue; + if(nv_isref(np)) + nv_unref(np); + if(nv_isarray(np)) + nv_putsub(np,NULL,ARRAY_UNDEF); + nofree = nv_isattr(np,NV_NOFREE); /* note: returns bitmask, not boolean */ + _nv_unset(np,NV_RDONLY); /* also clears NV_NOFREE attr, if any */ + nv_setattr(np,nofree); + } + /* Delete functions and built-ins. Note: fun_tree has a viewpath to bltin_tree */ for(np = dtfirst(sh.fun_tree); np; np = npnext) { if((dp = sh.fun_tree)->walk) - dp = dp->walk; + dp = dp->walk; /* the dictionary in which the item was found */ npnext = (Namval_t*)dtnext(sh.fun_tree,np); - nv_delete(np, dp, NV_NOFREE); - } - while(dp = dtview(sh.fun_tree, NULL)) - { - dtclose(sh.fun_tree); - sh.fun_tree = dp; - } - dtclear(sh.fun_base = sh.fun_tree); - /* Re-init built-ins as per nv_init() */ - free(sh.bltin_cmds); - sh.bltin_tree = sh_inittree((const struct shtable2*)shtab_builtins); - dtview(sh.fun_tree,sh.bltin_tree); - /* Delete aliases */ - for(np = dtfirst(sh.alias_tree); np; np = npnext) - { - if((dp = sh.alias_tree)->walk) - dp = dp->walk; - npnext = (Namval_t*)dtnext(sh.alias_tree,np); - _nv_unset(np,nv_isattr(np,NV_NOFREE)); - nv_delete(np,dp,0); - } - /* Delete hash table entries */ - for(np = dtfirst(sh.track_tree); np; np = npnext) - { - if((dp = sh.track_tree)->walk) - dp = dp->walk; - npnext = (Namval_t*)dtnext(sh.track_tree,np); - nofree = nv_isattr(np,NV_NOFREE); /* note: returns bitmask, not boolean */ - _nv_unset(np,NV_RDONLY); /* also clears NV_NOFREE attr, if any */ - nv_delete(np,dp,nofree); + if(dp==sh.bltin_tree) + { + if(np->nvalue.bfp) + sh_addbuiltin(nv_name(np), np->nvalue.bfp, pointerof(1)); + } + else if(is_afunction(np)) + { + _nv_unset(np,NV_RDONLY); + nv_delete(np,dp,NV_FUNCTION); + } } - while(dp = dtview(sh.track_tree, NULL)) + /* Delete all variables in a separate pass; this avoids 'no parent' errors while + * unsetting variables or discipline functions with dot names like .foo.bar */ + for(np = dtfirst(sh.var_tree); np; np = npnext) { - dtclose(sh.track_tree); - sh.track_tree = dp; + if((dp = sh.var_tree)->walk) + dp = dp->walk; /* the dictionary in which the item was found */ + npnext = (Namval_t*)dtnext(sh.var_tree,np); + /* cannot delete default variables */ + if(np >= sh.bltin_nodes && np < &sh.bltin_nodesnvars) + continue; + nv_delete(np,dp,nv_isattr(np,NV_NOFREE)); } + /* Reset state for subshells, environment, job control, function calls and file descriptors */ + sh.subshell = sh.realsubshell = sh.comsub = sh.curenv = sh.jobenv = sh.inuse_bits = sh.fn_depth = sh.dot_depth = 0; + sh.envlist = NULL; + sh.last_root = NULL; + /* Free up the dictionary trees themselves */ + freeup_tree(sh.fun_tree); /* includes sh.bltin_tree */ + freeup_tree(sh.alias_tree); + freeup_tree(sh.track_tree); + freeup_tree(sh.typedict); + freeup_tree(sh.var_tree); #if SHOPT_STATS - /* Reset statistics */ free(sh.stats); - stat_init(); + sh.stats = NULL; #endif - /* Reset shell options; inherit some */ - memset(&opt,0,sizeof(opt)); + /* Re-init variables, functions and built-ins */ + free(sh.bltin_cmds); + free(sh.bltin_nodes); + free(sh.mathnodes); + free(sh.init_context); + sh.init_context = nv_init(); + /* Re-import the environment (re-exported in exscript()) */ if(sh_isoption(SH_POSIX)) - on_option(&opt,SH_POSIX); -#if SHOPT_ESH - if(sh_isoption(SH_EMACS)) - on_option(&opt,SH_EMACS); - if(sh_isoption(SH_GMACS)) - on_option(&opt,SH_GMACS); -#endif -#if SHOPT_VSH - if(sh_isoption(SH_VI)) - on_option(&opt,SH_VI); - if(sh_isoption(SH_VIRAW)) - on_option(&opt,SH_VIRAW); -#endif - sh.options = opt; - /* set up new args */ - if(argv) - sh.arglist = sh_argcreate(argv); - if(sh.arglist) - sh_argreset(sh.arglist,NULL); - sh.shname = error_info.id = sh_strdup(sh.st.dolv0); - sh_offstate(SH_FORKED); - /* Reset traps and signals */ - memset(sh.st.trapcom,0,(sh.st.trapmax+1)*sizeof(char*)); - sh_sigreset(0); - /* increase SHLVL */ - if(!(SHLVL->nvalue.ip)) - { - shlvl = 0; - SHLVL->nvalue.ip = &shlvl; - nv_onattr(SHLVL,NV_INTEGER|NV_EXPORT|NV_NOFREE); - } - *SHLVL->nvalue.ip +=1; - nv_offattr(SHLVL,NV_IMPORT); - sh.st.filename = sh_strdup(sh.lastarg); - nv_delete(NULL, NULL, 0); - job.exitval = 0; - sh.inpipe = sh.outpipe = 0; - job_clear(); - job.in_critical = 0; - /* update $$, $PPID */ - sh.ppid = sh.current_ppid; - sh.pid = sh.current_pid; - /* restore an exported FPATH */ - if(savfpath) - { - nv_setattr(FPATHNOD,NV_EXPORT); - nv_putval(FPATHNOD,savfpath,0); - free(savfpath); - } + env_init(); + else + env_import_attributes(env_init()); + /* Increase SHLVL */ + shlvl++; /* call user init function, if any */ if(sh.userinit) (*sh.userinit)(&sh, 1); sh_offstate(SH_INIT); - return 1; } /* @@ -1791,7 +1773,8 @@ static void stat_init(void) { int i,nstat = STAT_SUBSHELL+1; - struct Stats *sp = sh_newof(0,struct Stats,1,nstat*NV_MINSZ); + size_t extrasize = nstat*(sizeof(int)+NV_MINSZ); + struct Stats *sp = sh_newof(0,struct Stats,1,extrasize); Namval_t *np; sp->numnodes = nstat; sp->nodes = (char*)(sp+1); @@ -1805,7 +1788,7 @@ nv_setsize(np,10); np->nvalue.ip = &sh.statsi; } - sp->hdr.dsize = sizeof(struct Stats) + nstat*(sizeof(int)+NV_MINSZ); + sp->hdr.dsize = sizeof(struct Stats) + extrasize; sp->hdr.disc = &stat_disc; nv_stack(SH_STATS,&sp->hdr); sp->hdr.nofree = 1; @@ -1818,7 +1801,7 @@ */ static Init_t *nv_init(void) { - double d=0; + Sfdouble_t d=0; Init_t *ip = sh_newof(0,Init_t,1,0); sh.nvfun.last = (char*)&sh; sh.nvfun.nofree = 1; @@ -1968,7 +1951,7 @@ np->nvname = (char*)tp->sh_name; treep = base_treep; } - np->nvenv = 0; + np->nvmeta = NULL; if(name_vals==(const struct shtable2*)shtab_builtins) np->nvalue.bfp = (void*)((struct shtable3*)tp)->sh_value; else @@ -2001,9 +1984,9 @@ static char *env_init(void) { char *cp; - Namval_t *np; char **ep=environ; char *next = 0; /* pointer to A__z env var */ + int save_env_n = 0; if(ep) { while(cp = *ep++) @@ -2013,18 +1996,20 @@ next = cp + 4; else if(strncmp(cp,"KSH_VERSION=",12)==0) continue; - else if(np = nv_open(cp,sh.var_tree,(NV_EXPORT|NV_IDENT|NV_ASSIGN|NV_NOFAIL))) - { - nv_onattr(np,NV_IMPORT); - np->nvenv = cp; - } - else /* swap with front */ - { - ep-1 = environsh.nenv; - environsh.nenv++ = cp; + if(!nv_open(cp,sh.var_tree,(NV_EXPORT|NV_IDENT|NV_ASSIGN|NV_NOFAIL)) && !sh.save_env_n) + { /* + * If the shell assignment via nv_open() failed, we cannot import this + * env var (invalid name); save it for sh_envgen() to pass it on to + * child processes. This does not need to be re-done after forking. + */ + save_env_n++; + sh.save_env = sh_realloc(sh.save_env, save_env_n*sizeof(char*)); + sh.save_envsave_env_n-1 = cp; } } } + if(save_env_n) + sh.save_env_n = save_env_n; if(nv_isnull(PWDNOD) || nv_isattr(PWDNOD,NV_TAGGED)) { nv_offattr(PWDNOD,NV_TAGGED); @@ -2048,7 +2033,7 @@ if(next = strchr(++cp,'=')) *next = 0; np = nv_search(cp+2,sh.var_tree,NV_ADD); - if(np!=SHLVL && nv_isattr(np,NV_IMPORT|NV_EXPORT)) + if(np!=SHLVL && nv_isattr(np,NV_EXPORT)) { int flag = *(unsigned char*)cp-' '; int size = *(unsigned char*)(cp+1)-' '; @@ -2080,7 +2065,7 @@ flag &= ~NV_RDONLY; /* refuse to import readonly attribute */ if(!flag) continue; - nv_newattr(np,flag|NV_IMPORT|NV_EXPORT,size); + nv_newattr(np,flag|NV_EXPORT,size); } } return;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/io.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/io.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -14,6 +14,7 @@ * Martijn Dekker <martijn@inlv.org> * * atheik <14833674+atheik@users.noreply.github.com> * * Johnothan King <johnothanking@protonmail.com> * +* K. Eugene Carlson <kvngncrlsn@gmail.com> * * * ***********************************************************************/ @@ -472,11 +473,11 @@ sh.errbuff = (char*)sh_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); - sfset(sfstdout,SF_LINE,0); - sfset(sfstderr,SF_LINE,0); - sfset(sfstdin,SF_SHARE|SF_PUBLIC,1); + sfpool(sfstdout,sh.outpool,SFIO_WRITE); + sfpool(sfstderr,sh.outpool,SFIO_WRITE); + sfset(sfstdout,SFIO_LINE,0); + sfset(sfstderr,SFIO_LINE,0); + sfset(sfstdin,SFIO_SHARE|SFIO_PUBLIC,1); } /* @@ -485,9 +486,9 @@ static int outexcept(Sfio_t *iop,int type,void *data,Sfdisc_t *handle) { static int active = 0; - if(type==SF_DPOP || type==SF_FINAL) + if(type==SFIO_DPOP || type==SFIO_FINAL) free(handle); - else if(type==SF_WRITE && (*(ssize_t*)data)<0 && sffileno(iop)!=2) + else if(type==SFIO_WRITE && (*(ssize_t*)data)<0 && sffileno(iop)!=2) switch (errno) { case EINTR: @@ -507,7 +508,7 @@ active = 1; ((struct checkpt*)sh.jmplist)->mode = 0; sfpurge(iop); - sfpool(iop,NULL,SF_WRITE); + sfpool(iop,NULL,SFIO_WRITE); errno = save; /* * Note: UNREACHABLE() is avoided here because this errormsg() call will return. @@ -535,7 +536,7 @@ { Sfio_t *iop; int status = sh_iocheckfd(fd); - int flags = SF_WRITE; + int flags = SFIO_WRITE; char *bp; Sfdisc_t *dp; if(status==IOCLOSE) @@ -554,18 +555,18 @@ if(status&IOREAD) { bp = (char *)sh_malloc(IOBSIZE+1); - flags |= SF_READ; + flags |= SFIO_READ; if(!(status&IOWRITE)) - flags &= ~SF_WRITE; + flags &= ~SFIO_WRITE; } else bp = sh.outbuff; if(status&IODUP) - flags |= SF_SHARE|SF_PUBLIC; + flags |= SFIO_SHARE|SFIO_PUBLIC; if((iop = sh.sftablefd) && sffileno(iop)>=0) { if(status&IOTTY) - sfset(iop,SF_LINE|SF_WCWIDTH,1); + sfset(iop,SFIO_LINE|SFIO_WCWIDTH,1); sfsetbuf(iop, bp, IOBSIZE); } else if(!(iop=sfnew((fd<=2?iop:0),bp,IOBSIZE,fd,flags))) @@ -573,16 +574,16 @@ dp = sh_newof(0,Sfdisc_t,1,0); if(status&IOREAD) { - sfset(iop,SF_MALLOC,1); + sfset(iop,SFIO_MALLOC,1); if(!(status&IOWRITE)) - sfset(iop,SF_IOCHECK,1); + sfset(iop,SFIO_IOCHECK,1); dp->exceptf = slowexcept; if(status&IOTTY) dp->readf = slowread; else if(status&IONOSEEK) { dp->readf = piperead; - sfset(iop, SF_IOINTR,1); + sfset(iop, SFIO_IOINTR,1); } else dp->readf = 0; @@ -595,7 +596,7 @@ dp->exceptf = pipeexcept; else dp->exceptf = outexcept; - sfpool(iop,sh.outpool,SF_WRITE); + sfpool(iop,sh.outpool,SFIO_WRITE); } sfdisc(iop,dp); sh.sftablefd = iop; @@ -667,7 +668,7 @@ sh.fdstatusf2 = (sh.fdstatusf1&~IOCLEX); sfsetfd(spnew,f2); sfswap(spnew,sp); - sfset(sp,SF_SHARE|SF_PUBLIC,1); + sfset(sp,SFIO_SHARE|SFIO_PUBLIC,1); } else { @@ -689,7 +690,7 @@ { sfsetfd(sp,f2); if(f2<=2) - sfset(sp,SF_SHARE|SF_PUBLIC,1); + sfset(sp,SFIO_SHARE|SFIO_PUBLIC,1); } if(f2>=sh.lim.open_max) sh_iovalidfd(f2); @@ -867,7 +868,7 @@ mode = IOREAD; if(fd >= sh.lim.open_max) sh_iovalidfd(fd); - if((sp = sh.sftablefd) && (sfset(sp,0,0) & SF_STRING)) + if((sp = sh.sftablefd) && (sfset(sp,0,0) & SFIO_STRING)) { int n,err=errno; if((n = sh_fcntl(fd,F_DUPFD,10)) >= 10) @@ -986,12 +987,12 @@ { char *cp, *match; int r, fd=sffileno(sp), close_exec = sh.fdstatusfd&IOCLEX; - int was_share,s=(PIPE_BUF>SF_BUFSIZE?SF_BUFSIZE:PIPE_BUF); + int was_share,s=(PIPE_BUF>SFIO_BUFSIZE?SFIO_BUFSIZE:PIPE_BUF); size_t n,m; sh.fdstatussffileno(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))) + was_share = sfset(sp,SFIO_SHARE,1); + while((cp=sfreserve(sp, -s, SFIO_LOCKR)) || (cp=sfreserve(sp,SFIO_UNBOUND, SFIO_LOCKR))) { m = n = sfvalue(sp); while(n>0 && cpn-1!='\n') @@ -1014,8 +1015,8 @@ } if(!close_exec) sh.fdstatussffileno(sp) &= ~IOCLEX; - if(fd==0 && !(was_share&SF_SHARE)) - sfset(sp, SF_SHARE,0); + if(fd==0 && !(was_share&SFIO_SHARE)) + sfset(sp, SFIO_SHARE,0); return 0; } @@ -1122,11 +1123,11 @@ { Sfoff_t off; char *fname; - int fd, iof; + int fd = -1, iof; const char *message = e_open; int o_mode; /* mode flag for open */ static char io_op7; /* used for -x trace info */ - int trunc=0, clexec=0, fn, traceon; + int trunc=0, clexec=0, fn, traceon=0; int r, indx = sh.topfd, perm= -1; char *tname=0, *after="", *trace = sh.st.trapSH_DEBUGTRAP; Namval_t *np=0; @@ -1189,7 +1190,7 @@ { if(iof&IOLSEEK) { - struct argnod *ap = (struct argnod*)stkalloc(sh.stk,ARGVAL+strlen(iop->ioname)); + struct argnod *ap = stkalloc(sh.stk,ARGVAL+strlen(iop->ioname)); memset(ap, 0, ARGVAL); ap->argflag = ARG_MAC; strcpy(ap->argval,iop->ioname); @@ -1201,7 +1202,7 @@ if((iof&IOPROCSUB) && !(iof&IOLSEEK)) { /* handle process substitution passed to redirection */ - struct argnod *ap = (struct argnod*)stkalloc(sh.stk,ARGVAL+strlen(iop->ioname)); + struct argnod *ap = stkalloc(sh.stk,ARGVAL+strlen(iop->ioname)); memset(ap, 0, ARGVAL); if(iof&IOPUT) ap->argflag = ARG_RAW; @@ -1401,7 +1402,7 @@ sfprintf(sfstderr,"%s %s%s%c",io_op,fname,after,iop->ionxt?' ':'\n'); } if(flag==SH_SHOWME) - return indx; + continue; if(trace && fname) { char *argv7, **av=argv; @@ -1620,12 +1621,12 @@ if(fno>=0 || (iop->iofile&IOQUOTE)) { /* This is a quoted here-document, not expansion */ - sfmove(infile,tmp,SF_UNBOUND,-1); + sfmove(infile,tmp,SFIO_UNBOUND,-1); sfclose(infile); if(sffileno(tmp)>0) { sfsetbuf(tmp,sh_malloc(IOBSIZE+1),IOBSIZE); - sfset(tmp,SF_MALLOC,1); + sfset(tmp,SFIO_MALLOC,1); } sfseek(sh.heredocs,off,SEEK_SET); if(fno>=0) @@ -1670,7 +1671,7 @@ */ void sh_iosave(int origfd, int oldtop, char *name) { - int savefd; + int savefd; int flag = (oldtop&(IOSUBSHELL|IOPICKFD)); oldtop &= ~(IOSUBSHELL|IOPICKFD); /* see if already saved, only save once */ @@ -1768,7 +1769,7 @@ */ void sh_iorestore(int last, int jmpval) { - int origfd, savefd, fd; + int origfd, savefd, fd; int flag = (last&IOSUBSHELL); last &= ~IOSUBSHELL; for (fd = sh.topfd - 1; fd >= last; fd--) @@ -1865,14 +1866,14 @@ static int slowexcept(Sfio_t *iop,int type,void *data,Sfdisc_t *handle) { int n,fno; - if(type==SF_DPOP || type==SF_FINAL) + if(type==SFIO_DPOP || type==SFIO_FINAL) free(handle); - if(type==SF_WRITE && ERROR_PIPE(errno)) + if(type==SFIO_WRITE && ERROR_PIPE(errno)) { sfpurge(iop); return -1; } - if(type!=SF_READ) + if(type!=SFIO_READ) return 0; if((sh.trapnote&(SH_SIGSET|SH_SIGTRAP)) && errno!=EIO && errno!=ENXIO) errno = EINTR; @@ -1960,7 +1961,7 @@ if(sh_isstate(SH_INTERACTIVE) && fd==0 && io_prompt(iop,sh.nextprompt)<0 && errno==EIO) return 0; sh_onstate(SH_TTYWAIT); - if(!(sh.fdstatusfd&IOCLEX) && (sfset(iop,0,0)&SF_SHARE)) + if(!(sh.fdstatusfd&IOCLEX) && (sfset(iop,0,0)&SFIO_SHARE)) size = ed_read(sh.ed_context, fd, (char*)buff, size,0); else size = sfrd(iop,buff,size,handle); @@ -2014,7 +2015,7 @@ sh_timerdel(timeout); timeout=0; #if SHOPT_HISTEXPAND - if(rsize && *(char*)buff != '\n' && sh.nextprompt==1 && sh_isoption(SH_HISTEXPAND)) + if(rsize > 0 && *(char*)buff != '\n' && sh.nextprompt==1 && sh_isoption(SH_HISTEXPAND)) { int r; ((char*)buff)rsize = '\0'; @@ -2155,7 +2156,7 @@ flag = 0; if(flag==0) return sfsync(sfstderr); - sfflags = sfset(sfstderr,SF_SHARE|SF_PUBLIC|SF_READ,0); + sfflags = sfset(sfstderr,SFIO_SHARE|SFIO_PUBLIC|SFIO_READ,0); if(!(sh.prompt=(char*)sfreserve(sfstderr,0,0))) sh.prompt = ""; switch(flag) @@ -2200,7 +2201,7 @@ /* PS2 prompt. Save stack state to avoid corrupting command substitutions * in case we're executing a PS2.get discipline function at parse time. */ int savestacktop = stktell(sh.stk); - char *savestackptr = stkfreeze(sh.stk,0); + void *savestackptr = stkfreeze(sh.stk,0); cp = nv_getval(sh_scoped(PS2NOD)); stkset(sh.stk, savestackptr, savestacktop); break; @@ -2216,7 +2217,7 @@ done: if(*sh.prompt && (endprompt=(char*)sfreserve(sfstderr,0,0))) *endprompt = 0; - sfset(sfstderr,sfflags&SF_READ|SF_SHARE|SF_PUBLIC,1); + sfset(sfstderr,sfflags&SFIO_READ|SFIO_SHARE|SFIO_PUBLIC,1); return sfsync(sfstderr); } @@ -2226,9 +2227,9 @@ */ static int pipeexcept(Sfio_t* iop, int mode, void *data, Sfdisc_t* handle) { - if(mode==SF_DPOP || mode==SF_FINAL) + if(mode==SFIO_DPOP || mode==SFIO_FINAL) free(handle); - else if(mode==SF_WRITE && ERROR_PIPE(errno)) + else if(mode==SFIO_WRITE && ERROR_PIPE(errno)) { sfpurge(iop); return -1; @@ -2245,21 +2246,21 @@ struct checkpt *pp; int mode; int newfd = integralof(data); - if(flag==SF_SETFD || flag==SF_CLOSING) + if(flag==SFIO_SETFD || flag==SFIO_CLOSING) { if(newfd<0) - flag = SF_CLOSING; + flag = SFIO_CLOSING; if(fdnotify) - (*fdnotify)(sffileno(sp),flag==SF_CLOSING?-1:newfd); + (*fdnotify)(sffileno(sp),flag==SFIO_CLOSING?-1:newfd); } #ifdef DEBUG - if(flag==SF_READ || flag==SF_WRITE) + if(flag==SFIO_READ || flag==SFIO_WRITE) { - char *z = fmtbase((intmax_t)sh.current_pid,0,0); + char *z = fmtint(sh.current_pid,0); write(ERRIO,z,strlen(z)); write(ERRIO,": ",2); write(ERRIO,"attempt to ",11); - if(flag==SF_READ) + if(flag==SFIO_READ) write(ERRIO,"read from",9); else write(ERRIO,"write to",8); @@ -2272,20 +2273,20 @@ if(sh_isstate(SH_NOTRACK)) return; mode = sfset(sp,0,0); - if(sp==sh.heredocs && fd < 10 && flag==SF_SETFD) + if(sp==sh.heredocs && fd < 10 && flag==SFIO_SETFD) { fd = sfsetfd(sp,10); fcntl(fd,F_SETFD,FD_CLOEXEC); } if(fd < 3) return; - if(flag==SF_NEW) + if(flag==SFIO_NEW) { if(!sh.sftablefd && sh.fdstatusfd==IOCLOSE) { sh.sftablefd = sp; - flag = (mode&SF_WRITE)?IOWRITE:0; - if(mode&SF_READ) + flag = (mode&SFIO_WRITE)?IOWRITE:0; + if(mode&SFIO_READ) flag |= IOREAD; sh.fdstatusfd = flag; sh_iostream(fd); @@ -2306,7 +2307,7 @@ if(fdnotify) (*fdnotify)(-1,sffileno(sp)); } - else if(flag==SF_CLOSING || (flag==SF_SETFD && newfd<=2)) + else if(flag==SFIO_CLOSING || (flag==SFIO_SETFD && newfd<=2)) { sh.sftablefd = 0; sh.fdstatusfd=IOCLOSE; @@ -2368,11 +2369,11 @@ int len; /* no more to do */ - if(type!=SF_READ || !(cp = ep->argv0)) + if(type!=SFIO_READ || !(cp = ep->argv0)) { - if(type==SF_CLOSING) - sfdisc(iop,SF_POPDISC); - else if(ep && (type==SF_DPOP || type==SF_FINAL)) + if(type==SFIO_CLOSING) + sfdisc(iop,SFIO_POPDISC); + else if(ep && (type==SFIO_DPOP || type==SFIO_FINAL)) free(ep); return 0; } @@ -2410,7 +2411,7 @@ disp->oldsp = sp; disp->offset = offset; disp->size = disp->left = size; - sp = sfnew(NULL,(char*)(disp+1),IOBSIZE,PSEUDOFD,SF_READ); + sp = sfnew(NULL,(char*)(disp+1),IOBSIZE,PSEUDOFD,SFIO_READ); sfdisc(sp,&disp->disc); return sp; } @@ -2441,23 +2442,23 @@ static int subexcept(Sfio_t* sp,int mode, void *data, Sfdisc_t* handle) { struct subfile *disp = (struct subfile*)handle; - if(mode==SF_CLOSING) + if(mode==SFIO_CLOSING) { - sfdisc(sp,SF_POPDISC); + sfdisc(sp,SFIO_POPDISC); sfsetfd(sp,-1); return 0; } - else if(disp && (mode==SF_DPOP || mode==SF_FINAL)) + else if(disp && (mode==SFIO_DPOP || mode==SFIO_FINAL)) { free(disp); return 0; } - else if (mode==SF_ATEXIT) + else if (mode==SFIO_ATEXIT) { - sfdisc(sp, SF_POPDISC); + sfdisc(sp, SFIO_POPDISC); return 0; } - else if(mode==SF_READ) + else if(mode==SFIO_READ) return 0; return -1; } @@ -2553,7 +2554,7 @@ off_t sh_seek(int fd, off_t offset, int whence) { Sfio_t *sp; - if((sp=sh.sftablefd) && (sfset(sp,0,0)&(SF_READ|SF_WRITE))) + if((sp=sh.sftablefd) && (sfset(sp,0,0)&(SFIO_READ|SFIO_WRITE))) return sfseek(sp,offset,whence); else return lseek(fd,offset,whence); @@ -2614,7 +2615,7 @@ /* * give file descriptor <fd> and <mode>, return an iostream pointer - * <mode> must be SF_READ or SF_WRITE + * <mode> must be SFIO_READ or SFIO_WRITE * <fd> must be a non-negative number ofr SH_IOCOPROCESS or SH_IOHISTFILE. * returns NULL on failure and may set errno. */ @@ -2622,7 +2623,7 @@ { int n; Sfio_t *iop=0; - if(mode!=SF_READ && mode!=SF_WRITE) + if(mode!=SFIO_READ && mode!=SFIO_WRITE) { errno = EINVAL; return iop; @@ -2635,7 +2636,7 @@ fd = sffileno(sh.hist_ptr->histfp); break; case SH_IOCOPROCESS: - if(mode==SF_WRITE) + if(mode==SFIO_WRITE) fd = sh.coutpipe; else fd = sh.cpipe0; @@ -2651,9 +2652,9 @@ } if(!(n=sh.fdstatusfd)) n = sh_iocheckfd(fd); - if(mode==SF_WRITE && !(n&IOWRITE)) + if(mode==SFIO_WRITE && !(n&IOWRITE)) return iop; - if(mode==SF_READ && !(n&IOREAD)) + if(mode==SFIO_READ && !(n&IOREAD)) return iop; if(!(iop = sh.sftablefd)) iop=sh_iostream(fd); @@ -2678,9 +2679,9 @@ { int flags=0; if(status&IOREAD) - flags |= SF_READ; + flags |= SFIO_READ; if(status&IOWRITE) - flags |= SF_WRITE; + flags |= SFIO_WRITE; sp = sfnew(NULL, NULL, -1, fd,flags); sh.sftablefd = sp; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/jobs.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/jobs.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -179,23 +179,8 @@ static struct termios my_stty; /* terminal state for shell */ static char *job_string; - static void job_unstop(struct process*); + static void job_unstop(struct process*, int); static void job_fgrp(struct process*, int); -#ifndef _lib_tcgetpgrp -# ifdef TIOCGPGRP - static int _i_; -# define tcgetpgrp(a) (ioctl(a, TIOCGPGRP, &_i_)>=0?_i_:-1) -# endif /* TIOCGPGRP */ - int tcsetpgrp(int fd,pid_t pgrp) - { - int pgid = pgrp; -# ifdef TIOCGPGRP - return ioctl(fd, TIOCSPGRP, &pgid); -# else - return -1; -# endif /* TIOCGPGRP */ - } -#endif /* _lib_tcgetpgrp */ #ifndef OTTYDISC # undef NTTYDISC @@ -553,7 +538,6 @@ /* This should have already been done by rlogin */ int fd; char *ttynam; - setpgid(0,sh.pid); if(job.mypgid<0 || !(ttynam=ttyname(JOBTTY))) return; while(close(JOBTTY)<0 && errno==EINTR) @@ -738,7 +722,7 @@ tcsetpgrp(job.fd,pw->p_fgrp); /* if job is stopped, resume it in the background */ if(!sh.forked) - job_unstop(pw); + job_unstop(pw,1); sh.forked = 0; } @@ -969,14 +953,24 @@ } /* + * Helper function for job_kill(). + * sh.1: "If the signal being sent is TERM (terminate) or HUP (hangup), then + * the job or process will be sent a CONT (continue) signal if it is stopped." + * As this is not specified anywhere in POSIX, this is disabled for POSIX mode. + */ +static int also_send_sigcont(struct process *pw,int sig) +{ + return !sh_isoption(SH_POSIX) && (sig==SIGHUP || sig==SIGTERM) && pw && (pw->p_flag & P_STOPPED); +} + +/* * Kill a job or process */ int job_kill(struct process *pw,int sig) { pid_t pid; - int r; + int r = -1; const char *msg; - int stopsig = (sig==SIGSTOP||sig==SIGTSTP||sig==SIGTTIN||sig==SIGTTOU); job_lock(); errno = ECHILD; if(!pw) @@ -992,26 +986,28 @@ errno = EPERM; r = -1; } - else + else if(pid>=0) { - if(pid>=0) + r = kill(pid,sig); + if(r>=0) { - if((r = kill(pid,sig))>=0 && !stopsig) - { - if(pw->p_flag&P_STOPPED) - pw->p_flag &= ~(P_STOPPED|P_SIGNALLED); - if(sig) - kill(pid,SIGCONT); - } + if(also_send_sigcont(pw,sig)) + kill(pid,sig = SIGCONT); + if(sig==SIGCONT && (pw->p_flag&P_STOPPED)) + pw->p_flag &= ~(P_STOPPED|P_SIGNALLED|P_NOTIFY); } - else + } + else + { + pid = -pid; + pw = job_bypid(pid); + r = killpg(pid,sig); + if(r>=0) { - if((r = killpg(-pid,sig))>=0 && !stopsig) - { - job_unstop(job_bypid(pw->p_pid)); - if(sig) - killpg(-pid,SIGCONT); - } + if(sig==SIGCONT) + job_unstop(pw,0); + else if(also_send_sigcont(pw,sig)) + job_unstop(pw,1); } } } @@ -1020,15 +1016,22 @@ if(pid = pw->p_pgrp) { r = killpg(pid,sig); - if(r>=0 && (sig==SIGHUP||sig==SIGTERM || sig==SIGCONT)) - job_unstop(pw); if(r>=0) + { + if(sig==SIGCONT) + job_unstop(pw,0); + else if(also_send_sigcont(pw,sig)) + job_unstop(pw,1); sh_delay(.05,0); + } } while(pw && pw->p_pgrp==0 && (r=kill(pw->p_pid,sig))>=0) { - if(sig==SIGHUP || sig==SIGTERM) + if(also_send_sigcont(pw,sig)) + { kill(pw->p_pid,SIGCONT); + pw->p_flag &= ~(P_STOPPED|P_SIGNALLED|P_NOTIFY); + } pw = pw->p_nxtproc; } } @@ -1069,7 +1072,7 @@ if(!(px->p_flag & P_DONE)) { if(killpg(pw->p_pgrp, SIGHUP) >= 0) - job_unstop(pw); + job_unstop(pw,1); break; } } @@ -1568,7 +1571,7 @@ job.waitall = 0; } else if(pw->p_flag&P_STOPPED) - job_unstop(pw); + job_unstop(pw,1); job_unlock(); return 0; } @@ -1585,7 +1588,7 @@ /* * turn off STOP state of a process group and send CONT signals */ -static void job_unstop(struct process *px) +static void job_unstop(struct process *px, int send_sigcont) { struct process *pw; int num = 0; @@ -1597,7 +1600,7 @@ pw->p_flag &= ~(P_STOPPED|P_SIGNALLED|P_NOTIFY); } } - if(num!=0) + if(num && send_sigcont) { if(px->p_fgrp != px->p_pgrp) killpg(px->p_fgrp,SIGCONT);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/lex.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/lex.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -94,7 +94,8 @@ else { int n,offset = stktell(sh.stk); - char *savptr,*begin; + void *savptr; + char *begin; off = offset + (fcseek(0)-(type+1)) - fcfirst(); if(lp->lexd.kiaoff < offset) { @@ -152,7 +153,7 @@ size -= (lp->lexd.first-(char*)buff); buff = lp->lexd.first; if(!lp->lexd.noarg) - lp->arg = (struct argnod*)stkseek(sh.stk,ARGVAL); + lp->arg = stkseek(sh.stk,ARGVAL); #if SHOPT_KIA lp->lexd.kiaoff += ARGVAL; #endif /* SHOPT_KIA */ @@ -248,6 +249,8 @@ int n, c, mode=ST_BEGIN, wordflags=0; int inlevel=lp->lexd.level, assignment=0, ingrave=0; int epatchar=0; + char *varnamefirst = NULL; + int varnamelength = 0; SETLEN(1); if(lp->lexd.paren) { @@ -639,6 +642,7 @@ } /* FALLTHROUGH */ case S_RES: + varnamefirst = fcseek(0) - LEN; if(!lp->lexd.dolparen) lp->lexd.first = fcseek(0)-LEN; else if(lp->lexd.docword) @@ -838,6 +842,8 @@ poplevel(lp); break; case S_DOT: + if(varnamelength && fcpeek(-LEN - 1)=='') + varnamelength = 0; /* make sure next character is alpha */ if(fcgetc(n)>0) { @@ -1102,6 +1108,12 @@ goto epat; continue; case S_EQ: + if(varnamefirst && !varnamelength) + { + varnamelength = fcseek(0) - LEN - varnamefirst; + if(varnamelength > 0 && fcpeek(-LEN - 1) == '+') + varnamelength--; /* += */ + } assignment = lp->assignok; /* FALLTHROUGH */ case S_COLON: @@ -1116,6 +1128,8 @@ } break; case S_BRACT: + if(varnamefirst && !varnamelength && fcpeek(-LEN - 1)!='.') + varnamelength = fcseek(0) - LEN - varnamefirst; /* check for possible subscript */ if((n=endchar(lp))==RBRACT || n==RPAREN || (mode==ST_BRACE) || @@ -1241,7 +1255,7 @@ state = fcfirst(); n = fcseek(0)-(char*)state; if(!lp->arg) - lp->arg = (struct argnod*)stkseek(sh.stk,ARGVAL); + lp->arg = stkseek(sh.stk,ARGVAL); if(n>0) sfwrite(sh.stk,state,n); sfputc(sh.stk,0); @@ -1275,7 +1289,7 @@ { /* Redirection of the form {varname}>file, etc. */ stkseek(sh.stk,stktell(sh.stk)-1); - lp->arg = (struct argnod*)stkfreeze(sh.stk,1); + lp->arg = stkfreeze(sh.stk,1); return lp->token=IOVNAME; } c = wordflags; @@ -1299,7 +1313,7 @@ } if(c==0 || (c&(ARG_MAC|ARG_EXP|ARG_MESSAGE))) { - lp->arg = (struct argnod*)stkfreeze(sh.stk,1); + lp->arg = stkfreeze(sh.stk,1); lp->arg->argflag = (c?c:ARG_RAW); } else if(mode==ST_NONE) @@ -1311,6 +1325,7 @@ if(assignment) { lp->arg->argflag |= ARG_ASSIGN; + lp->varnamelength = varnamelength; if(sh_isoption(SH_NOEXEC)) { char *cp = strchr(state, '='); @@ -2107,7 +2122,7 @@ Sfio_t *top; while(fcget()>0); fcclose(); - while(top=sfstack(sp,SF_POPSTACK)) + while(top=sfstack(sp,SFIO_POPSTACK)) sfclose(top); } else @@ -2197,7 +2212,7 @@ stkseek(sh.stk,dp - (unsigned char*)stkptr(sh.stk,0)); if(mode<=0) { - argp = (struct argnod*)stkfreeze(sh.stk,0); + argp = stkfreeze(sh.stk,0); argp->argflag = ARG_RAW|ARG_QUOTED; } return argp; @@ -2406,19 +2421,19 @@ Namval_t *np; Lex_t *lp; NOT_USED(data); - if(type==0 || type==SF_ATEXIT || !ap) + if(type==0 || type==SFIO_ATEXIT || !ap) return 0; lp = ap->lp; np = ap->np; - if(type!=SF_READ) + if(type!=SFIO_READ) { - if(type==SF_CLOSING) + if(type==SFIO_CLOSING) { - Sfdisc_t *dp = sfdisc(iop,SF_POPDISC); + Sfdisc_t *dp = sfdisc(iop,SFIO_POPDISC); if(dp!=handle) sfdisc(iop,dp); } - else if(type==SF_DPOP || type==SF_FINAL) + else if(type==SFIO_DPOP || type==SFIO_FINAL) free(ap); goto done; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/macro.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/macro.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -83,7 +83,7 @@ #define isescchar(s) ((s)>S_QUOTE) #define isqescchar(s) ((s)>=S_QUOTE) #define isbracechar(c) ((c)==RBRACE || (_c_=sh_lexstatesST_BRACEc)==S_MOD1 ||_c_==S_MOD2) -#define ltos(x) fmtbase((intmax_t)(x),0,0) +#define ltos(x) fmtint(x,0) /* type of macro expansions */ #define M_BRACE 1 /* ${var} */ @@ -157,7 +157,7 @@ Mac_t savemac = *mp; stkseek(stkp,0); mp->arith = (mode==3); - sh.argaddr = 0; + nv_setoptimize(NULL); mp->pattern = (mode==1||mode==2); mp->patfound = 0; mp->assign = 0; @@ -198,7 +198,7 @@ int flags = argp->argflag; char *str = argp->argval; Mac_t *mp = (Mac_t*)sh.mac_context; - char **saveargaddr = sh.argaddr; + char **saveoptimize = nv_getoptimize(); Mac_t savemac = *mp; Stk_t *stkp = sh.stk; mp->sp = 0; @@ -207,9 +207,9 @@ else mp->ifs = ' '; if((flag&ARG_OPTIMIZE) && !sh.indebug && !(flags&ARG_MESSAGE)) - sh.argaddr = (char**)&argp->argchn.ap; + nv_setoptimize((char**)&argp->argchn.ap); else - sh.argaddr = 0; + nv_setoptimize(NULL); mp->arghead = arghead; mp->quoted = mp->lit = mp->quote = 0; mp->arith = ((flag&ARG_ARITH)!=0); @@ -239,17 +239,17 @@ if(!arghead) { argp->argchn.cp = stkfreeze(stkp,1); - if(sh.argaddr) + if(nv_getoptimize()) argp->argflag |= ARG_MAKE; } else { endfield(mp,mp->quoted|mp->atmode); flags = mp->fields; - if(flags==1 && sh.argaddr) + if(flags==1 && nv_getoptimize()) argp->argchn.ap = *arghead; } - sh.argaddr = saveargaddr; + nv_setoptimize(saveoptimize); *mp = savemac; return flags; } @@ -269,7 +269,7 @@ Mac_t savemac = *mp; Stk_t *stkp = sh.stk; stkseek(stkp,0); - sh.argaddr = 0; + nv_setoptimize(NULL); mp->sp = outfile; mp->split = mp->assign = mp->pattern = mp->patfound = mp->lit = mp->arith = 0; mp->quote = 1; @@ -1029,7 +1029,7 @@ { int n; char *sp; - sh.argaddr = 0; + nv_setoptimize(NULL); while(nv_isref(np) && np->nvalue.cp) { sub = nv_refsub(np); @@ -1102,7 +1102,7 @@ } d; memset(&t,0,sizeof(t)); memset(&d,0,sizeof(d)); - t.node.com.comarg = &d.arg; + t.node.com.comarg.ap = &d.arg; t.node.com.comline = sh.inlineno; d.dol.dolnum = 1; d.dol.dolval0 = sh_strdup(name); @@ -1145,7 +1145,7 @@ { int c; int type=0; /* M_xxx */ - char *v,*argp=0; + char *v = NULL, *argp = NULL; Namval_t *np = NULL; int dolg=0, mode=0; Lex_t *lp = (Lex_t*)sh.lex_context; @@ -1232,7 +1232,7 @@ case S_DIG: var = 0; c -= '0'; - sh.argaddr = 0; + nv_setoptimize(NULL); if(type) { int d; @@ -1288,7 +1288,7 @@ while((d=c,(c=fcmbget(&LEN)),isaname(c))||type && c=='.'); while(c==LBRACT && (type||mp->arrayok)) { - sh.argaddr=0; + nv_setoptimize(NULL); if((c=fcmbget(&LEN),isastchar(c)) && fcpeek(0)==RBRACT && d!='.') { if(type==M_VNAME) @@ -1375,13 +1375,13 @@ #if SHOPT_FILESCAN else if(sh.cur_line && strcmp(id,REPLYNOD->nvname)==0) { - sh.argaddr=0; + nv_setoptimize(NULL); np = REPLYNOD; } #endif /* SHOPT_FILESCAN */ else { - if(sh.argaddr) + if(nv_getoptimize()) flag &= ~NV_NOADD; np = nv_open(id,sh.var_tree,flag|NV_NOFAIL); } @@ -1473,20 +1473,18 @@ if(cc==0) mp->assign = 1; } - if((type==M_VNAME||type==M_SUBNAME) && sh.argaddr && strcmp(nv_name(np),id)) - sh.argaddr = 0; + if((type==M_VNAME||type==M_SUBNAME) && nv_getoptimize() && strcmp(nv_name(np),id)) + nv_setoptimize(NULL); c = (type>M_BRACE && isastchar(mode)); /* * Check if the parameter is set or unset. */ -#if SHOPT_OPTIMIZE - if(np && type==M_BRACE && sh.argaddr) + if(np && type==M_BRACE && nv_getoptimize()) nv_optimize(np); /* needed before calling nv_isnull() */ -#endif /* SHOPT_OPTIMIZE */ if(np && (type==M_BRACE ? !nv_isnull(np) : (type==M_TREE || !c || !ap))) { /* Either the parameter is set, or it's a special type of expansion where 'unset' doesn't apply. */ - char *savptr; + void *savptr; c = *((unsigned char*)stkptr(stkp,offset-1)); savptr = stkfreeze(stkp,0); if(type==M_VNAME || (type==M_SUBNAME && ap)) @@ -1558,10 +1556,8 @@ if(ap) { ap = nv_arrayptr(np_orig); /* update */ -#if SHOPT_OPTIMIZE - if(sh.argaddr) + if(nv_getoptimize()) nv_optimize(np); -#endif if(isastchar(mode) && array_elem(ap)> !c) dolg = -1; else @@ -1625,6 +1621,7 @@ } else { + /* type==M_SIZE: ${#var} */ if(!isastchar(mode)) c = charlen(v,vsize); else if(dolg>0) @@ -1893,7 +1890,7 @@ { int ofs_size = 0; int match2*(MATCH_MAX+1),index; - int nmatch, nmatch_prev, vsize_last, tsize; + int nmatch, nmatch_prev, vsize_last = 0, tsize; char *vlast = NULL, *oldv; while(1) { @@ -2160,7 +2157,8 @@ struct slnod *saveslp = sh.st.staklist; Mac_t savemac = *mp; int savtop = stktell(stkp); - char lastc=0, *savptr = stkfreeze(stkp,0); + char lastc = '\0'; + void *savptr = stkfreeze(stkp,0); int was_history = sh_isstate(SH_HISTORY); int was_verbose = sh_isstate(SH_VERBOSE); int was_interactive = sh_isstate(SH_INTERACTIVE); @@ -2168,7 +2166,7 @@ Sfoff_t foff; Namval_t *np; savemac.wasexpan = 1; - sh.argaddr = 0; + nv_setoptimize(NULL); sh.st.staklist=0; if(type) { @@ -2222,7 +2220,7 @@ sh_offstate(SH_VERBOSE); if(mp->sp) sfsync(mp->sp); /* flush before executing command */ - sp = sfnew(NULL,str,c,-1,SF_STRING|SF_READ); + sp = sfnew(NULL,str,c,-1,SFIO_STRING|SFIO_READ); c = sh.inlineno; sh.inlineno = error_info.line+sh.st.firstline; t = (Shnode_t*)sh_parse(sp,SH_EOF|SH_NL); @@ -2233,7 +2231,7 @@ { fcsave(&save); sfclose(sp); - if(t->tre.tretyp==0 && !t->com.comarg && !t->com.comset) + if(t->tre.tretyp==0 && !t->com.comarg.dp && !t->com.comset) { /* special case $(<file) and $(<#file) */ int fd; @@ -2259,7 +2257,7 @@ if(!(sp=sh.sftablefd)) { char *cp = (char*)sh_malloc(IOBSIZE+1); - sp = sfnew(NULL,cp,IOBSIZE,fd,SF_READ|SF_MALLOC); + sp = sfnew(NULL,cp,IOBSIZE,fd,SFIO_READ|SFIO_MALLOC); } } else @@ -2287,7 +2285,7 @@ sfsetbuf(sp,sp,0); bufsize = sfvalue(sp); /* read command substitution output and put on stack or here-doc */ - sfpool(sp, NULL, SF_WRITE); + sfpool(sp, NULL, SFIO_WRITE); sh_offstate(SH_INTERACTIVE); if((foff = sfseek(sp,0,SEEK_END)) > 0) { @@ -2296,7 +2294,7 @@ stkseek(stkp,soff+foff+64); stkseek(stkp,soff); } - while((str=(char*)sfreserve(sp,SF_UNBOUND,0)) && (c=bufsize=sfvalue(sp))>0) + while((str=(char*)sfreserve(sp,SFIO_UNBOUND,0)) && (c=bufsize=sfvalue(sp))>0) { #if SHOPT_CRNL /* eliminate <cr> */ @@ -2576,14 +2574,14 @@ Stk_t *stkp = sh.stk; if(stktell(stkp) > ARGVAL || split) { - argp = (struct argnod*)stkfreeze(stkp,1); + argp = stkfreeze(stkp,1); argp->argnxt.cp = 0; argp->argflag = 0; mp->atmode = 0; if(mp->patfound) { int musttrim = mp->wasexpan && !mp->quoted && !mp->noextpat && strchr(argp->argval,'\\'); - sh.argaddr = 0; + nv_setoptimize(NULL); #if SHOPT_BRACEPAT /* in POSIX mode, disallow brace expansion for unquoted expansions */ if(sh_isoption(SH_BRACEEXPAND) && !(sh_isoption(SH_POSIX) && mp->pattern==1)) @@ -2710,25 +2708,23 @@ char *cp = NULL; /* character pointer for tilde expansion result */ char *stakp = stkptr(sh.stk,0); /* current stack object (&stakpoffset is tilde string) */ int curoff = stktell(sh.stk); /* current offset of current stack object */ + sfputc(sh.stk,0); /* terminate current stack object to avoid data corruption */ /* * Allow overriding tilde expansion with a .sh.tilde.set or .get discipline function. */ if(!sh.tilde_block && SH_TILDENOD->nvfun && SH_TILDENOD->nvfun->disc) { - stkfreeze(sh.stk,1); /* terminate current stack object to avoid data corruption */ sh.tilde_block = 1; nv_putval(SH_TILDENOD, &stakpoffset, 0); cp = nv_getval(SH_TILDENOD); sh.tilde_block = 0; if(cp0=='\0' || cp0=='~') cp = NULL; /* do not use empty or unexpanded result */ - stkset(sh.stk,stakp,curoff); /* restore stack to state on function entry */ } /* * Perform default tilde expansion unless overridden. * Write the result to the stack, if any. */ - sfputc(sh.stk,0); if(!cp) cp = sh_tilde(&stakpoffset); if(cp) @@ -2829,7 +2825,7 @@ static char *special(int c) { if(c!='$') - sh.argaddr = 0; + nv_setoptimize(NULL); switch(c) { case '@': @@ -2892,7 +2888,7 @@ */ static char *mac_getstring(char *pattern) { - char *cp=pattern, *rep=0, *dp; + char *cp = pattern, *rep = NULL, *dp = NULL; int c; while(c = *cp++) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/main.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/main.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -40,9 +40,6 @@ #include "history.h" #include "timeout.h" #include "FEATURE/time" -#include "FEATURE/pstat" -#include "FEATURE/setproctitle" -#include "FEATURE/execargs" #include "FEATURE/externs" #ifdef _hdr_nc # include <nc.h> @@ -67,7 +64,7 @@ static time_t mailtime; static char beenhere = 0; -#ifdef _lib_sigvec +#if _lib_sigvec void clearsigmask(int sig) { struct sigvec vec; @@ -119,7 +116,7 @@ int i; int rshflag; /* set for restricted shell */ char *command; -#ifdef _lib_sigvec +#if _lib_sigvec /* This is to clear mask that may be left on by rlogin */ clearsigmask(SIGALRM); clearsigmask(SIGHUP); @@ -136,9 +133,8 @@ if(sigsetjmp(*((sigjmp_buf*)sh.jmpbuffer),0)) { /* begin script execution here */ - sh_reinit(NULL); + sh_reinit(); } - sh.fn_depth = sh.dot_depth = 0; command = error_info.id; path_pwd(); iop = NULL; @@ -233,7 +229,7 @@ if(sh.comdiv) { shell_c: - iop = sfnew(NULL,sh.comdiv,strlen(sh.comdiv),0,SF_STRING|SF_READ); + iop = sfnew(NULL,sh.comdiv,strlen(sh.comdiv),0,SFIO_STRING|SFIO_READ); } else { @@ -453,9 +449,23 @@ { while(fcget()>0); fcclose(); - while(top=sfstack(iop,SF_POPSTACK)) + while(top=sfstack(iop,SFIO_POPSTACK)) sfclose(top); } + /* + * Reset the lexer state and make sure the heredocs file is + * closed and set to NULL. For now we only do this when we get + * here in an interactive shell and we have a leftover heredoc. + */ + if(sh_isstate(SH_INTERACTIVE) && jmpval==SH_JMPERREXIT && sh.heredocs) + { + Lex_t *lp; + sfclose(sh.heredocs); + sh.heredocs = NULL; + lp = (Lex_t*)sh.lex_context; + lp->heredoc = NULL; + sh_lexopen(lp,0); + } /* make sure that we own the terminal */ tcsetpgrp(job.fd,sh.pid); } @@ -553,12 +563,6 @@ else if(job_close()<0) continue; } - else if(errno) - { - /* Ctrl+C with SIGINT ignored */ - sfputc(sfstderr,'\n'); - continue; - } } else if(errno && sferr) { @@ -572,6 +576,7 @@ sfclrerr(iop); continue; } + sh.exitval = sh.savexit; goto done; } sh.exitval = sh.savexit; @@ -712,14 +717,8 @@ stkset(sh.stk,savstak,offset); } -#undef EXECARGS #undef PSTAT -#if defined(_hdr_execargs) && defined(pdp11) -# include <execargs.h> -# define EXECARGS 1 -#endif - -#if defined(_lib_pstat) && defined(_sys_pstat) +#if _lib_pstat && _sys_pstat # include <sys/pstat.h> # define PSTAT 1 #endif @@ -738,11 +737,7 @@ */ static void fixargs(char **argv, int mode) { -# if EXECARGS - if(mode==0) - return; - *execargs=(char *)argv; -# elif PSTAT +# if PSTAT char *cp; int offset=0,size; static int command_len; @@ -808,7 +803,7 @@ /* Move the environment to make space for a larger command line buffer */ for(i=0; environi; i++) { - buffsize += strlen(environi) + 1;; + buffsize += strlen(environi) + 1; environi = sh_strdup(environi); } }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/name.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/name.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -237,9 +237,9 @@ struct Namref nr; int maketype = flags&NV_TYPE; /* make a 'typeset -T' type definition command */ struct sh_type shtp; - Dt_t *vartree, *save_vartree; + Dt_t *vartree, *save_vartree = NULL; #if SHOPT_NAMESPACE - Namval_t *save_namespace; + Namval_t *save_namespace = NULL; #endif if(flags&NV_GLOBAL) { @@ -305,7 +305,7 @@ UNREACHABLE(); } error_info.line = fp->fortyp-sh.st.firstline; - if(!array && tp->tre.tretyp!=TLST && tp->com.comset && !tp->com.comarg && tp->com.comset->argval0==0 && tp->com.comset->argval1=='') + if(!array && tp->tre.tretyp!=TLST && tp->com.comset && !tp->com.comarg.ap && tp->com.comset->argval0==0 && tp->com.comset->argval1=='') array |= (tp->com.comset->argflag&ARG_MESSAGE)?NV_IARRAY:NV_ARRAY; if(prefix && tp->com.comset && *cp=='') { @@ -323,16 +323,32 @@ } } np = nv_open(cp,sh.var_tree,flag|NV_ASSIGN); - if((arg->argflag&ARG_APPEND) && (tp->tre.tretyp&COMMSK)==TCOM && tp->com.comset && !nv_isvtree(np) && (((ap=nv_arrayptr(np)) && !ap->fun && !nv_opensub(np)) || (!ap && nv_isarray(np) && tp->com.comarg && !((mp=nv_search(tp->com.comarg->argval,sh.fun_tree,0)) && nv_isattr(mp,BLT_DCL))))) + if ( (arg->argflag & ARG_APPEND) && + (tp->tre.tretyp & COMMSK)==TCOM && + tp->com.comset && + !nv_isvtree(np) && + ( ( (ap = nv_arrayptr(np)) && + !ap->fun && + !nv_opensub(np) + ) || + ( !ap && + nv_isarray(np) && + tp->com.comarg.ap && + ! ( (mp = nv_search(tp->com.comarg.ap->argval,sh.fun_tree,0)) && + nv_isattr(mp,BLT_DCL) + ) + ) + ) + ) { - if(tp->com.comarg) + if(tp->com.comarg.ap) { struct argnod *ap = tp->com.comset; while(ap->argnxt.ap) ap = ap->argnxt.ap; - ap->argnxt.ap = tp->com.comarg; + ap->argnxt.ap = tp->com.comarg.ap; } - tp->com.comarg = tp->com.comset; + tp->com.comarg.ap = tp->com.comset; tp->com.comset = 0; tp->com.comtyp = COMSCAN; } @@ -377,10 +393,10 @@ nv_onattr(np,NV_ARRAY); } } - if(array && tp->tre.tretyp!=TLST && !tp->com.comset && !tp->com.comarg) + if(array && tp->tre.tretyp!=TLST && !tp->com.comset && !tp->com.comarg.ap) goto check_type; /* check for array assignment */ - if(tp->tre.tretyp!=TLST && tp->com.comarg && !tp->com.comset && ((array&NV_IARRAY) || !((mp=tp->com.comnamp) && nv_isattr(mp,BLT_DCL)))) + if(tp->tre.tretyp!=TLST && tp->com.comarg.ap && !tp->com.comset && ((array&NV_IARRAY) || !((mp=tp->com.comnamp) && nv_isattr(mp,BLT_DCL)))) { int argc; Dt_t *last_root = sh.last_root; @@ -428,7 +444,7 @@ } if((tp->tre.tretyp&COMMSK)==TFUN) goto skip; - if(tp->tre.tretyp==0 && !tp->com.comset && !tp->com.comarg) + if(tp->tre.tretyp==0 && !tp->com.comset && !tp->com.comarg.dp) { if(!(arg->argflag&ARG_APPEND)) { @@ -561,15 +577,15 @@ np = mp; 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->argval0!='') + if(!tp->lst.lstlef || !tp->lst.lstlef->tre.tretyp==TCOM || tp->lst.lstlef->com.comarg.ap || tp->lst.lstlef->com.comset && tp->lst.lstlef->com.comset->argval0!='') break; tp = tp->lst.lstrit; } - if(!nv_isarray(np) && !typ && (tp->com.comarg || !tp->com.comset || tp->com.comset->argval0!='')) + if(!nv_isarray(np) && !typ && (tp->com.comarg.ap || !tp->com.comset || tp->com.comset->argval0!='')) { nv_setvtree(np); - if(tp->com.comarg || tp->com.comset) + if(tp->com.comarg.ap || tp->com.comset) np->nvfun->dsize = 0; } goto check_type; @@ -912,8 +928,8 @@ #if NVCACHE nvcache.ok = 0; #endif - if(c=='.') /* don't optimize */ - sh.argaddr = 0; + if(nv_isattr(np,NV_NOOPTIMIZE) || c=='.') /* don't optimize */ + nv_setoptimize(NULL); else if((flags&NV_NOREF) && (c!='' && *cp!='.')) { if(c && !(flags&NV_NOADD)) @@ -1181,7 +1197,7 @@ 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; + nq->nvmeta = np; if(nq && nv_isnull(nq)) nq = nv_arraychild(np,nq,c); } @@ -1627,7 +1643,7 @@ UNREACHABLE(); } /* Create a local scope when inside of a virtual subshell */ - sh.argaddr = 0; + nv_setoptimize(NULL); if(sh.subshell && !nv_local && !(flags&NV_RDONLY)) sh_assignok(np,1); /* Export the variable if 'set -o allexport' is enabled */ @@ -1676,8 +1692,6 @@ up = np->nvalue.up; if(up && up->cp==Empty) up->cp = 0; - if(nv_isattr(np,NV_EXPORT)) - nv_offattr(np,NV_IMPORT); if(nv_isattr (np, NV_INTEGER)) { if(nv_isattr(np, NV_DOUBLE) == NV_DOUBLE) @@ -1874,7 +1888,7 @@ } if(nv_isattr(np, NV_HOST|NV_INTEGER)==NV_HOST && sp) { -#ifdef _lib_pathnative +#if _lib_pathnative /* * return the host file name given the UNIX name */ @@ -2093,14 +2107,12 @@ static int ja_size(char *str,int size,int type) { - char *cp = str; - int c, n=size; - int outsize; - char *oldcp=cp; - int oldn; - wchar_t w; + char *cp = str, *oldcp = str; + int c = 0, n = size, oldn = size; while(*cp) { + int outsize; + wchar_t w; oldn = n; w = mbchar(cp); if((outsize = mbwidth(w)) <0) @@ -2149,11 +2161,8 @@ char *p,*q; q = stkalloc(sh.stk,strlen(nv_name(np))+(value?strlen(value):0)+2); p=strcopy(q,nv_name(np)); - if(value) - { - *p++ = '='; - strcpy(p,value); - } + *p++ = '='; + strcpy(p,value); return q; } @@ -2202,9 +2211,7 @@ if(strchr(np->nvname,'.')) return; ap->tp = 0; - if(nv_isattr(np,NV_IMPORT) && np->nvenv) - *ap->argnam++ = np->nvenv; - else if(value=nv_getval(np)) + if(value=nv_getval(np)) *ap->argnam++ = staknam(np,value); if(!sh_isoption(SH_POSIX) && nv_isattr(np,ATTR_TO_EXPORT)) ap->attsize += (strlen(nv_name(np))+4); @@ -2225,11 +2232,13 @@ nv_offattr(L_ARGNOD,NV_EXPORT); data.attsize = 6; namec = nv_scan(sh.var_tree,nullscan,NULL,NV_EXPORT,NV_EXPORT); - namec += sh.nenv; - er = (char**)stkalloc(sh.stk,(namec+4)*sizeof(char*)); - data.argnam = (er+=2) + sh.nenv; - if(sh.nenv) - memcpy(er,environ,sh.nenv*sizeof(char*)); + namec += sh.save_env_n; + er = stkalloc(sh.stk,(namec+4)*sizeof(char*)); + data.argnam = (er+=2) + sh.save_env_n; + /* Pass non-imported env vars to child */ + if(sh.save_env_n) + memcpy(er,sh.save_env,sh.save_env_n*sizeof(char*)); + /* Add exported vars */ nv_scan(sh.var_tree, pushnam,&data,NV_EXPORT, NV_EXPORT); *data.argnam = (char*)stkalloc(sh.stk,data.attsize); /* Export variable attributes into env var named by e_envmarker, unless POSIX mode is on */ @@ -2358,53 +2367,6 @@ sh.var_tree = newscope; } -/* - * Remove freeable local space associated with the nvalue field - * of nnod. This includes any strings representing the value(s) of the - * node, as well as its dope vector, if it is an array. - */ -void sh_envnolocal (Namval_t *np, void *data) -{ - char *cp = 0, was_export = nv_isattr(np,NV_EXPORT)!=0; - NOT_USED(data); - if(np==VERSIONNOD && nv_isref(np)) - return; - if(np==L_ARGNOD) - return; - if(np == sh.namespace) - return; - if(nv_isref(np)) - nv_unref(np); - if(nv_isattr(np,NV_EXPORT) && nv_isarray(np)) - { - nv_putsub(np,NULL,0); - if(cp = nv_getval(np)) - cp = sh_strdup(cp); - } - if(nv_isattr(np,NV_EXPORT|NV_NOFREE)) - { - if(nv_isref(np) && np!=VERSIONNOD) - { - nv_offattr(np,NV_NOFREE|NV_REF); - free(np->nvalue.nrp); - np->nvalue.cp = 0; - } - if(!cp) - return; - } - if(nv_isarray(np)) - nv_putsub(np,NULL,ARRAY_UNDEF); - _nv_unset(np,NV_RDONLY); - nv_setattr(np,0); - if(cp) - { - nv_putval(np,cp,0); - free(cp); - } - if(was_export) - nv_onattr(np,NV_EXPORT); -} - static void table_unset(Dt_t *root, int flags, Dt_t *oroot) { Namval_t *np,*nq, *npnext; @@ -2458,7 +2420,7 @@ * 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 + * <flags> can contain NV_EXPORT to preserve nvmeta. */ void _nv_unset(Namval_t *np,int flags) { @@ -2475,7 +2437,7 @@ } if(is_afunction(np) && np->nvalue.ip) { - struct slnod *slp = (struct slnod*)(np->nvenv); + struct slnod *slp = np->nvmeta; if(np->nvalue.rp->running) { np->nvalue.rp->running |= 1; @@ -2585,7 +2547,7 @@ if(nv_isattr(np,NV_EXPORT) && !strchr(np->nvname,'')) env_change(); if(!(flags&NV_EXPORT) || nv_isattr(np,NV_EXPORT)) - np->nvenv = 0; + np->nvmeta = NULL; nv_setattr(np,0); } else @@ -2662,37 +2624,37 @@ { Namfun_t *fp; struct optimize *op, *xp = 0; - if(sh.argaddr) + if(nv_getoptimize()) { if(np==SH_LINENO) { - sh.argaddr = 0; + nv_setoptimize(NULL); return; } for(fp=np->nvfun; fp; fp = fp->next) { if(fp->disc && (fp->disc->getnum || fp->disc->getval)) { - sh.argaddr = 0; + nv_setoptimize(NULL); return; } if(fp->disc == &OPTIMIZE_disc) xp = (struct optimize*)fp; } - if(xp && xp->ptr==sh.argaddr) + if(xp && xp->ptr==nv_getoptimize()) return; if(xp && xp->next) { struct optimize *xpn; for(xpn = xp->next; xpn; xpn = xpn->next) - if(xpn->ptr == sh.argaddr && xpn->np == np) + if(xpn->ptr == nv_getoptimize() && xpn->np == np) return; } if(op = opt_free) opt_free = op->next; else op=(struct optimize*)sh_calloc(1,sizeof(struct optimize)); - op->ptr = sh.argaddr; + op->ptr = nv_getoptimize(); op->np = np; if(xp) { @@ -2743,10 +2705,8 @@ { union Value *up= &np->nvalue; int numeric; -#if SHOPT_OPTIMIZE - if(!nv_local && sh.argaddr) + if(!nv_local && nv_getoptimize()) nv_optimize(np); -#endif /* SHOPT_OPTIMIZE */ if((!np->nvfun || !np->nvfun->disc) && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF)) goto done; if(nv_isref(np)) @@ -2777,6 +2737,7 @@ if(numeric) { Sflong_t ll; + int base; if(!up->cp) return "0"; if(nv_isattr (np,NV_DOUBLE)==NV_DOUBLE) @@ -2833,16 +2794,12 @@ } else ll = *(up->lp); - if((numeric=nv_size(np))==10) - { - if(nv_isattr(np,NV_UNSIGN)) - { - sfprintf(sh.strbuf,"%I*u",sizeof(ll),ll); - return sfstruse(sh.strbuf); - } - numeric = 0; - } - return fmtbase(ll,numeric, numeric&&numeric!=10); + base = nv_size(np); + if(base==10) + return fmtint(ll, nv_isattr(np,NV_UNSIGN)); + /* render a possibly signed non-base-10 integer with its base# prefix */ + sfprintf(sh.strbuf, nv_isattr(np,NV_UNSIGN) ? "%#..*I*u" : "%#..*I*d", base, sizeof ll, ll); + return sfstruse(sh.strbuf); } done: /* @@ -2873,10 +2830,8 @@ union Value *up; Sfdouble_t r=0; char *str; -#if SHOPT_OPTIMIZE - if(!nv_local && sh.argaddr) + if(!nv_local && nv_getoptimize()) nv_optimize(np); -#endif /* SHOPT_OPTIMIZE */ if(nv_istable(np)) { errormsg(SH_DICT,ERROR_exit(1),e_number,nv_name(np)); @@ -2970,8 +2925,6 @@ /* handle attributes that do not change data separately */ n = np->nvflag; trans = !(n&NV_INTEGER) && (n&(NV_LTOU|NV_UTOL)); /* transcode to lower or upper case */ - if(newatts&NV_EXPORT) - nv_offattr(np,NV_IMPORT); if(((n^newatts)&NV_EXPORT)) /* EXPORT attribute has been toggled */ { /* record changes to the environment */ @@ -3059,7 +3012,20 @@ ap->nelem |= ARRAY_SCAN; } if(size==0 && !(newatts&NV_INTEGER) && (newatts&NV_HOST)!=NV_HOST && (newatts&(NV_LJUST|NV_RJUST|NV_ZFILL))) + { /* + * Calculate the default terminal width for -L, -R, -Z if no numeric option-argument was given. + * Note: we count terminal positions, not characters (double-width adds 2, control char adds 0) + */ + char *cq = cp; + wchar_t c; + int w; + n = 0; + mbinit(); + while(c = mbchar(cq)) + if ((w = mbwidth(c)) > 0) + n += w; size = n; + } } else if(!trans) _nv_unset(np,NV_EXPORT); @@ -3112,12 +3078,19 @@ */ char *sh_getenv(const char *name) { - Namval_t *np; + Namval_t *np, *savns; + char *cp, *savpr; if(!sh.var_tree) return oldgetenv(name); - else if((np = nv_search(name,sh.var_tree,0)) && nv_isattr(np,NV_EXPORT)) - return nv_getval(np); - return NULL; + /* deactivate a possible namespace or compound assignment */ + savns = sh.namespace, savpr = sh.prefix; + sh.namespace = NULL, sh.prefix = NULL; + if((np = nv_search(name,sh.var_tree,0)) && nv_isattr(np,NV_EXPORT)) + cp = nv_getval(np); + else + cp = NULL; + sh.namespace = savns, sh.prefix = savpr; + return cp; } #ifndef _NEXT_SOURCE @@ -3141,9 +3114,14 @@ Namval_t *np; if(name) { + Namval_t *savns = sh.namespace; + char *savpr = sh.prefix; + /* deactivate a possible namespace or compound assignment */ + sh.namespace = NULL, sh.prefix = NULL; np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_NOARRAY|NV_ASSIGN); if(!strchr(name,'=')) _nv_unset(np,0); + sh.namespace = savns, sh.prefix = savpr; } return 0; } @@ -3156,11 +3134,12 @@ Namval_t *np; if(name) { - char *save_prefix = sh.prefix; - /* deactivate a possible compound assignment */ - sh.prefix = NULL; + Namval_t *savns = sh.namespace; + char *savpr = sh.prefix; + /* deactivate a possible namespace or compound assignment */ + sh.namespace = NULL, sh.prefix = NULL; np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_NOARRAY|NV_ASSIGN); - sh.prefix = save_prefix; + sh.namespace = savns, sh.prefix = savpr; if(strchr(name,'=')) return nv_getval(np); _nv_unset(np,0); @@ -3219,7 +3198,8 @@ Namval_t *last_table = sh.last_table; Dt_t *last_root = sh.last_root; Dt_t *hp = 0; - char *nvenv=0,*prefix=sh.prefix; + void *nvmeta = NULL; + char *prefix = sh.prefix; Namarr_t *ap; if(nv_isattr(np,NV_PARAM) && sh.st.prevst) { @@ -3227,8 +3207,8 @@ hp = dtvnext(sh.var_tree); } if(!nv_isattr(np,NV_MINIMAL)) - nvenv = np->nvenv; - if(nvenv || (cp = nv_name(np)) && nv_isarray(np) && cpstrlen(cp)-1 == '') + nvmeta = np->nvmeta; + if(nvmeta || (cp = nv_name(np)) && nv_isarray(np) && cpstrlen(cp)-1 == '') arraynp = 1; if(!(cp=nv_getval(np))) { @@ -3278,12 +3258,12 @@ { if(ap = nv_arrayptr(np)) ap->nelem++; - mp->nvenv = nvenv = (void*)np; + mp->nvmeta = nvmeta = np; } } if(mp) { - nvenv = (char*)np; + nvmeta = np; np = mp; } if(nr==np) @@ -3307,7 +3287,7 @@ sh.last_root = last_root; if(flags&NV_MOVE) { - if(arraynp && !nv_isattr(np,NV_MINIMAL) && (mp=(Namval_t*)np->nvenv) && (ap=nv_arrayptr(mp)) && !ap->fun) + if(arraynp && !nv_isattr(np,NV_MINIMAL) && (mp = np->nvmeta) && (ap = nv_arrayptr(mp)) && !ap->fun) ap->nelem++; } if((nv_arrayptr(nr) && !arraynr) || nv_isvtree(nr)) @@ -3319,7 +3299,7 @@ if(ap->table) mp = nv_search(nv_getsub(np),ap->table,NV_ADD); nv_arraychild(np,mp,0); - nvenv = (void*)np; + nvmeta = np; } else mp = np; @@ -3345,10 +3325,10 @@ } else nv_clone(nr,mp,(flags&NV_MOVE)|NV_COMVAR); - mp->nvenv = nvenv; + mp->nvmeta = nvmeta; if(flags&NV_MOVE) { - if(arraynr && !nv_isattr(nr,NV_MINIMAL) && (mp=(Namval_t*)nr->nvenv) && (ap=nv_arrayptr(mp))) + if(arraynr && !nv_isattr(nr,NV_MINIMAL) && (mp = nr->nvmeta) && (ap = nv_arrayptr(mp))) { nv_putsub(mp,nr->nvname,0); _nv_unset(mp,0); @@ -3361,7 +3341,7 @@ nv_putval(np,nv_getval(nr),0); if(flags&NV_MOVE) { - if(!nv_isattr(nr,NV_MINIMAL) && (mp=(Namval_t*)(nr->nvenv)) && (ap=nv_arrayptr(mp))) + if(!nv_isattr(nr,NV_MINIMAL) && (mp = nr->nvmeta) && (ap = nv_arrayptr(mp))) ap->nelem--; _nv_unset(nr,0); } @@ -3586,9 +3566,7 @@ } free(np->nvalue.nrp); np->nvalue.cp = sh_strdup(nv_name(nq)); -#if SHOPT_OPTIMIZE nv_optimize_clear(nq); -#endif } char *nv_name(Namval_t *np) @@ -3596,7 +3574,7 @@ Namval_t *table; Namfun_t *fp; #if SHOPT_FIXEDARRAY - Namarr_t *ap; + Namarr_t *ap = NULL; #endif /* SHOPT_FIXEDARRAY */ char *cp; if(is_abuiltin(np) || is_afunction(np)) @@ -3617,9 +3595,9 @@ #if SHOPT_FIXEDARRAY ap = nv_arrayptr(np); #endif /* SHOPT_FIXEDARRAY */ - if(!nv_isattr(np,NV_MINIMAL|NV_EXPORT) && np->nvenv) + if(!nv_isattr(np,NV_MINIMAL|NV_EXPORT) && np->nvmeta) { - Namval_t *nq= sh.last_table, *mp= (Namval_t*)np->nvenv; + Namval_t *nq = sh.last_table, *mp = np->nvmeta; if(np==sh.last_table) sh.last_table = 0; if(nv_isarray(mp))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/nvdisc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/nvdisc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -328,11 +328,8 @@ /* restore everything but the nvlink field */ memcpy(&SH_VALNOD->nvname, &node.nvname, sizeof(node)-sizeof(node.nvlink)); } - else if(sh_isstate(SH_INIT) || np==SH_FUNNAMENOD) - { - /* don't free functions during reinitialization */ + else if(np==SH_FUNNAMENOD) nv_putv(np,val,flags,handle); - } else if(!nq || !isblocked(bp,type)) { Dt_t *root = sh_subfuntree(1); @@ -342,7 +339,7 @@ block(bp,type); nv_disc(np,handle,NV_POP); if(!nv_isattr(np,NV_MINIMAL)) - pp = (Namval_t*)np->nvenv; + pp = np->nvmeta; nv_putv(np, val, flags, handle); if(sh.subshell) goto done; @@ -571,9 +568,7 @@ else if(type==LOOKUPN) dp->getnum = lookupn; vp->disctype = action; -#if SHOPT_OPTIMIZE nv_optimize_clear(np); -#endif } else { @@ -914,11 +909,11 @@ { if(nv_isattr(mp,NV_EXPORT|NV_MINIMAL) == (NV_EXPORT|NV_MINIMAL)) { - mp->nvenv = 0; + mp->nvmeta = NULL; 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; + if(!(flags&NV_COMVAR) && !nv_isattr(np,NV_MINIMAL) && np->nvmeta && !(nv_isattr(mp,NV_MINIMAL))) + mp->nvmeta = np->nvmeta; mp->nvflag &= NV_MINIMAL; mp->nvflag |= np->nvflag&~(NV_ARRAY|NV_MINIMAL|NV_NOFREE); flag = mp->nvflag; @@ -953,10 +948,10 @@ np->nvalue.cp = 0; if(!nv_isattr(np,NV_MINIMAL) || nv_isattr(mp,NV_EXPORT)) { - mp->nvenv = np->nvenv; + mp->nvmeta = np->nvmeta; if(nv_isattr(np,NV_MINIMAL)) { - np->nvenv = 0; + np->nvmeta = NULL; np->nvflag = NV_EXPORT; } else @@ -968,7 +963,7 @@ return 1; } else if((flags&NV_ARRAY) && !nv_isattr(np,NV_MINIMAL)) - mp->nvenv = np->nvenv; + mp->nvmeta = np->nvmeta; if(nv_isattr(np,NV_INTEGER) && !nv_isarray(np) && mp->nvalue.ip!=np->nvalue.ip && np->nvalue.cp!=Empty) { mp->nvalue.ip = (int*)num_clone(np,np->nvalue.ip); @@ -994,6 +989,9 @@ { Namval_t *np; Dt_t *dp = 0; + /* do not find builtins when using 'command -x' */ + if(!(mode&NV_ADD) && sh_isstate(SH_XARG) && (root==sh.bltin_tree || root==sh.fun_tree)) + return NULL; if(mode&NV_NOSCOPE) dp = dtview(root,0); if(mode&NV_REF) @@ -1104,8 +1102,8 @@ return np; } #endif /* SHOPT_NAMESPACE */ - while(nv_isarray(nq) && !nv_isattr(nq,NV_MINIMAL|NV_EXPORT) && nq->nvenv && nv_isarray((Namval_t*)nq->nvenv)) - nq = (Namval_t*)nq->nvenv; + while(nv_isarray(nq) && !nv_isattr(nq,NV_MINIMAL|NV_EXPORT) && nq->nvmeta && nv_isarray((Namval_t*)nq->nvmeta)) + nq = nq->nvmeta; return (Namval_t*)nv_setdisc(nq,dname,nq,(Namfun_t*)nq); done: stkseek(sh.stk,offset); @@ -1143,7 +1141,7 @@ stkseek(sh.stk,offset); if(extra == (void*)1) { - if(nv_isattr(np,BLT_SPC)) + if(nv_isattr(np,BLT_SPC) && !sh_isstate(SH_INIT)) { /* builtin(1) cannot delete special builtins */ errormsg(SH_DICT,ERROR_exit(1),"cannot delete: %s%s",name,is_spcbuiltin); @@ -1168,7 +1166,7 @@ return np; if(!bltin) bltin = funptr(np); - if(np->nvenv) + if(np->nvmeta) dtdelete(sh.bltin_tree,np); if(extra == (void*)1) return NULL; @@ -1185,8 +1183,8 @@ np->nvfun = (Namfun_t*)extra; return np; } - np->nvenv = 0; - np->nvfun = 0; + np->nvmeta = NULL; + np->nvfun = NULL; if(bltin) { np->nvalue.bfp = bltin; @@ -1296,6 +1294,8 @@ dtdelete(root,mp); free(mp); } + if(sh.last_root==root) + sh.last_root = NULL; dtclose(root); if(!(fp->nofree&1)) free(fp); @@ -1314,7 +1314,7 @@ if(out) sfseek(out,0,SEEK_SET); else - out = sfnew(NULL,NULL,-1,-1,SF_WRITE|SF_STRING); + out = sfnew(NULL,NULL,-1,-1,SFIO_WRITE|SFIO_STRING); for(np=(Namval_t*)dtfirst(root);np;np=(Namval_t*)dtnext(root,np)) { if(!nv_isnull(np) || np->nvfun || nv_isattr(np,~NV_NOFREE))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/nvtree.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/nvtree.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -727,7 +727,9 @@ _nv_unset(np,NV_RDONLY); if(sh.subshell || (wp->flags!=NV_RDONLY) || nv_isattr(np,NV_MINIMAL|NV_NOFREE)) wp->root = 0; - nv_delete(np,wp->root,nv_isattr(np,NV_MINIMAL)?NV_NOFREE:0); + /* Delete the node from the tree and free np, unless we're unsetting variables in sh_reinit() */ + if(!sh_isstate(SH_INIT)) + nv_delete(np,wp->root,nv_isattr(np,NV_MINIMAL)?NV_NOFREE:0); return; } if(isarray==1 && !nq) @@ -942,7 +944,7 @@ Sfio_t *outfile; Sfoff_t off = 0; int len, savtop = stktell(sh.stk); - char *savptr = stkfreeze(sh.stk,0); + void *savptr = stkfreeze(sh.stk,0); struct argnod *ap=0; struct argnod *arglist=0; char *name,*cp, **argv; @@ -1006,7 +1008,7 @@ } stkseek(sh.stk,ARGVAL); sfputr(sh.stk,cp,-1); - ap = (struct argnod*)stkfreeze(sh.stk,1); + ap = stkfreeze(sh.stk,1); ap->argflag = ARG_RAW; ap->argchn.ap = arglist; n++; @@ -1018,7 +1020,7 @@ sh.var_tree = save_tree; return NULL; } - argv = (char**)stkalloc(sh.stk,(n+1)*sizeof(char*)); + argv = stkalloc(sh.stk,(n+1)*sizeof(char*)); argv += n; *argv = 0; for(; ap; ap=ap->argchn.ap) @@ -1026,7 +1028,7 @@ if(flags&1) outfile = 0; else if(!(outfile=out)) - outfile = out = sfnew(NULL,NULL,-1,-1,SF_WRITE|SF_STRING); + outfile = out = sfnew(NULL,NULL,-1,-1,SFIO_WRITE|SFIO_STRING); else if(flags&NV_TABLE) off = sftell(outfile); else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/nvtype.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/nvtype.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -527,7 +527,7 @@ Namfun_t *pp; if((pp=nv_hasdisc(nq,fp->disc)) && pp->type==fp->type) { - if(!nq->nvenv) + if(!nq->nvmeta) flag |= NV_EXPORT; _nv_unset(np, flag); nv_clone(nq,np,NV_IARRAY); @@ -582,7 +582,7 @@ else mp->nvalue.cp = (char*)(fp+1); if(!nv_isattr(mp,NV_MINIMAL)) - mp->nvenv = 0; + mp->nvmeta = NULL; nv_offattr(mp,NV_RDONLY); return pp; } @@ -616,8 +616,8 @@ 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); + if(np->nvmeta) + sfprintf(out,"+?\b%s\b is a %s.\n", tp->nvname, (char*)np->nvmeta); cp = (char*)out->_next; sfprintf(out,"+?\b%s\b is a %n ", tp->nvname, &i); nv_attribute(np,out,NULL, 1); @@ -642,7 +642,7 @@ return 0; } help = &dp->namesdp->ndisc; - sp = sfnew(NULL,buffer,sizeof(buffer),-1,SF_STRING|SF_WRITE); + sp = sfnew(NULL,buffer,sizeof(buffer),-1,SFIO_STRING|SFIO_WRITE); sfprintf(out,"+?\b%s\b defines the following fields:{\n",np->nvname); for(i=0; i < dp->numnodes; i++) { @@ -844,8 +844,8 @@ } if(nv_isattr(np,NV_REF)) iref++; - if(np->nvenv) - size += strlen((char*)np->nvenv)+1; + if(np->nvmeta) + size += strlen(np->nvmeta) + 1; if(strcmp(&np->nvnamem,NV_DATA)==0 && !nv_type(np)) continue; if(qp) @@ -971,7 +971,7 @@ 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))); + nv_putval(nq,(val?val:0),nv_isattr(np,~(NV_MINIMAL|NV_EXPORT|NV_ARRAY))); nq->nvflag = np->nvflag|NV_NOFREE|NV_MINIMAL; goto skip; } @@ -1015,17 +1015,17 @@ goto skip; } nq = nv_namptr(pp->nodes,k); - if(np->nvenv) + if(np->nvmeta) { /* need to save the string pointer */ nv_offattr(np,NV_EXPORT); helpk = cp; - cp = strcopy(cp,np->nvenv); + cp = strcopy(cp,np->nvmeta); j = *helpk; if(islower(j)) *helpk = toupper(j); *cp++ = 0; - np->nvenv = 0; + np->nvmeta = NULL; } nq->nvname = cp; if(name && strncmp(name,&np->nvnamem,n)==0 && np->nvnamem+n=='.') @@ -1035,7 +1035,7 @@ n = cp-name; *cp++ = 0; nq->nvsize = np->nvsize; - nq->nvflag = (np->nvflag&~(NV_IMPORT|NV_EXPORT))|NV_NOFREE|NV_MINIMAL; + nq->nvflag = (np->nvflag&~NV_EXPORT)|NV_NOFREE|NV_MINIMAL; if(dp = (Namtype_t*)nv_hasdisc(np, &type_disc)) { int r,kfirst=k; @@ -1196,7 +1196,7 @@ fp->disc = dp; mp->nvalue.cp = (char*)(fp+1) + sizeof(Namdisc_t); nv_setsize(mp,10); - mp->nvenv = (char*)help; + mp->nvmeta = (void*)help; nv_onattr(mp,NV_NOFREE|NV_RDONLY|NV_INTEGER|NV_EXPORT); if(size==16) nv_onattr(mp,NV_INT16P); @@ -1273,7 +1273,6 @@ char *val=0; Namarr_t *ap=0; int nelem = 0; - unsigned int subshell = sh.subshell; Namval_t *tq; if(nv_type(np)==tp) return 0; @@ -1284,6 +1283,8 @@ errormsg(SH_DICT,ERROR_exit(1),e_redef,nv_name(np)); UNREACHABLE(); } + if(sh.subshell && !sh.subshare) + sh_subfork(); if((ap=nv_arrayptr(np)) && ap->nelem>0) { nv_putsub(np,NULL,ARRAY_SCAN); @@ -1299,11 +1300,6 @@ flags &= ~NV_APPEND; if(!ap) { - if(subshell) - { - sh_assignok(np,1); - sh.subshell = 0; - } nv_putsub(np,"0",ARRAY_FILL); ap = nv_arrayptr(np); nelem = 1; @@ -1345,7 +1341,6 @@ nv_putsub(np,"0",0); _nv_unset(np,NV_RDONLY|NV_TYPE); ap->nelem--; - sh.subshell = subshell; } } type_init(np);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/parse.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/parse.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -38,7 +38,7 @@ #include "history.h" #include "version.h" -#define HERE_MEM SF_BUFSIZE /* size of here-docs kept in memory */ +#define HERE_MEM SFIO_BUFSIZE /* size of here-docs kept in memory */ /* These routines are local to this module */ @@ -68,7 +68,7 @@ static int opt_get; -#define getnode(type) ((Shnode_t*)stkalloc(sh.stk,sizeof(struct type))) +#define getnode(type) stkalloc(sh.stk,sizeof(struct type)) #if SHOPT_KIA /* @@ -164,6 +164,15 @@ } } +static noreturn int b_dummy(int argc, char *argv, Shbltin_t *context) +{ + NOT_USED(argc); + NOT_USED(argv0); + NOT_USED(context); + errormsg(SH_DICT,ERROR_PANIC,e_internal); + UNREACHABLE(); +} + /* * This function handles linting for 'typeset' options via typeset_order(). * @@ -177,7 +186,7 @@ char *cp=0; /* name of built-in to pre-add */ if(tp->comtyp&COMSCAN) { - struct argnod *ap = tp->comarg; + struct argnod *ap = tp->comarg.ap; while(ap = ap->argnxt.ap) { if(!(ap->argflag&ARG_RAW) || strncmp(ap->argval,"--",2)) @@ -197,7 +206,7 @@ } else { - struct dolnod *dp = (struct dolnod*)tp->comarg; + struct dolnod *dp = tp->comarg.dp; char **argv = dp->dolval + ARG_SPARE; if(intypeset==2) { @@ -233,7 +242,7 @@ dcl_tree = dtopen(&_Nvdisc, Dtoset); dtview(sh.bltin_tree, dcl_tree); } - nv_onattr(sh_addbuiltin(cp, b_true, NULL), NV_BLTIN|BLT_DCL); + nv_onattr(sh_addbuiltin(cp, b_dummy, NULL), NV_BLTIN|BLT_DCL); } } /* @@ -433,7 +442,7 @@ fcrestore(&sav_input); lexp->arg = sav_arg; /* unstack any completed alias expansions */ - if((sfset(iop,0,0)&SF_STRING) && !sfreserve(iop,0,-1)) + if((sfset(iop,0,0)&SFIO_STRING) && !sfreserve(iop,0,-1)) { Sfio_t *sp = sfstack(iop,NULL); if(sp) @@ -668,7 +677,7 @@ struct regnod *r; if(tok==esym) return NULL; - r = (struct regnod*)stkalloc(sh.stk,sizeof(struct regnod)); + r = stkalloc(sh.stk,sizeof(struct regnod)); r->regptr=0; r->regflag=0; if(tok==LPAREN) @@ -727,7 +736,7 @@ for(n=0; ; n++) { int c; - argp = (struct argnod*)stkseek(sh.stk,ARGVAL); + argp = stkseek(sh.stk,ARGVAL); argp->argnxt.ap = 0; argp->argchn.cp = 0; argp->argflag = argflag; @@ -748,7 +757,7 @@ /* check for empty condition and treat as while((1)) */ if(offset==ARGVAL) sfputc(sh.stk,'1'); - argp = (struct argnod*)stkfreeze(sh.stk,1); + argp = stkfreeze(sh.stk,1); t = getanode(lexp,argp); if(n==0) tf = makelist(lexp,TLST,t,tw); @@ -758,7 +767,7 @@ while((offset=fcpeek(0)) && isspace(offset)) fcseek(1); sfputr(sh.stk,fcseek(0),-1); - argp = (struct argnod*)stkfreeze(sh.stk,1); + argp = stkfreeze(sh.stk,1); fcrestore(&sav_input); if(n<2) { @@ -858,7 +867,7 @@ errormsg(SH_DICT,ERROR_exit(3),e_lexsyntax4,sh.inlineno); UNREACHABLE(); } - argv0 = argv = ((struct dolnod*)ac->comarg)->dolval+ARG_SPARE; + argv0 = argv = ac->comarg.dp->dolval + ARG_SPARE; while(cp= *argv++) { size += strlen(cp)+1; @@ -877,7 +886,7 @@ Namval_t *np= nv_open(t->funct.functnam,sh.fun_tree,NV_ADD|NV_VARNAME); np->nvalue.rp = new_of(struct Ufunction,sh.funload?sizeof(Dtlink_t):0); memset(np->nvalue.rp,0,sizeof(struct Ufunction)); - np->nvalue.rp->argc = ((struct dolnod*)ac->comarg)->dolnum; + np->nvalue.rp->argc = ac->comarg.dp->dolnum; } } while(lexp->token==NL) @@ -889,10 +898,10 @@ jmpval = sigsetjmp(buff.buff,0); if(jmpval == 0) { - /* create a new stack frame to compile the command */ - savstak = stkopen(STK_SMALL); - savstak = stkinstall(savstak, 0); - slp = (struct slnod*)stkalloc(sh.stk,sizeof(struct slnod)+sizeof(struct functnod)); + /* create a new stack to compile the command */ + savstak = sh.stk; + sh.stk = stkopen(STK_SMALL); + slp = stkalloc(sh.stk,sizeof(struct slnod)+sizeof(struct functnod)); slp->slchild = 0; slp->slnext = sh.st.staklist; sh.st.staklist = 0; @@ -910,11 +919,11 @@ fp->functnam = stkcopy(sh.stk,sh.st.filename); if(size) { - struct dolnod *dp = (struct dolnod*)stkalloc(sh.stk,size); - char *cp, *sp, **argv, **old = ((struct dolnod*)t->funct.functargs->comarg)->dolval+1; + struct dolnod *dp = stkalloc(sh.stk,size); + char *cp, *sp, **argv, **old = t->funct.functargs->comarg.dp->dolval + 1; argv = ((char**)(dp->dolval))+1; - dp->dolnum = ((struct dolnod*)t->funct.functargs->comarg)->dolnum; - t->funct.functargs->comarg = (struct argnod*)dp; + dp->dolnum = t->funct.functargs->comarg.dp->dolnum; + t->funct.functargs->comarg.dp = dp; for(cp=(char*)&argvnargs; sp= *old++; cp++) { *argv++ = cp; @@ -926,7 +935,7 @@ { /* functname() simple_command: copy current word token to current stack frame */ size_t sz = ARGVAL + strlen(lexp->arg->argval) + 1; /* include terminating 0 */ - struct argnod *ap = (struct argnod*)stkalloc(sh.stk,sz); + struct argnod *ap = stkalloc(sh.stk,sz); memcpy(ap,lexp->arg,sz); lexp->arg = ap; } @@ -939,7 +948,8 @@ /* restore the old stack */ if(slp) { - slp->slptr = stkinstall(savstak,0); + slp->slptr = sh.stk; + sh.stk = savstak; slp->slchild = sh.st.staklist; } #if SHOPT_KIA @@ -1007,7 +1017,7 @@ { int n; Shnode_t *t, **tp; - struct comnod *ac; + struct comnod *ac = NULL; int array=0, index=0; Namval_t *np; lexp->assignlevel++; @@ -1046,23 +1056,23 @@ if((n=skipnl(lexp,0))==RPAREN || n==LPAREN) { struct argnod *ar,*aq,**settail; - ac = (struct comnod*)getnode(comnod); + ac = getnode(comnod); memset(ac,0,sizeof(*ac)); comarray: settail= &ac->comset; ac->comline = sh_getlineno(lexp); while(n==LPAREN) { - ar = (struct argnod*)stkseek(sh.stk,ARGVAL); + ar = stkseek(sh.stk,ARGVAL); ar->argflag= ARG_ASSIGN; sfprintf(sh.stk,"%d=",index++); - if(aq=ac->comarg) + if(aq = ac->comarg.ap) { - ac->comarg = aq->argnxt.ap; + ac->comarg.ap = aq->argnxt.ap; sfprintf(sh.stk,"%s",aq->argval); ar->argflag |= aq->argflag; } - ar = (struct argnod*)stkfreeze(sh.stk,1); + ar = stkfreeze(sh.stk,1); ar->argnxt.ap = 0; if(!aq) ar = assign(lexp,ar,0); @@ -1073,11 +1083,11 @@ continue; while((n = skipnl(lexp,0))==0) { - ar = (struct argnod*)stkseek(sh.stk,ARGVAL); + ar = stkseek(sh.stk,ARGVAL); ar->argflag= ARG_ASSIGN; sfprintf(sh.stk,"%d=",index++); sfputr(sh.stk,lexp->arg->argval,-1); - ar = (struct argnod*)stkfreeze(sh.stk,1); + ar = stkfreeze(sh.stk,1); ar->argnxt.ap = 0; ar->argflag = lexp->arg->argflag; *settail = ar; @@ -1197,8 +1207,8 @@ */ static Shnode_t *item(Lex_t *lexp,int flag) { - Shnode_t *t; - struct ionod *io; + Shnode_t *t; + struct ionod *io; int tok = (lexp->token&0xff); int savwdval = lexp->lasttok; int savline = lexp->lastline; @@ -1304,14 +1314,7 @@ /* some Linux scripts assume this */ if(sh_isoption(SH_NOEXEC)) errormsg(SH_DICT,ERROR_warn(0),e_lexemptyfor,sh.inlineno-(lexp->token=='\n')); - t->for_.forlst = (struct comnod*)getnode(comnod); - (t->for_.forlst)->comarg = 0; - (t->for_.forlst)->comset = 0; - (t->for_.forlst)->comnamp = 0; - (t->for_.forlst)->comnamq = 0; - (t->for_.forlst)->comstate = 0; - (t->for_.forlst)->comio = 0; - (t->for_.forlst)->comtyp = 0; + t->for_.forlst = memset(getnode(comnod),0,sizeof(struct comnod)); } else t->for_.forlst=(struct comnod*)simple(lexp,SH_NOIO,NULL); @@ -1389,7 +1392,7 @@ /* simple command */ case 0: t = (Shnode_t*)simple(lexp,flag,io); - if(t->com.comarg && lexp->intypeset) + if(t->com.comarg.ap && lexp->intypeset) check_typedef(&t->com, lexp->intypeset); lexp->intypeset = 0; lexp->inexec = 0; @@ -1415,7 +1418,7 @@ Shnode_t *t; int mode = (tok==OPROCSYM); t = sh_cmd(lexp,RPAREN,SH_NL); - argp = (struct argnod*)stkalloc(sh.stk,sizeof(struct argnod)); + argp = stkalloc(sh.stk,sizeof(struct argnod)); *argp->argval = 0; argp->argchn.ap = (struct argnod*)makeparent(lexp,mode?TFORK|FPIN|FAMP|FPCL:TFORK|FPOU,t); argp->argflag = (ARG_EXP|mode); @@ -1445,15 +1448,11 @@ flag |= SH_ARRAY; associative = 1; } - t = (struct comnod*)getnode(comnod); + t = memset(getnode(comnod),0,sizeof(struct comnod)); t->comio=io; /* initial io chain */ /* set command line number for error messages */ t->comline = sh_getlineno(lexp); - argtail = &(t->comarg); - t->comset = 0; - t->comnamp = 0; - t->comnamq = 0; - t->comstate = 0; + argtail = &(t->comarg.ap); settail = &(t->comset); if(lexp->assignlevel && (flag&SH_ARRAY) && check_array(lexp)) type |= NV_ARRAY; @@ -1477,15 +1476,11 @@ if(assignment) { struct argnod *ap=argp; - char *last, *cp; if(assignment==1) { - last = strchr(argp->argval,'='); - if(last && (last-1==''|| (last-1=='+' && last-2=='')) && (cp=strchr(argp->argval,'')) && (cp < last) && cp-1!='.') - last = cp; stkseek(sh.stk,ARGVAL); - sfwrite(sh.stk,argp->argval,last-argp->argval); - ap=(struct argnod*)stkfreeze(sh.stk,1); + sfwrite(sh.stk,argp->argval,lexp->varnamelength); + ap = stkfreeze(sh.stk,1); ap->argflag = ARG_RAW; ap->argchn.ap = 0; } @@ -1559,7 +1554,7 @@ else if((Namval_t*)t->comnamp >= SYSTYPESET && (Namval_t*)t->comnamp <= SYSTYPESET_END) { struct argnod *ap; - for(ap=t->comarg->argnxt.ap;ap;ap=ap->argnxt.ap) + for(ap = t->comarg.ap->argnxt.ap; ap; ap = ap->argnxt.ap) { if(*ap->argval!='-') break; @@ -1626,7 +1621,7 @@ Namval_t *np=(Namval_t*)t->comnamp; unsigned long r=0; int line = t->comline; - argp = t->comarg; + argp = t->comarg.ap; if(np) r = kiaentity(lexp,nv_name(np),-1,'p',-1,0,lexp->unknown,'b',0,""); else if(argp) @@ -1634,7 +1629,7 @@ if(r>0) sfprintf(lexp->kiatmp,"p;%..64d;p;%..64d;%d;%d;c;\n",lexp->current,r,line,line); if(t->comset && argno==0) - writedefs(lexp,t->comset,line,'v',t->comarg); + writedefs(lexp,t->comset,line,'v',t->comarg.ap); else if(np && nv_isattr(np,BLT_DCL)) writedefs(lexp,argp,line,0,NULL); else if(argp && strcmp(argp->argval,"read")==0) @@ -1647,14 +1642,14 @@ } #endif /* SHOPT_KIA */ /* noexec: warn about set - and set -k */ - if(sh_isoption(SH_NOEXEC) && t->comnamp && (argp = t->comarg->argnxt.ap) + if(sh_isoption(SH_NOEXEC) && t->comnamp && (argp = t->comarg.ap->argnxt.ap) && (Namval_t*)t->comnamp==SYSSET && ((tok = *argp->argval)=='-' || tok=='+') && (argp->argval1==0 || strchr(argp->argval,'k'))) errormsg(SH_DICT,ERROR_warn(0),e_lexobsolete5,sh.inlineno-(lexp->token=='\n'),argp->argval); /* expand argument list if possible */ if(argno>0 && !(flag&(SH_ARRAY|NV_APPEND))) - t->comarg = qscan(t,argno); - else if(t->comarg) + t->comarg.ap = qscan(t,argno); + else if(t->comarg.ap) t->comtyp |= COMSCAN; lexp->aliasok = 0; return (Shnode_t*)t; @@ -1737,13 +1732,13 @@ return lastio; } lexp->digits=0; - iop=(struct ionod*) stkalloc(sh.stk,sizeof(struct ionod)); + iop = stkalloc(sh.stk,sizeof(struct ionod)); iop->iodelim = 0; if(token=sh_lex(lexp)) { if(token==RPAREN && (iof&IOLSEEK) && lexp->comsub) { - lexp->arg = (struct argnod*)stkalloc(sh.stk,sizeof(struct argnod)+3); + lexp->arg = stkalloc(sh.stk,sizeof(struct argnod)+3); strcpy(lexp->arg->argval,"CUR"); lexp->arg->argflag = ARG_RAW; iof |= IOARITH; @@ -1814,7 +1809,7 @@ if(errout) { /* redirect standard output to standard error */ - ioq = (struct ionod*)stkalloc(sh.stk,sizeof(struct ionod)); + ioq = stkalloc(sh.stk,sizeof(struct ionod)); memset(ioq,0,sizeof(*ioq)); ioq->ioname = "1"; ioq->iolst = 0; @@ -1847,12 +1842,12 @@ { if((Namval_t*)ac->comnamp==SYSTEST) special = 2; /* convert "test -t" to "test -t 1" */ - else if(*(ac->comarg->argval)=='' && ac->comarg->argval1==0) + else if(*(ac->comarg.ap->argval)=='' && ac->comarg.ap->argval1==0) special = 3; /* convert " -t " to " -t 1 " */ } if(special) { - ap = ac->comarg->argnxt.ap; + ap = ac->comarg.ap->argnxt.ap; if(argn==(special+1) && ap->argval1==0 && *ap->argval=='!') ap = ap->argnxt.ap; else if(argn!=special) @@ -1875,11 +1870,11 @@ errormsg(SH_DICT,ERROR_warn(0),message,ac->comline); } /* leave space for an extra argument at the front */ - dp = (struct dolnod*)stkalloc(sh.stk,(unsigned)sizeof(struct dolnod) + ARG_SPARE*sizeof(char*) + argn*sizeof(char*)); + dp = stkalloc(sh.stk,(unsigned)sizeof(struct dolnod) + ARG_SPARE*sizeof(char*) + argn*sizeof(char*)); cp = dp->dolval+ARG_SPARE; dp->dolnum = argn; dp->dolbot = ARG_SPARE; - ap = ac->comarg; + ap = ac->comarg.ap; while(ap) { *cp++ = ap->argval; @@ -2103,9 +2098,8 @@ nv_scan(lexp->entity_tree,kia_add,lexp,NV_TAGGED,0); off1 = sfseek(lexp->kiafile,0,SEEK_END); sfseek(lexp->kiatmp,0,SEEK_SET); - sfmove(lexp->kiatmp,lexp->kiafile,SF_UNBOUND,-1); + sfmove(lexp->kiatmp,lexp->kiafile,SFIO_UNBOUND,-1); off2 = sfseek(lexp->kiafile,0,SEEK_END); -#ifdef SF_BUFCONST if(off2==off1) n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%lld;%d\nDIRECTORY;",(Sflong_t)lexp->kiabegin,(size_t)(off1-lexp->kiabegin)); else @@ -2113,13 +2107,6 @@ if(off2 >= INT_MAX) off2 = -(n+12); sfprintf(lexp->kiafile,"%010.10lld;%010d\n",(Sflong_t)off2+10, n+12); -#else - if(off2==off1) - n= sfprintf(lexp->kiafile,"DIRECTORY\nENTITY;%d;%d\nDIRECTORY;",lexp->kiabegin,off1-lexp->kiabegin); - else - 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(lexp->kiafile); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/path.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/path.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -574,7 +574,7 @@ sh.funload = 1; sh.inlineno = 1; error_info.line = 0; - sh_eval(sfnew(NULL,buff,IOBSIZE,fno,SF_READ),SH_FUNEVAL); + sh_eval(sfnew(NULL,buff,IOBSIZE,fno,SFIO_READ),SH_FUNEVAL); sh_close(fno); sh.readscript = 0; #if SHOPT_NAMESPACE @@ -728,15 +728,15 @@ sh.path_err = ENOENT; return NULL; } - isfun = (oldpp->flags&PATH_FPATH); - if(!isfun) + isfun = (oldpp->flags&PATH_FPATH) && !sh_isstate(SH_EXEC) && !sh_isstate(SH_XARG); + if(!isfun && !sh_isstate(SH_EXEC) && !sh_isstate(SH_XARG)) { #if SHOPT_DYNAMIC Shbltin_f addr; int n; #endif /* Handle default path-bound builtins */ - if(!sh_isstate(SH_XARG) && *stkptr(sh.stk,PATH_OFFSET)=='/' && nv_search(stkptr(sh.stk,PATH_OFFSET),sh.bltin_tree,0)) + if(*stkptr(sh.stk,PATH_OFFSET)=='/' && nv_search(stkptr(sh.stk,PATH_OFFSET),sh.bltin_tree,0)) return oldpp; #if SHOPT_DYNAMIC /* Load builtins from dynamic libraries */ @@ -797,7 +797,7 @@ (!(np = sh_addbuiltin(stkptr(sh.stk,PATH_OFFSET),NULL,NULL)) || funptr(np)!=addr) && (np = sh_addbuiltin(stkptr(sh.stk,PATH_OFFSET),addr,NULL))) { - np->nvenv = dll; + np->nvmeta = dll; goto found; } if(*stkptr(sh.stk,PATH_OFFSET)=='/' && nv_search(stkptr(sh.stk,PATH_OFFSET),sh.bltin_tree,0)) @@ -982,6 +982,8 @@ } else opath = arg0; + if(sh.subshell) + sh_subtmpfile(); spawnpid = path_spawn(opath,argv,envp,libpath,0); if(spawnpid==-1 && sh.path_err!=ENOENT) { @@ -1024,9 +1026,9 @@ char **xp=0, *xval, *libenv = (libpath?libpath->lib:0); Namval_t* np; char *s, *v; - int r, n, pidsize; + int r, n, pidsize=0; pid_t pid= -1; - if(!sh_isstate(SH_XARG) && nv_search(opath,sh.bltin_tree,0)) + if(!sh_isstate(SH_EXEC) && nv_search(opath,sh.bltin_tree,0)) { /* Found a path-bound built-in. Since this was not caught earlier in sh_exec(), it must have been found on a temporarily assigned PATH, as with 'PATH=/opt/ast/bin:$PATH cat'. @@ -1186,7 +1188,10 @@ case EISDIR: return -1; case ENOEXEC: - errno = ENOEXEC; + /* + * A script without #! -- it starts here. Summary of events: + * fork; exscript; longjmp back to sh_main; sh_reinit; exfile + */ if(spawn) { if(sh.subshell) @@ -1276,7 +1281,7 @@ } sh.cpid = 0; if(sp=fcfile()) - while(sfstack(sp,SF_POPSTACK)); + while(sfstack(sp,SFIO_POPSTACK)); job_clear(); if(sh.infd>0 && (sh.fdstatussh.infd&IOCLEX)) sh_close(sh.infd); @@ -1304,6 +1309,26 @@ sh_offstate(SH_FORKED); if(sh.sigflagSIGCHLD==SH_SIGOFF) sh.sigflagSIGCHLD = SH_SIGFAULT; + /* + * Export -x vars to new environment now, before longjmp & removing any local scope. + * Since sh_envgen() puts it all on the stack, create a stack to preserve 'environ'. + */ + { + static Stk_t *envstk; + Stk_t *savstk = sh.stk; + if (envstk) + stkset(envstk, NULL, 0); + else + envstk = stkopen(STK_SMALL); + sh.stk = envstk; + environ = sh_envgen(); + sh.stk = savstk; + stkfreeze(envstk,0); + } + /* + * Longjmp with SH_JMPSCRIPT triggers a chain of longjmps to restore state as appropriate, + * ending up back in sh_main() which then calls sh_reinit() and executes the script. + */ siglongjmp(*sh.jmplist,SH_JMPSCRIPT); UNREACHABLE(); /* silence warning on Haiku */ } @@ -1434,7 +1459,7 @@ else first = pp; pp->flags = flag; - if(strcmp(name,SH_CMDLIB_DIR)==0) + if(!sh_isstate(SH_EXEC) && strcmp(name,SH_CMDLIB_DIR)==0) { pp->dev = 1; pp->blib = pp->bbuf = sh_malloc(sizeof(LIBCMD)); @@ -1536,7 +1561,7 @@ const char *cp; Pathcomp_t *old=0; int offset = stktell(sh.stk); - char *savptr; + char *savptr = NULL; if(!path && type!=PATH_PATH) return first; if(type!=PATH_FPATH) @@ -1576,7 +1601,11 @@ path_delete(old); } if(offset) + { + if(!savptr) + abort(); stkset(sh.stk,savptr,offset); + } else stkseek(sh.stk,0); return first; @@ -1653,7 +1682,7 @@ Pathcomp_t *path_unsetfpath(void) { Pathcomp_t *first = (Pathcomp_t*)sh.pathlist; - Pathcomp_t *pp=first, *old=0; + Pathcomp_t *pp=first, *old=0; if(sh.fpathdict) { struct Ufunction *rp, *rpnext; @@ -1741,7 +1770,7 @@ void path_settrackedalias(const char *name, Pathcomp_t *pp) { Namval_t *np; - if(sh_isstate(SH_DEFPATH) || sh_isstate(SH_XARG)) + if(sh_isstate(SH_DEFPATH) || sh_isstate(SH_XARG) || sh_isstate(SH_EXEC)) return; if(!(np = nv_search(name,sh_subtracktree(1),NV_ADD|NV_NOSCOPE))) return; @@ -1777,6 +1806,7 @@ Namval_t *np; if(!sh_isstate(SH_DEFPATH) && !sh_isstate(SH_XARG) + && !sh_isstate(SH_EXEC) && (np=nv_search(name,sh.track_tree,0)) && !nv_isattr(np,NV_NOALIAS) && np->nvalue.cp)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/shcomp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/shcomp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -198,21 +198,17 @@ { if(t->com.comtyp&COMSCAN) { - if(t->com.comarg->argnxt.ap) - break; - } - else - { - struct dolnod *ap = (struct dolnod*)t->com.comarg; - if(ap->dolnum>1) + if(t->com.comarg.ap->argnxt.ap) break; } + else if(t->com.comarg.dp->dolnum > 1) + break; } } } /* copy any remaining input */ if(!sfeof(in)) - sfmove(in,out,SF_UNBOUND,-1); + sfmove(in,out,SFIO_UNBOUND,-1); if(in!=sfstdin) sfclose(in); if(out!=sfstdout)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/streval.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/streval.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -153,7 +153,7 @@ Sfdouble_t small_stackSMALL_STACK+1,arg9; const char *ptr = ""; char *lastval=0; - int lastsub; + int lastsub=0; Math_f fun; struct lval node; node.emode = ep->emode; @@ -172,7 +172,7 @@ if(ep->staksize < SMALL_STACK) sp = small_stack; else - sp = (Sfdouble_t*)stkalloc(sh.stk,ep->staksize*(sizeof(Sfdouble_t)+1)); + sp = stkalloc(sh.stk,ep->staksize*(sizeof(Sfdouble_t)+1)); tp = (char*)(sp+ep->staksize); tp--,sp--; while(c = *cp++) @@ -572,6 +572,7 @@ lvalue.value = 0; lvalue.nargs = 0; lvalue.fun = 0; + assignop.flag = 0; /* silence gcc warning */ again: op = gettok(vp); c = 2*MAXPREC+1; @@ -914,7 +915,7 @@ } sfputc(sh.stk,0); offset = stktell(sh.stk); - ep = (Arith_t*)stkfreeze(sh.stk,0); + ep = stkfreeze(sh.stk,0); ep->expr = string; ep->elen = strlen(string); ep->code = (unsigned char*)(ep+1);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/string.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/string.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,6 +23,7 @@ #include "shopt.h" #include <ast.h> #include <ast_wchar.h> +#include <lc.h> #include "defs.h" #include <ccode.h> #include "shtable.h" @@ -306,10 +307,10 @@ */ static int sh_isprint(int c) { - if(!mbwide()) /* not in multibyte locale? */ + if(!mbwide() || ('a'==97 && c<=127)) /* not in multibyte locale, or multibyte but c is ASCII? */ return isprint(c); /* use plain isprint(3) */ - else if(c == ' ') /* optimisation: check ASCII space first */ - return 1; /* return true like isprint(3) */ + else if(!(lcinfo(LC_CTYPE)->lc->flags&LC_utf8)) /* not in UTF-8 locale? */ + return iswgraph(c); /* the test below would not be valid */ else if(iswgraph(0x5E38) && !iswgraph(0xFEFF)) /* can we use iswgraph(3)? */ return iswgraph(c); /* use iswgraph(3) */ else /* fallback: */ @@ -411,7 +412,7 @@ if(mbwide()) { /* We're in a multibyte locale */ - if(c<0 || c<128 && !isprint(c)) + if(c<0 || ('a'!=97 || c<128) && !isprint(c)) { /* Invalid multibyte char, or unprintable ASCII char: quote as hex byte */ c = *((unsigned char *)op);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/subshell.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/subshell.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -79,7 +79,6 @@ int tmpfd; /* saved tmp file descriptor */ int pipefd; /* read fd if pipe is created */ char jobcontrol; - char monitor; unsigned char fdstatus; int fdsaved; /* bit mask for saved file descriptors */ int sig; /* signal for $$ */ @@ -89,9 +88,9 @@ int cpipe; char subshare; char comsub; - unsigned int rand_seed; /* parent shell $RANDOM seed */ - int rand_last; /* last random number from $RANDOM in parent shell */ - int rand_state; /* 0 means sp->rand_seed hasn't been set, 1 is the opposite */ + unsigned int rand_seed; /* parent shell $RANDOM seed */ + int rand_last; /* last random number from $RANDOM in parent shell */ + int rand_state; /* 0 means sp->rand_seed hasn't been set, 1 is the opposite */ #if _lib_fchdir int pwdfd; /* file descriptor for PWD */ char pwdclose; @@ -108,7 +107,7 @@ */ void sh_subtmpfile(void) { - if(sfset(sfstdout,0,0)&SF_STRING) + if(sfset(sfstdout,0,0)&SFIO_STRING) { int fd; struct checkpt *pp = (struct checkpt*)sh.jmplist; @@ -126,7 +125,7 @@ UNREACHABLE(); } /* popping a discipline forces a /tmp file create */ - sfdisc(sfstdout,SF_POPDISC); + sfdisc(sfstdout,SFIO_POPDISC); if((fd=sffileno(sfstdout))<0) { errormsg(SH_DICT,ERROR_SYSTEM|ERROR_PANIC,"could not create temp file"); @@ -143,8 +142,8 @@ sh.fdstatusfd = IOCLOSE; } sh_iostream(1); - sfset(sfstdout,SF_SHARE|SF_PUBLIC,1); - sfpool(sfstdout,sh.outpool,SF_WRITE); + sfset(sfstdout,SFIO_SHARE|SFIO_PUBLIC,1); + sfpool(sfstdout,sh.outpool,SFIO_WRITE); if(pp && pp->olist && pp->olist->strm == sfstdout) pp->olist->strm = 0; } @@ -349,7 +348,7 @@ } nv_setsize(mp,nv_size(np)); if(!(flags&NV_MINIMAL)) - mp->nvenv = np->nvenv; + mp->nvmeta = np->nvmeta; mp->nvfun = np->nvfun; if(np->nvfun && nofree) np->nvfun->nofree = nofree; @@ -364,7 +363,7 @@ else mp->nvalue = np->nvalue; if(nofree && np->nvfun && !np->nvfun->nofree) - free((char*)np->nvfun); + free(np->nvfun); np->nvfun = 0; if(nv_isattr(mp,NV_EXPORT)) { @@ -595,7 +594,6 @@ /* disable job control */ sh.spid = 0; sp->jobcontrol = job.jobcontrol; - sp->monitor = (sh_isstate(SH_MONITOR)!=0); job.jobcontrol=0; sh_offstate(SH_MONITOR); sp->pipe = sp; @@ -612,7 +610,7 @@ UNREACHABLE(); } sfswap(iop,sfstdout); - sfset(sfstdout,SF_READ,0); + sfset(sfstdout,SFIO_READ,0); sh.fdstatus1 = IOWRITE; flags |= sh_state(SH_NOFORK); } @@ -642,13 +640,14 @@ /* Virtual subshells are not safe to suspend (^Z, SIGTSTP) in the interactive main shell. */ if(sh_isstate(SH_INTERACTIVE)) { + sh_offstate(SH_INTERACTIVE); sh_offstate(SH_TTYWAIT); if(comsub) sigblock(SIGTSTP); else sh_subfork(); } - sh_offstate(SH_INTERACTIVE); + sh_offstate(SH_PROFILE); sh_exec(t,flags); } } @@ -657,7 +656,6 @@ /* trap on EXIT not handled by child */ char *trap=sh.st.trapcom0; sh.st.trapcom0 = 0; /* prevent recursion */ - sh.oldexit = sh.exitval; sh_trap(trap,0); free(trap); } @@ -681,7 +679,7 @@ sigrelease(SIGTSTP); /* re-enable job control */ job.jobcontrol = sp->jobcontrol; - if(sp->monitor) + if(savst.states & sh_state(SH_MONITOR)) sh_onstate(SH_MONITOR); if(sp->pipefd>=0) { @@ -725,7 +723,7 @@ sh.fdstatusfd = (sh.fdstatus1|IOCLEX); sh.fdstatus1 = IOCLOSE; } - sfset(iop,SF_READ,1); + sfset(iop,SFIO_READ,1); } if(sp->saveout) sfswap(sp->saveout,sfstdout);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/tdump.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/tdump.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -218,12 +218,12 @@ { p_redirect(com->comio); p_arg(com->comset); - if(!com->comarg) + if(!com->comarg.ap) sfputl(outfile,-1); else if(com->comtyp&COMSCAN) - p_arg(com->comarg); + p_arg(com->comarg.ap); else - p_comlist((struct dolnod*)com->comarg); + p_comlist(com->comarg.dp); return sfputu(outfile,com->comline); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/trestore.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/trestore.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -40,7 +40,7 @@ static Sfio_t *infile; -#define getnode(type) ((Shnode_t*)stkalloc(sh.stk,sizeof(struct type))) +#define getnode(type) stkalloc(sh.stk,sizeof(struct type)) Shnode_t *sh_trestore(Sfio_t *in) { @@ -135,9 +135,9 @@ t->funct.functloc = -1; t->funct.functline = sfgetu(infile); t->funct.functnam = r_string(); - savstak = stkopen(STK_SMALL); - savstak = stkinstall(savstak, 0); - slp = (struct slnod*)stkalloc(sh.stk,sizeof(struct slnod)+sizeof(struct functnod)); + savstak = sh.stk; + sh.stk = stkopen(STK_SMALL); + slp = stkalloc(sh.stk,sizeof(struct slnod)+sizeof(struct functnod)); slp->slchild = 0; slp->slnext = sh.st.staklist; sh.st.staklist = 0; @@ -149,7 +149,8 @@ t->funct.functtre = r_tree(); t->funct.functstak = slp; t->funct.functargs = (struct comnod*)r_tree(); - slp->slptr = stkinstall(savstak,0); + slp->slptr = sh.stk; + sh.stk = savstak; slp->slchild = sh.st.staklist; break; } @@ -177,7 +178,7 @@ Stk_t *stkp=sh.stk; while((l=sfgetu(infile))>0) { - ap = (struct argnod*)stkseek(stkp,(unsigned)l+ARGVAL); + ap = stkseek(stkp,(unsigned)l+ARGVAL); if(!aptop) aptop = ap; else @@ -190,7 +191,7 @@ ap->argvall = 0; ap->argchn.cp = 0; ap->argflag = sfgetc(infile); - ap = (struct argnod*)stkfreeze(stkp,0); + ap = stkfreeze(stkp,0); if(*ap->argval==0 && (ap->argflag&ARG_EXP)) ap->argchn.ap = (struct argnod*)r_tree(); else if(*ap->argval==0 && (ap->argflag&~(ARG_APPEND|ARG_MESSAGE|ARG_QUOTED|ARG_ARRAY))==0) @@ -256,12 +257,12 @@ com->comstate = 0; if(com->comtyp&COMSCAN) { - com->comarg = r_arg(); - if(com->comarg->argflag==ARG_RAW) - cmdname = com->comarg->argval; + com->comarg.ap = r_arg(); + if(com->comarg.ap->argflag==ARG_RAW) + cmdname = com->comarg.ap->argval; } - else if(com->comarg = (struct argnod*)r_comlist()) - cmdname = ((struct dolnod*)(com->comarg))->dolvalARG_SPARE; + else if(com->comarg.dp = r_comlist()) + cmdname = com->comarg.dp->dolvalARG_SPARE; com->comline = sfgetu(infile); com->comnamq = 0; if(cmdname) @@ -286,7 +287,7 @@ char **argv; if((l=sfgetl(infile))>0) { - dol = (struct dolnod*)stkalloc(sh.stk,sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE)); + dol = stkalloc(sh.stk,sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE)); dol->dolnum = l; dol->dolbot = ARG_SPARE; argv = dol->dolval+ARG_SPARE; @@ -301,7 +302,7 @@ struct regnod *reg=0,*regold,*regtop=0; while((l=sfgetl(infile))>=0) { - reg = (struct regnod*)getnode(regnod); + reg = getnode(regnod); if(!regtop) regtop = reg; else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/sh/xec.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/sh/xec.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1982-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -211,7 +211,6 @@ int c,n,offset = stktell(sh.stk); const char *first; #ifdef timeofday - struct timeval tv_cpu_sum; struct timeval *tvp; #else double d; @@ -286,13 +285,14 @@ else { /* scale fraction from micro to milli, centi, or deci second according to precision */ + long sec = tvp->tv_sec; int n, frac = tvp->tv_usec; for(n = 3 + (3 - precision); n > 0; --n) frac /= 10; if(precision) - sfprintf(sh.stk, "%d%c%0*d", tvp->tv_sec, sh.radixpoint, precision, frac); + sfprintf(sh.stk, "%ld%c%0*d", sec, sh.radixpoint, precision, frac); else - sfprintf(sh.stk, "%d", tvp->tv_sec); + sfprintf(sh.stk, "%ld", sec); } #else if(c=='R') @@ -334,8 +334,8 @@ { Namval_t *np=com->comnamp; int n = p_arg(com->comset,ARG_ASSIGN); - if(com->comarg && (com->comtyp&COMSCAN)) - n+= p_arg(com->comarg,0); + if((com->comtyp&COMSCAN) && com->comarg.ap) + n += p_arg(com->comarg.ap,0); if(com->comstate && np) { /* call builtin to cleanup state */ @@ -352,7 +352,7 @@ bp->data = save_data; } com->comstate = 0; - if(com->comarg && !np) + if(com->comarg.ap && !np) n++; return n; } @@ -441,12 +441,6 @@ } return n; } -# define OPTIMIZE_FLAG (ARG_OPTIMIZE) -# define OPTIMIZE (flags&OPTIMIZE_FLAG) -#else -# define OPTIMIZE_FLAG (0) -# define OPTIMIZE (0) -# define sh_tclear(x) #endif /* SHOPT_OPTIMIZE */ static void out_pattern(Sfio_t *iop, const char *cp, int n) @@ -501,7 +495,7 @@ static void put_level(Namval_t* np,const char *val,int flags,Namfun_t *fp) { Shscope_t *sp; - int16_t level, oldlevel = np->nvalue.s; + int16_t level, oldlevel = np->nvalue.s; if(val) nv_putv(np,val,flags,fp); else @@ -535,8 +529,8 @@ { Namval_t *np = SH_COMMANDNOD; int n=4, offset=stktell(sh.stk); - char *sav = stkfreeze(sh.stk,0); - struct sh_scoped *savst = (struct sh_scoped*)stkalloc(sh.stk,sizeof(struct sh_scoped)); + void *sav = stkfreeze(sh.stk,0); + struct sh_scoped *savst = stkalloc(sh.stk,sizeof(struct sh_scoped)); const char *cp = "+=( "; if(sh.indebug) return 0; @@ -603,7 +597,7 @@ struct slnod *saveslp = sh.st.staklist; int jmpval; struct checkpt *pp = (struct checkpt*)sh.jmplist; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); static Sfio_t *io_save; volatile int traceon=0, lineno=0; int binscript=sh.binscript; @@ -708,7 +702,7 @@ char *sp=0,*cp; Namarr_t *ap; Namval_t *np; - if(!nv_isattr(nq,NV_MINIMAL|NV_EXPORT|NV_ARRAY) && (np=(Namval_t*)nq->nvenv) && nv_isarray(np)) + if(!nv_isattr(nq,NV_MINIMAL|NV_EXPORT|NV_ARRAY) && (np = nq->nvmeta) && nv_isarray(np)) nq = np; cp = nv_name(nq); memset(nr,0,sizeof(*nr)); @@ -735,8 +729,8 @@ 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; + L_ARGNOD->nvfun = NULL; + L_ARGNOD->nvmeta = NULL; if(sp) { nv_putval(SH_SUBSCRNOD,nr->sub=sp,NV_NOFREE); @@ -767,7 +761,7 @@ savein = dup(0); if(fd==0) fd = savein; - sp = sfnew(NULL,NULL,SF_UNBOUND,fd,SF_READ); + sp = sfnew(NULL,NULL,SFIO_UNBOUND,fd,SFIO_READ); while(close(0)<0 && errno==EINTR) errno = err; open(e_devnull,O_RDONLY); @@ -861,7 +855,7 @@ { int type = t->tre.tretyp; char *com0 = 0; - int errorflg = (flags&sh_state(SH_ERREXIT))|OPTIMIZE; + int errorflg = (flags&sh_state(SH_ERREXIT))|(flags & ARG_OPTIMIZE); int execflg = (flags&sh_state(SH_NOFORK)); int execflg2 = (flags&sh_state(SH_FORKED)); int mainloop = (flags&sh_state(SH_INTERACTIVE)); @@ -887,8 +881,6 @@ sh_offstate(SH_DEFPATH); if(!(flags & sh_state(SH_ERREXIT))) sh_offstate(SH_ERREXIT); - if(!sh.intrap) - sh.oldexit = sh.exitval; sh.exitval=0; sh.lastsig = 0; sh.chldexitsig = 0; @@ -908,11 +900,11 @@ type &= (COMMSK|COMSCAN); sh_stats(STAT_SCMDS); error_info.line = t->com.comline-sh.st.firstline; - com = sh_argbuild(&argn,&(t->com),OPTIMIZE); + com = sh_argbuild(&argn,&(t->com),flags & ARG_OPTIMIZE); echeck = 1; if(t->tre.tretyp&COMSCAN) { - argp = t->com.comarg; + argp = t->com.comarg.ap; if(argp && *com && !(argp->argflag&ARG_RAW)) sh_sigcheck(); } @@ -964,7 +956,7 @@ } if(com0) { - if((!np || !np->nvflag) && !strchr(com0,'/')) + if((!np || !np->nvflag) && !sh_isstate(SH_EXEC) && !strchr(com0,'/')) { Dt_t *root = command?sh.bltin_tree:sh.fun_tree; np = nv_bfsearch(com0, root, &nq, &cp); @@ -1043,14 +1035,18 @@ else { /* avoid exit on error from nv_setlist, e.g. read-only variable */ - struct checkpt *chkp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *chkp = stkalloc(sh.stk,sizeof(struct checkpt)); sh_pushcontext(chkp,SH_JMPCMD); jmpval = sigsetjmp(chkp->buff,0); if(!jmpval) nv_setlist(argp,flgs,tp); sh_popcontext(chkp); if(jmpval) /* error occurred */ + { + if(jmpval>SH_JMPCMD) + siglongjmp(*sh.jmplist,jmpval); goto setexit; + } } if(np==sh.typeinit) sh.typeinit = 0; @@ -1112,15 +1108,16 @@ } if(io) sfsync(sh.outpool); - if(!np) + if(!np && !sh_isstate(SH_EXEC)) { - if(*com0 == '/' && !sh_isoption(SH_RESTRICTED)) + if(!sh_isoption(SH_RESTRICTED) || !strchr(com0,'/')) { - /* Check for path-bound builtin referenced by absolute canonical path, in - case the parser didn't provide a pointer (e.g. '$(whence -p cat) foo') */ + /* Search for a built-in again (including, unless restricted, a path-bound + * builtin referenced by canonical path) in case no node pointer was found + * above or at parse time */ np = nv_search(com0, sh.bltin_tree, 0); } - else if(strchr(com0,'/')) + if(np || strchr(com0,'/')) { /* Do nothing */ } @@ -1148,14 +1145,14 @@ pipejob = 1; } /* check for builtins */ - if(np && is_abuiltin(np) && !sh_isstate(SH_XARG)) + if(np && is_abuiltin(np)) { volatile char scope=0, share=0, was_mktype=(sh.mktype!=NULL); volatile void *save_ptr; volatile void *save_data; int save_prompt; int was_nofork = execflg?sh_isstate(SH_NOFORK):0; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); bp = &sh.bltindata; save_ptr = bp->ptr; save_data = bp->data; @@ -1192,10 +1189,10 @@ if(!(nv_isattr(np,BLT_ENV))) { sfsync(NULL); - share = sfset(sfstdin,SF_SHARE,0); + share = sfset(sfstdin,SFIO_SHARE,0); sh_onstate(SH_STOPOK); - sfpool(sfstderr,NULL,SF_WRITE); - sfset(sfstderr,SF_LINE,1); + sfpool(sfstderr,NULL,SFIO_WRITE); + sfset(sfstderr,SFIO_LINE,1); save_prompt = sh.nextprompt; sh.nextprompt = 0; } @@ -1217,7 +1214,7 @@ bp->data = t->com.comstate; bp->sigset = 0; bp->notify = 0; - bp->flags = (OPTIMIZE!=0); + bp->flags = ((flags & ARG_OPTIMIZE)!=0); if(sh.subshell && nv_isattr(np,BLT_NOSFIO)) sh_subtmpfile(); if(argn) @@ -1265,11 +1262,11 @@ if(!(nv_isattr(np,BLT_ENV))) { 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(sfstdin,NULL,SF_WRITE); + if(share&SFIO_SHARE) + sfset(sfstdin,SFIO_PUBLIC|SFIO_SHARE,1); + sfset(sfstderr,SFIO_LINE,0); + sfpool(sfstderr,sh.outpool,SFIO_WRITE); + sfpool(sfstdin,NULL,SFIO_WRITE); sh.nextprompt = save_prompt; } sh_popcontext(buffp); @@ -1302,7 +1299,7 @@ { volatile int indx; volatile char scope = 0; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); #if SHOPT_NAMESPACE Namval_t *namespace=0; #endif /* SHOPT_NAMESPACE */ @@ -1338,7 +1335,7 @@ } } /* increase refcnt for unset */ - slp = (struct slnod*)np->nvenv; + slp = np->nvmeta; sh_funstaks(slp->slchild,1); if(slp->slptr) stklink(slp->slptr); @@ -1348,8 +1345,8 @@ if(nv_isattr(np,NV_STATICF) && (mp=nv_type(nq))) nq = mp; sh.last_table = last_table; - nodep = (Namval_t*)stkalloc(sh.stk,sizeof(Namval_t)); - nrp = (struct Namref*)stkalloc(sh.stk,sizeof(struct Namref)); + nodep = stkalloc(sh.stk,sizeof(Namval_t)); + nrp = stkalloc(sh.stk,sizeof(struct Namref)); mode = set_instance(nq,nodep,nrp); } if(io) @@ -1380,7 +1377,7 @@ } namespace = enter_namespace(namespace); #endif /* SHOPT_NAMESPACE */ - sh_funct(np,argn,com,t->com.comset,(flags&~OPTIMIZE_FLAG)); + sh_funct(np,argn,com,t->com.comset,(flags&~ARG_OPTIMIZE)); } #if SHOPT_NAMESPACE enter_namespace(namespace); @@ -1522,7 +1519,7 @@ */ { volatile int jmpval; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); struct ionod *iop; int rewrite=0; #if !SHOPT_DEVFD @@ -1664,7 +1661,7 @@ pid_t pid = 0; int jmpval, waitall = 0; int simple = (t->fork.forktre->tre.tretyp&COMMSK)==TCOM; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); if(sh.subshell && !sh.subshare && t->fork.forkio) { /* Subshell forking workaround for https://github.com/ksh93/ksh/issues/161 @@ -1694,7 +1691,7 @@ * treat as non-shareable to improve performance */ if(simple) - sfset(sfstdin,SF_PUBLIC|SF_SHARE,0); + sfset(sfstdin,SFIO_PUBLIC|SFIO_SHARE,0); waitall = job.waitall; job.waitall = 0; pid = job.parent; @@ -1749,13 +1746,13 @@ */ case TPAR: echeck = 1; - flags &= ~OPTIMIZE_FLAG; + flags &= ~ARG_OPTIMIZE; if(!sh.subshell && !sh.st.trapdontexec && (flags&sh_state(SH_NOFORK))) { /* This is the last command, so avoid creating a subshell */ char *savsig; int nsig,jmpval; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); sh.st.otrapcom = 0; if((nsig=sh.st.trapmax*sizeof(char*))>0 || sh.st.trapcom0) { @@ -1816,7 +1813,7 @@ job.curpgid = 0; while((tn=tn->lst.lstrit) && tn->tre.tretyp==TFIL) job.waitall++; - exitval = job.exitval = (int*)stkalloc(sh.stk,job.waitall*sizeof(int)); + exitval = job.exitval = stkalloc(sh.stk,job.waitall*sizeof(int)); memset(exitval,0,job.waitall*sizeof(int)); } else @@ -1901,7 +1898,7 @@ { do { - sh_exec(t->lst.lstlef,errorflg|OPTIMIZE); + sh_exec(t->lst.lstlef,errorflg|(flags & ARG_OPTIMIZE)); t = t->lst.lstrit; } while(t->tre.tretyp == TLST); @@ -1915,7 +1912,7 @@ case TAND: if(type&TTEST) skipexitset++; - if(sh_exec(t->lst.lstlef,OPTIMIZE)==0) + if(sh_exec(t->lst.lstlef, flags & ARG_OPTIMIZE)==0) sh_exec(t->lst.lstrit,flags); break; @@ -1925,7 +1922,7 @@ case TORF: if(type&TTEST) skipexitset++; - if(sh_exec(t->lst.lstlef,OPTIMIZE)!=0) + if(sh_exec(t->lst.lstlef, flags & ARG_OPTIMIZE)!=0) sh_exec(t->lst.lstrit,flags); break; @@ -1937,7 +1934,7 @@ char **args; int nargs; Namval_t *np; - int flag = errorflg|OPTIMIZE_FLAG; + int flag = errorflg|ARG_OPTIMIZE; struct dolnod *argsav = NULL; struct comnod *tp; char *cp, *trap, *null_pointer = NULL; @@ -1945,7 +1942,7 @@ char *av5; #if SHOPT_OPTIMIZE int jmpval = ((struct checkpt*)sh.jmplist)->mode; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); void *optlist = sh.optlist; sh.optlist = 0; sh_tclear(t->for_.fortre); @@ -1984,7 +1981,7 @@ save_prompt = sh.nextprompt; sh.nextprompt = 3; sh.timeout = 0; - sh.exitval=sh_readline(&null_pointer,0,1,0,1000*sh.st.tmout); + sh.exitval=sh_readline(&null_pointer,0,1,0,1000*(Sflong_t)sh.st.tmout); sh.nextprompt = save_prompt; if(sh.exitval||sfeof(sfstdin)||sferror(sfstdin)) { @@ -2015,12 +2012,15 @@ } } if(nameref) - nv_offattr(np,NV_REF); + nv_offattr(np,NV_REF|NV_NOOPTIMIZE); else if(nv_isattr(np, NV_ARRAY)) nv_putsub(np,NULL,0L); nv_putval(np,cp,0); if(nameref) + { nv_setref(np,NULL,NV_VARNAME); + nv_onattr(np,NV_NOOPTIMIZE); + } if(trap=sh.st.trapSH_DEBUGTRAP) { av0 = (t->tre.tretyp&COMSCAN)?"select":"for"; @@ -2031,7 +2031,7 @@ sh_debug(trap,NULL,NULL,av,0); } sh_exec(t->for_.fortre,flag); - flag &= ~OPTIMIZE_FLAG; + flag &= ~ARG_OPTIMIZE; if(t->tre.tretyp&COMSCAN) { if((cp=nv_getval(sh_scoped(REPLYNOD))) && *cp==0) @@ -2044,6 +2044,8 @@ if(sh.st.breakcnt<0) sh.st.breakcnt++; } + if(nameref) + nv_offattr(np,NV_NOOPTIMIZE); #if SHOPT_OPTIMIZE endfor: sh_popcontext(buffp); @@ -2066,7 +2068,7 @@ case TWH: { volatile int r=0; - int first = OPTIMIZE_FLAG; + int first = ARG_OPTIMIZE; Shnode_t *tt = t->wh.whtre; #if SHOPT_FILESCAN Sfio_t *iop=0; @@ -2074,10 +2076,8 @@ #endif /* SHOPT_FILESCAN */ #if SHOPT_OPTIMIZE int jmpval = ((struct checkpt*)sh.jmplist)->mode; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); void *optlist = sh.optlist; -#endif /* SHOPT_OPTIMIZE */ -#if SHOPT_OPTIMIZE sh.optlist = 0; sh_tclear(t->wh.whtre); sh_tclear(t->wh.dotre); @@ -2090,7 +2090,7 @@ /* Recognize filescan loop for a lone input redirection following 'while' */ if(type==TWH /* 'while' (not 'until') */ && tt->tre.tretyp==TCOM /* one simple command follows 'while'... */ - && !tt->com.comarg /* ...with no command name or arguments... */ + && !tt->com.comarg.dp /* ...with no command name or arguments... */ && !tt->com.comset /* ...and no variable assignments list... */ && tt->com.comio /* ...and one I/O redirection... */ && !tt->com.comio->ionxt /* ...but not more than one... */ @@ -2106,7 +2106,7 @@ #if SHOPT_FILESCAN if(iop) { - if(!(sh.cur_line=sfgetr(iop,'\n',SF_STRING))) + if(!(sh.cur_line=sfgetr(iop,'\n',SFIO_STRING))) break; } else @@ -2121,7 +2121,7 @@ if(sh.st.breakcnt==0 && t->wh.whinc) sh_exec((Shnode_t*)t->wh.whinc,first); first = 0; - errorflg &= ~OPTIMIZE_FLAG; + errorflg &= ~ARG_OPTIMIZE; #if SHOPT_FILESCAN sh.offsets0 = -1; sh.offsets1 = 0; @@ -2165,7 +2165,7 @@ error_info.line = t->ar.arline-sh.st.firstline; arg0 = "(("; if(!(t->ar.arexpr->argflag&ARG_RAW)) - arg1 = sh_macpat(t->ar.arexpr,OPTIMIZE|ARG_ARITH); + arg1 = sh_macpat(t->ar.arexpr,(flags & ARG_OPTIMIZE)|ARG_ARITH); else arg1 = t->ar.arexpr->argval; arg2 = "))"; @@ -2188,7 +2188,7 @@ * Conditional block: if ... fi */ case TIF: - if(sh_exec(t->if_.iftre,OPTIMIZE)==0) + if(sh_exec(t->if_.iftre, flags & ARG_OPTIMIZE)==0) sh_exec(t->if_.thtre,flags); else if(t->if_.eltre) sh_exec(t->if_.eltre, flags); @@ -2202,7 +2202,7 @@ case TSW: { const int eflag = flags & sh_state(SH_ERREXIT); - char *r = sh_macpat(t->sw.swarg,OPTIMIZE); + char *r = sh_macpat(t->sw.swarg, flags & ARG_OPTIMIZE); error_info.line = t->sw.swline - sh.st.firstline; if(sh.st.trapSH_DEBUGTRAP) { @@ -2222,7 +2222,7 @@ const unsigned char raw = rex->argflag & ARG_RAW; char *s; if(rex->argflag&ARG_MAC) - s = sh_macpat(rex,OPTIMIZE|ARG_EXP); + s = sh_macpat(rex,(flags & ARG_OPTIMIZE)|ARG_EXP); else s = rex->argval; if(raw && strcmp(r,s)==0 || !raw && strmatch(r,s)) @@ -2257,7 +2257,7 @@ #endif if(type!=TTIME) { - sh_exec(t->par.partre,OPTIMIZE); + sh_exec(t->par.partre, flags & ARG_OPTIMIZE); sh.exitval = !sh.exitval; break; } @@ -2277,7 +2277,7 @@ } #endif sh_onstate(SH_TIMING); - sh_exec(t->par.partre,sh_isstate(SH_ERREXIT)|OPTIMIZE); + sh_exec(t->par.partre,sh_isstate(SH_ERREXIT)|(flags & ARG_OPTIMIZE)); if(!timer_on) sh_offstate(SH_TIMING); } @@ -2345,7 +2345,7 @@ Namval_t *oldnspace = sh.namespace; int offset = stktell(sh.stk); int flags=NV_NOARRAY|NV_VARNAME; - struct checkpt *chkp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *chkp = stkalloc(sh.stk,sizeof(struct checkpt)); int jmpval; if(cp) { @@ -2431,7 +2431,7 @@ if(np->nvalue.rp) { struct Ufunction *rp = np->nvalue.rp; - slp = (struct slnod*)np->nvenv; + slp = np->nvmeta; sh_funstaks(slp->slchild,-1); if(slp->slptr) { @@ -2476,14 +2476,14 @@ sh_funstaks(slp->slchild,1); if(slp->slptr) stklink(slp->slptr); - np->nvenv = (char*)slp; + np->nvmeta = slp; 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->fname = 0; - np->nvalue.rp->argv = ac?((struct dolnod*)ac->comarg)->dolval+1:0; - np->nvalue.rp->argc = ac?((struct dolnod*)ac->comarg)->dolnum:0; + np->nvalue.rp->argv = ac ? ac->comarg.dp->dolval + 1 : NULL; + np->nvalue.rp->argc = ac ? ac->comarg.dp->dolnum : 0; np->nvalue.rp->fdict = sh.fun_tree; fp = (struct functnod*)(slp+1); if(fp->functtyp==(TFUN|FAMP)) @@ -2527,7 +2527,7 @@ echeck = 1; if((type&TPAREN)==TPAREN) { - sh_exec(t->lst.lstlef,OPTIMIZE); + sh_exec(t->lst.lstlef, flags & ARG_OPTIMIZE); n = !sh.exitval; } else @@ -2537,9 +2537,9 @@ char *trap; char *argv6; n = type>>TSHIFT; - left = sh_macpat(&(t->lst.lstlef->arg),OPTIMIZE); + left = sh_macpat(&(t->lst.lstlef->arg), flags & ARG_OPTIMIZE); if(type&TBINARY) - right = sh_macpat(&(t->lst.lstrit->arg),((n==TEST_PEQ||n==TEST_PNE)?ARG_EXP:0)|OPTIMIZE); + right = sh_macpat(&(t->lst.lstrit->arg),((n==TEST_PEQ||n==TEST_PNE)?ARG_EXP:0)|(flags & ARG_OPTIMIZE)); if(trap=sh.st.trapSH_DEBUGTRAP) argv0 = (type&TNEGATE)?((char*)e_tstbegin):""; if(sh_isoption(SH_XTRACE)) @@ -2626,7 +2626,7 @@ } if(!skipexitset) exitset(); - if(!(OPTIMIZE)) + if(!(flags & ARG_OPTIMIZE)) { if(sav != stkptr(sh.stk,0)) stkset(sh.stk,sav,0); @@ -2653,19 +2653,19 @@ int sh_run(int argn, char *argv) { struct dolnod *dp; - struct comnod *t = (struct comnod*)stkalloc(sh.stk,sizeof(struct comnod)); + struct comnod *t = stkalloc(sh.stk,sizeof(struct comnod)); int savtop = stktell(sh.stk); - char *savptr = stkfreeze(sh.stk,0); + void *savptr = stkfreeze(sh.stk,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*)stkalloc(sh.stk, (unsigned)sizeof(struct dolnod) + ARG_SPARE*sizeof(char*) + argn*sizeof(char*)); + dp = stkalloc(sh.stk, (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; + t->comarg.dp = dp; if(!strchr(argv0,'/')) t->comnamp = nv_bfsearch(argv0,sh.fun_tree,(Namval_t**)&t->comnamq,NULL); argn=sh_exec((Shnode_t*)t,sh_isstate(SH_ERREXIT)); @@ -2690,7 +2690,7 @@ int decl = (nl&2); nl &= ~2; /* make this trace atomic */ - sfset(sfstderr,SF_SHARE|SF_PUBLIC,0); + sfset(sfstderr,SFIO_SHARE|SFIO_PUBLIC,0); if(!(cp=nv_getval(sh_scoped(PS4NOD)))) cp = "+ "; else @@ -2727,7 +2727,7 @@ sfputr(sfstderr,cp,*argv?' ':nl); } } - sfset(sfstderr,SF_SHARE|SF_PUBLIC,1); + sfset(sfstderr,SFIO_SHARE|SFIO_PUBLIC,1); return 1; } return 0; @@ -2918,12 +2918,12 @@ np = (Namval_t*)fp; funenv.node = np; funenv.nref = nref; - funenv.env = 0; + funenv.env = NULL; memcpy(&node,SH_VALNOD,sizeof(node)); - SH_VALNOD->nvfun = 0; - SH_VALNOD->nvenv = 0; + SH_VALNOD->nvfun = NULL; + SH_VALNOD->nvmeta = NULL; SH_VALNOD->nvflag = NV_LDOUBLE|NV_NOFREE; - SH_VALNOD->nvalue.ldp = 0; + SH_VALNOD->nvalue.ldp = NULL; for(i=0; i < nargs; i++) { *nr++ = mp = nv_namptr(sh.mathnodes,i); @@ -2931,14 +2931,14 @@ } *nr = 0; SH_VALNOD->nvalue.ldp = &d; - argv0 = np->nvname; - argv1 = 0; + argv0 = np->nvname; + argv1 = NULL; sh_funscope(1,argv,0,&funenv,0); while(mp= *nr++) - mp->nvalue.ldp = 0; + mp->nvalue.ldp = NULL; SH_VALNOD->nvfun = node.nvfun; SH_VALNOD->nvflag = node.nvflag; - SH_VALNOD->nvenv = node.nvenv; + SH_VALNOD->nvmeta = node.nvmeta; SH_VALNOD->nvalue.ldp = node.nvalue.ldp; return d; } @@ -2953,7 +2953,7 @@ char *trap; int nsig; struct dolnod *argsav=0,*saveargfor; - struct sh_scoped *savst = (struct sh_scoped*)stkalloc(sh.stk,sizeof(struct sh_scoped)); + struct sh_scoped *savst = stkalloc(sh.stk,sizeof(struct sh_scoped)); struct sh_scoped *prevscope = sh.st.self; struct argnod *envlist=0; int isig,jmpval; @@ -2962,7 +2962,7 @@ char save_invoc_local; char **savsig, *save_debugtrap = 0; struct funenv *fp = 0; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); Namval_t *nspace = sh.namespace; Dt_t *last_root = sh.last_root; Shopt_t options; @@ -2997,9 +2997,9 @@ sh.st.save_tree = sh.var_tree; if(!fun) { - if(sh_isoption(SH_FUNCTRACE) && is_option(&options,SH_XTRACE) || nv_isattr(fp->node,NV_TAGGED)) + if(nv_isattr(fp->node,NV_TAGGED)) sh_onoption(SH_XTRACE); - else + else if(!sh_isoption(SH_FUNCTRACE)) sh_offoption(SH_XTRACE); } sh.st.cmdname = argv0; @@ -3127,8 +3127,8 @@ static void sh_funct(Namval_t *np,int argn, char *argv,struct argnod *envlist,int execflg) { - struct funenv fun; - char *fname = nv_getval(SH_FUNNAMENOD); + struct funenv fun; + char *fname = nv_getval(SH_FUNNAMENOD); pid_t pipepid = sh.pipepid; #if !SHOPT_DEVFD Dt_t *save_fifo_tree = sh.fifo_tree; @@ -3217,7 +3217,7 @@ if(nq) mode = set_instance(nq,&node, &nr); jmpthresh = is_abuiltin(np) ? SH_JMPCMD : SH_JMPFUN; - checkpoint = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + checkpoint = stkalloc(sh.stk,sizeof(struct checkpt)); sh_pushcontext(checkpoint, jmpthresh); jmpval = sigsetjmp(checkpoint->buff,1); if(jmpval == 0) @@ -3314,7 +3314,7 @@ static pid_t sh_ntfork(const Shnode_t *t,char *argv,int *jobid,int topfd) { static pid_t spawnpid; - struct checkpt *buffp = (struct checkpt*)stkalloc(sh.stk,sizeof(struct checkpt)); + struct checkpt *buffp = stkalloc(sh.stk,sizeof(struct checkpt)); int jmpval,jobfork=0; volatile int scope=0, sigwasset=0; char **arge, *path;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/shell.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/shell.3
Changed
@@ -412,7 +412,7 @@ The \f3sh_iogetiop()\fP function returns a pointer to the Sfio stream corresponding to file descriptor number \fIfd\fP and the given mode \fImode\fP. The mode can be either -\f3SF_READ\fP or \f3SF_WRITE\fP. +\f3SFIO_READ\fP or \f3SFIO_WRITE\fP. The \fIfd\fP argument can the number of an open file descriptor or one of the following symbolic constants: .IP
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/_common -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/_common
Changed
@@ -2,8 +2,7 @@ # # # This file is part of the ksh 93u+m package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2021-2022 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -40,3 +39,15 @@ then print -r "$Command: \$tmp not set; run this from shtests. Aborting." >&2 exit 1 fi + +# Workaround for "System Integrity Protection" on macOS which filters +# out DYLD_* env vars whenever anything in /bin or /usr/bin is run, +# which kills env "$SHELL" for a preinstalled dynamically linked $SHELL +case $HOSTTYPE,${DYLD_LIBRARY_PATH+s} in +darwin.*,s) + function env + { + command -p env "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" "$@" + } + ;; +esac
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/alias.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/alias.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -305,4 +305,19 @@ fi # !SHOPT_SCRIPTONLY # ====== +# Feature request for 93u+m/1.1+: https://github.com/ksh93/ksh/issues/732 +got=$(hash -r _non_existent_nonsense_ ls 2>&1; echo status=$?; hash) ln=$LINENO +if ${.sh.version} == *93u+m/1.0.* || ${.sh.version} != *93u+m/* +then exp=$'status=0\nls='$(command -v ls) +else exp=$0$ln$': hash: _non_existent_nonsense_: not found\nstatus=1\nls='$(command -v ls) +fi + $got == "$exp" || err_exit "hash nonexistent command (expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# Bug fix: 'hash'/'alias -t' should not autoload functions +echo 'bad_func() { :; }' >bad_func +chmod +x bad_func # bug only triggered if file is executable +(FPATH=$PWD; alias -t bad_func 2>/dev/null; typeset -f bad_func >/dev/null) +(($? > 0)) || err_exit "'hash'/'alias -t' autoloads function" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/append.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/append.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -104,4 +104,18 @@ } 2> /dev/null $(typeset -p arr2) == "$exp" || err_exit 'append (b=c xxxxx) to indexed array not working' +# ====== +unset foo +exp='typeset -x foo=barbaz' +got=$(foo=bar; export foo+=baz 2>&1 && typeset -p foo) + e=$? -eq 0 && $got == "$exp" || err_exit 'declaration command does not support +=' \ + "(expected status 0, $(printf %q "$exp");" \ + "got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"), $(printf %q "$got"))" +exp='typeset -x -a foo=(23=barbaz)' +got=$(foo23=bar; export foo23+=baz 2>&1 && typeset -p foo) + e=$? -eq 0 && $got == "$exp" || err_exit 'declaration command does not support +=' \ + "(expected status 0, $(printf %q "$exp");" \ + "got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"), $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/arith.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/arith.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -21,8 +21,16 @@ . "${SHTESTS_COMMON:-${0%/*}/_common}" -integer hasposix=0 -(set -o posix) 2>/dev/null && ((hasposix++)) # not using -o ?posix as it's broken on 93v- +enum bool=(false true) + +bool HAVE_signbit=false +if typeset -f .sh.math.signbit >/dev/null && (( signbit(-NaN) )) +then HAVE_signbit=true +else warning "-lm does not support signbit(-NaN)" +fi + +bool HAVE_posix=false +(set -o posix) 2>/dev/null && HAVE_posix=true # not using -o ?posix as it's broken on 93v- trap '' FPE # NOTE: osf.alpha requires this (no ieee math) @@ -351,7 +359,7 @@ x=010 (( x == 10 )) || err_exit 'leading zeros in x treated as octal arithmetic with ((x))' (( $x == 10 )) || err_exit 'leading zeros in x treated as octal arithmetic with (($x))' -if ((hasposix)) +if ((HAVE_posix)) then set --posix ((x == 8)) || err_exit 'posix: leading zeros in x not treated as octal arithmetic with ((x))' (($x == 8)) || err_exit 'posix: leading zeros in x not treated as octal arithmetic with (($x))' @@ -454,8 +462,8 @@ Inf inf \ -Inf -inf \ Nan nan \ - -Nan -nan \ 1.0/0.0 inf + ((HAVE_signbit)) && set -- "$@" -Nan -nan while (( $# >= 2 )) do x=$(printf "%g\n" $(($1))) $x == $2 || err_exit "printf '%g\\n' \$(($1)) failed -- expected $2, got $x" @@ -746,7 +754,7 @@ ((x == -20)) || err_exit 'numbers with leading -0 treated as octal outside ((...))' print -- -8#20 | read x ((x == -16)) || err_exit 'numbers with leading -8# should be treated as octal' -if ((hasposix)) +if ((HAVE_posix)) then set --posix (($r == 16)) || err_exit 'posix: leading 0 not treated as octal inside ((...))' x=$(($r)) @@ -772,7 +780,7 @@ x010=99 ((x$x == 99 )) || err_exit 'arithmetic with x$x where x=010 should be $x010' (( 3+$x == 13 )) || err_exit '3+$x where x=010 should be 13 in ((...))' -if ((hasposix)) +if ((HAVE_posix)) then set --posix (( 3+$x == 11 )) || err_exit 'posix: 3+$x where x=010 should be 11 in ((...))' set --noposix @@ -904,7 +912,7 @@ # ====== # https://github.com/ksh93/ksh/issues/326 -((hasposix)) && for m in u d i o x X +((HAVE_posix)) && for m in u d i o x X do set --posix case $m in @@ -923,7 +931,7 @@ # BUG_ARITHNAN: In ksh <= 93u+m 2021-11-15 and zsh 5.6 - 5.8, the case-insensitive # floating point constants Inf and NaN are recognised in arithmetic evaluation, # overriding any variables with the names Inf, NaN, INF, nan, etc. -if ((hasposix)) +if ((HAVE_posix)) then set --posix Inf=42 NaN=13 inf=421 nan=137 @@ -992,8 +1000,62 @@ # ====== # https://github.com/ksh93/ksh/issues/623 function .sh.math.add x y { .sh.value=x+y; } -got=$(PATH=/dev/null; typeset -i z; redirect 2>&1; z='add(2 , 3)'; echo $z) +got=$(PATH=/dev/null; typeset -i z; set +x; redirect 2>&1; z='add(2 , 3)'; echo $z) e=$? -eq 0 && $got == '5' || err_exit ".sh.math.* function parsing: got status $e and $(printf %q "$got")" # ====== +# arithmetic assignments should not trigger getn disciplines, but the return +# value should still be cast to the type of the variable that is assigned to + +float x +x.getn() { .sh.value=987.65; } +let "got = x = 1234.56" + $got == 1234.56* || err_exit "arithmetic assignment triggers getn discipline (got $got)" + $x == 987.65* || err_exit "arithmetic comparison fails to trigger getn discipline (got $x)" +unset x +whence -q x.getn && err_exit "unset x fails to unset -f x.getn" + +( + ulimit -c 0 # fork + Errors=0 + for sz in '' s l + do typeset -${sz}i x=0 + if ! let "(got = x = 123.95) == 123" + then err_exit "arithmetic assignment does not return properly typecast value (-${sz}i, got $got)" + fi + typeset -${sz}F x=0 + let "got = x = 123.95" + if $got != 123.95* # ignore OS-dependent rounding error + then err_exit "arithmetic assignment does not return properly typecast value (-${sz}F, got $got)" + fi + done +) +if let "(e = $?) > 128" +then err_exit "typeset crashed the shell (got status $e/SIG$(kill -l "$e"))" +else let "Errors += e" +fi + +if ! let "(got = RANDOM = 123.95) == 123" +then err_exit "arithmetic assignment to RANDOM does not return typecast of assigned value (got $got)" +fi + +let "_ = 123.95, got = _" +if $got != '123.95' +then err_exit "arithmetic assignment to _ fails (got $got)" +fi + +got=$(let "LINENO = 123"; print $LINENO ) +if $got != '122' # TODO: should be 123 +then err_exit "arithmetic assignment to LINENO fails (got $got)" +fi + +# ====== +# non-base-10 numbers may be negative +# https://github.com/ksh93/ksh/issues/696 +exp=-20#j12 +integer 20 got=$exp + $got == "$exp" || err_exit "negative base-20 number (expected '$exp', got '$got')" +unset got + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/arrays.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/arrays.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -937,4 +937,10 @@ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" # ====== +got=$(typeset -A yarr; typeset -i yarrlorem=ipsum=456 yarrfoo=bar=123 2>&1; typeset -p yarr) +exp='typeset -A -i yarr=(foo=bar=123 lorem=ipsum=456)' + $got == "$exp" || err_exit "associative array index containing '=' misparsed in declaration command" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/attributes.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/attributes.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -846,4 +846,12 @@ done <<< 'twotowthreetfourro' # ====== +# control characters should not be counted for default justification` width +# https://github.com/ksh93/ksh/issues/189 +exp='typeset -L 5 s=$'\''1\n2\a3\t4\x0b5'\' +got=$(s=$'1\n2\a3\t4\v5'; typeset -L s; typeset -p s) + $got == "$exp" || err_exit "default terminal width for typeset -L incorrect" \ + "(expected $(printf %q "$exp"); got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/basic.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/basic.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -133,10 +133,10 @@ if $foo != 'foo bar' then err_exit 'eval foo=\$bar, with bar="foo\ bar" not working' fi -cd /tmp -cd ../../tmp || err_exit "cd ../../tmp failed" -if $PWD != /tmp -then err_exit 'cd ../../tmp is not /tmp' +cd /dev +cd ../../dev || err_exit "cd ../../dev failed" +if $PWD != /dev +then err_exit 'cd ../../dev is not /dev' fi ( sleep .2; cat <<! foobar @@ -980,6 +980,7 @@ || err_exit "last command in forked comsub exec-optimized in spite of $sig trap ($pid1 == $pid2)" cat >script <<-EOF + trap + $sig # unignore trap ":" $sig echo \$\$ sh -c 'echo \$\$' @@ -993,7 +994,6 @@ # ====== # Nested compound assignment misparsed in $(...) or ${ ...; } command substitution # https://github.com/ksh93/ksh/issues/269 -# TODO: one of the tests below crashes when actually executed; test lexing only by using noexec. for testcode in \ ': $( typeset -a arr=((a b c) 1) )' \ ': ${ typeset -a arr=((a b c) 1); }' \ @@ -1008,14 +1008,11 @@ 'typeset -Ca arr=((a=ah b=beh c=si))' \ ': $( typeset -Ca arr=((a=ah b=beh c=si)) )' \ 'r=${ typeset -Ca arr=((a=ah b=beh c=si)); }' \ - 'set --noexec; : $( typeset -a arr=((a $(( $( typeset -a barr=((a $(( 1 << 2 )) c) 1); echo 1 ) << $( typeset -a bazz=((a $(( 1 << 2 )) c) 1); echo 2 ) )) c) 1) )' \ + ': $( typeset -a arr=((a $(( $( typeset -a barr=((a $(( 1 << 2 )) c) 1); echo 1 ) << $( typeset -a bazz=((a $(( 1 << 2 )) c) 1); echo 2 ) )) c) 1) )' \ 'r=$(typeset -C arr=( (a=ah b=beh c=si) 1 (e f g)));' do - # fork comsub with 'ulimit' on old ksh to avoid a fixed lexer bug crashing the entire test script - got=$(let ".sh.version >= 20211209" || ulimit -c 0 - eval "set +x; $testcode" 2>&1) \ - || err_exit "comsub/arithexp lexing test $(printf %q "$testcode"):" \ - "got status $? and $(printf %q "$got")" + got=$(export testcode; "$SHELL" -c 'v=$(eval "$testcode" 2>&1); e=$?; print -r -- "$v"; exit $e' 2>&1) \ + || { e=$?; err_exit "comsub/arithexp lexing test $(printf %q "$testcode"): got status $e and $(printf %q "$got")"; } done unset testcode
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/builtins.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/builtins.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -384,7 +384,7 @@ (( $? == 1 )) || err_exit "wait not saving exit value" wait $pid2 (( $? == 127 )) || err_exit "subshell job known to parent" -env= +env='LD_LIBRARY_PATH=$LD_LIBRARY_PATH LIBPATH=$LIBPATH SHLIB_PATH=$SHLIB_PATH DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH' if builtin getconf 2> /dev/null; then v=$(getconf LIBPATH) for v in ${v//,/ } @@ -1206,6 +1206,8 @@ do case $bltin in fc | hist ) ((SHOPT_SCRIPTONLY)) && continue ;; + printf ) + ((SHOPT_PRINTF_LEGACY)) && continue ;; echo | test | true | false | \ | : | expr | */expr | getconf | */getconf | uname | */uname | catclose | catgets | catopen | Dt* | _Dt* | X* | login | newgrp ) continue ;; /*/*) expect="Usage: ${bltin##*/} " @@ -1288,10 +1290,10 @@ function fn { - typeset OLDPWD=/tmp + typeset OLDPWD=/dev cd - } -exp='/tmp' +exp='/dev' got=$(OLDPWD=/bin fn) $got == "$exp" || err_exit "cd - doesn't recognize overridden OLDPWD variable if it is overridden in function scope" \ @@ -1300,10 +1302,10 @@ function fn { typeset PWD=bug - cd /tmp + cd /dev echo "$PWD" } -exp='/tmp' +exp='/dev' got=$(fn) $got == "$exp" || err_exit "PWD isn't set after cd if already set in function scope" \ @@ -1312,7 +1314,7 @@ # $PWD should be set correctly after cd exp="$PWD $PWD" -got=$(echo $PWD; PWD=/tmp cd /dev; echo $PWD) +got=$(echo $PWD; PWD=/bin cd /dev; echo $PWD) $got == "$exp" || err_exit "PWD is incorrect after cd" \ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" @@ -1382,7 +1384,7 @@ got=$( readonly v=foo exec 2>/dev/null # All the "special builtins" below should fail, and not exit, so 'print end' is reached. - # Ref.: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html + # Ref.: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html # Left out are 'command exec /dev/null/nonexistent', where no shell follows the standard, # as well as 'command exit' and 'command return', because, well, obviously. command : </dev/null/no || print -n ok1 @@ -1586,7 +1588,13 @@ fc | hist ) ((SHOPT_SCRIPTONLY)) && continue ;; esac - got=$({ "$bltin" --version; } 2>&1) # the extra { } are needed for 'redirect' + got=$(set +x; { "$bltin" --\?-version; } 2>&1) # the extra { } are needed for 'redirect' + $got == " version "* || err_exit "$bltin does not support --\\?-version (got $(printf %q "$got"))" + case $bltin in + uname | */uname ) + continue ;; + esac + got=$(set +x; { "$bltin" --version; } 2>&1) # the extra { } are needed for 'redirect' $got == " version "* || err_exit "$bltin does not support --version (got $(printf %q "$got"))" done 3< <(builtin) @@ -1602,12 +1610,12 @@ function fn { - typeset HOME=/tmp + typeset HOME=/dev cd } fn unset -f fn - $PWD == /tmp || err_exit "'cd' does not chdir to \$HOME (local assignment)" + $PWD == /dev || err_exit "'cd' does not chdir to \$HOME (local assignment)" # ====== # Double evaluation of arithmetic expression passed to float conversion operators in printf @@ -1662,4 +1670,9 @@ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" # ====== +case $(PATH=/opt/ast/bin:$PATH; exec cat '--???SECTION' </dev/null 2>&1) in +1) err_exit "'exec' runs non-external command" ;; +esac + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/comvar.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/comvar.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -574,7 +574,7 @@ x=(typeset -C -a y;float z=2) got=$(print -C x) expected='(typeset -C -a y;typeset -l -E z=2)' - $expected == "$got" || err_exit "print -C x exects '$expected' got '$got'" + $expected == "$got" || err_exit "print -C x expects '$expected' got '$got'" unset vx vy compound vx=(
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/comvario.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/comvario.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -19,10 +19,11 @@ . "${SHTESTS_COMMON:-${0%/*}/_common}" -typeset -is HAVE_signbit=0 +enum bool=(false true) +bool HAVE_signbit=false if typeset -f .sh.math.signbit >/dev/null && (( signbit(-NaN) )) -then HAVE_signbit=1 +then HAVE_signbit=true else warning "-lm does not support signbit(-NaN)" fi @@ -646,11 +647,5 @@ test_read_C_into_array test_read_C_special_shell_keywords -unset bar -enum bool=(false true) -bool -a bar -bar3=true - $((5+bar3)) != 6 && err_exit '$((5+bar3)) should be 6' - # tests done exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/coprocess.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/coprocess.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -156,7 +156,7 @@ integer i for ((i = 1; i <= N; i++)) do print $i |& - sleep 0.001 + sleep 0.02 r=$r$($cat <&p) wait $! done @@ -166,7 +166,7 @@ ( $cat |& - sleep 0.001 + sleep 0.01 exec 6>&p print -u6 ok exec 6>&-
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/enum.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/enum.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -167,29 +167,34 @@ # ====== # Various tests backported from ksh93v- for enum type arrays. -enum bool=(false true) -bool -A a=( 2=true 4=false ) -exp=true +Bool_t -A a=( 2=true 4=false ) +exp=True got=${a2} $got == $exp || err_exit 'associative array assignment failure when using enums' \ "(expected $(printf %q "$exp"); got $(printf %q "$got"))" exp=2 got=${#a@} - $got == $exp || err_exit 'bool -A a should only have two elements' \ + $got == $exp || err_exit 'Bool_t -A a should only have two elements' \ "(expected $(printf %q "$exp"); got $(printf %q "$got"))" -bool -a bia +Bool_t -a bia (( bia4=false )) ${bia3} && err_exit 'empty index array element should not produce a value' (( bia3 == 0 )) || err_exit 'empty index array element should be numerically 0' -bool -A baa +Bool_t -A baa (( baa4=false )) ${baa3} && err_exit 'empty associative array element should not produce a value' (( baa3 == 0 )) || err_exit 'empty associative array element should be numerically 0' +unset bar +Bool_t -a bar +bar3=true + $((5+bar3)) != 6 && err_exit '$((5+bar3)) should be 6' + # ====== # https://github.com/ksh93/ksh/issues/638 enum colors=(red green blue) +unset bar typeset -a \colors bar barblue=test exp="typeset -a 'colors' bar=(blue=test)"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/exit.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/exit.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -42,9 +42,9 @@ eval \$$v && eval print -n \" \"\$v=\"\$$v\" done ) \ - exec -c -a -ksh ${ABSHELL} -c "exit 1" 1>/dev/null 2>&1 + LD_LIBRARY_PATH=\$LD_LIBRARY_PATH LIBPATH=\$LIBPATH SHLIB_PATH=\$SHLIB_PATH DYLD_LIBRARY_PATH=\$DYLD_LIBRARY_PATH exec -c -a -ksh ${ABSHELL} -c "exit 1" 1>/dev/null 2>&1 ! - status=$(echo $?) + status=$? if -o noprivileged && $status != 0 then err_exit 'exit in .profile is ignored' elif -o privileged && $status == 0
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/expand.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/expand.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -26,6 +26,7 @@ integer Line=$LINENO+1 set -- \ + 'a{0,1}z' 'a0z a1z' \ 'ff{c,b,a}' 'ffc ffb ffa' \ 'f{d,e,f}g' 'fdg feg ffg' \ '{l,n,m}xyz' 'lxyz nxyz mxyz' \ @@ -88,17 +89,15 @@ '{0..10%s}' '{0..10%s}' \ '{0..10%dl}' '{0..10%dl}' \ '{a,b}{0..3%02..2u}{y,z}' 'a00y a00z a01y a01z a10y a10z a11y a11z b00y b00z b01y b01z b10y b10z b11y b11z' \ + '{1696512000..1696512000..300}' '1696512000' \ while (($#>1)) do ((Line++)) - pattern=$1 - shift - expected=$1 - shift - got=$(eval print -r -- "$pattern") - $got == $expected || err_exit "'$pattern' failed -- expected '$expected' got '$got'" - #print -r -- " '$pattern' '$got' \\" + got=${ eval "print -r -- $1"; } + $got == "$2" || err_exit "$Line '$1': expected '$2', got '$got'" + shift 2 done +unset Line # ~(N) no expand glob pattern option set -- ~(N)/dev/null
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/functions.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/functions.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -1016,8 +1016,9 @@ { got=$( s=$(ulimit -s) -if $s == +(:digit:) && (( s < 16384 )) -then ulimit -s 16384 2>/dev/null +if $s == +(:digit:) && (( s < 32768 )) +then # stack size doubled from 16384 to make this test pass under AddressSanitizer + ulimit -s 32768 2>/dev/null fi $SHELL << \+++ f()
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/glob.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/glob.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -12,6 +12,7 @@ # # # David Korn <dgk@research.att.com> # # Martijn Dekker <martijn@inlv.org> # +# Johnothan King <johnothanking@protonmail.com> # # # ######################################################################## @@ -533,7 +534,7 @@ test_glob '<a\\b.txt>' $unquoted_patvar # ====== -# 93u+m/1.0.5 regression - glob expansion with brace expansion and parameter exapansion +# 93u+m/1.0.5 regression - glob expansion with brace expansion and parameter expansion v='./' mkdir -p bin/BAD sbin/WRONG ((SHOPT_BRACEPAT)) && test_glob '<./bin/*> <./sbin/*>' "./"{bin,sbin}"/*"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/io.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/io.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -18,6 +18,11 @@ . "${SHTESTS_COMMON:-${0%/*}/_common}" +# Some systems (at least Android) don't allow inheriting stdout in closed state. +# Disable the tests that rely on this on these systems. +sh -c 'exec 3>&1' 1>&- 2>/dev/null +typeset -si can_close_stdout=$? + unset HISTFILE function fun @@ -276,7 +281,9 @@ $SHELL -c "{ > $tmp/1 ; date;} >&- 2> /dev/null" > $tmp/2 -s $tmp/1 || -s $tmp/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' +if ((can_close_stdout)); then +$SHELL -c "$SHELL -c ': 3>&1' 1>&- 2>/dev/null" && err_exit 'closed standard output not passed to child shell' +fi # can_close_stdout $(cat <<- \EOF | $SHELL do_it_all() { @@ -818,7 +825,7 @@ err_exit "process substitutions loop or linger after parent shell finishes" fi (true <(true) >(true) <(true) >(true); wait) & -sleep .1 +sleep .2 if kill -0 $! 2> /dev/null; then kill -TERM $! err_exit "process substitutions linger when unused" @@ -906,6 +913,7 @@ # ====== # ksh misbehaved when stdout is closed # https://github.com/ksh93/ksh/issues/314 +if ((can_close_stdout)); then "$SHELL" -c 'pwd; echo "$?" >&2; echo test; echo "$?" > file' >&- 2>stderr exp='1' $(<file) == "$exp" || err_exit "ksh misbehaves when stdout is closed (1)" \ @@ -923,6 +931,7 @@ "$SHELL" -c "$cmd hi" >/dev/full && err_exit "'$cmd' does not detect disk full (inherited FD)" done fi +fi # can_close_stdout # ====== # Command substitution hangs, writing infinite zero bytes, when redirecting standard output on a built-in that forks
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/jobs.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/jobs.sh
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2021-2022 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -84,7 +83,16 @@ : ${ :; } ${ :; } j2=${ jobs; } kill %- %+ +wait 2>/dev/null $j2 == "$j1" || err_exit "jobs lost after shared-state command substitution ($(printf %q "$j2") != $(printf %q "$j1"))" # ====== +# Before 2024-01-05, ksh wrongly printed job numbers for background jobs invoked from subshells in profile scripts. +if((!SHOPT_SCRIPTONLY));then +print '(true &); :' >$tmp/profile +got=$(set +x; ENV=$tmp/profile "$SHELL" -i </dev/null 2>&1) + -n $got && err_exit "subshell bg job in profile script prints job number (got $(printf %q "$got"))" +fi # !SHOPT_SCRIPTONLY + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/leaks.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/leaks.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -395,12 +395,12 @@ # Test for a memory leak after 'cd' (in relation to $PWD and $OLDPWD) TEST title='PWD and/or OLDPWD changed by cd' DO - cd /tmp + cd /tmp 2>/dev/null || cd / cd - > /dev/null PWD=/foo OLDPWD=/bar cd /bin - cd /usr + cd /usr 2>/dev/null || cd / cd /dev cd /dev cd - > /dev/null
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/libcmd.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/libcmd.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 2019-2020 Contributors to ksh2020 # -# Copyright (c) 2022 Contributors to ksh 93u+m # +# Copyright (c) 2022-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -568,16 +568,16 @@ if $'\n'${ builtin; }$'\n' == *$'\n/opt/ast/bin/cat\n'* then exp=' version cat (*) ????-??-??' got=$(/opt/ast/bin/cat --version 2>&1) - $got == $exp || err_exit "path-bound builtin not executable by literal canonical path" \ + $got == $exp && $got != *$'\n'* || err_exit "path-bound builtin not executable by literal canonical path" \ "(expected match of $(printf %q "$exp"), got $(printf %q "$got"))" got=$(PATH=/opt/ast/bin:$PATH; "${ whence -p cat; }" --version 2>&1) - $got == $exp || err_exit "path-bound builtin not executable by canonical path resulting from expansion" \ + $got == $exp && $got != *$'\n'* || err_exit "path-bound builtin not executable by canonical path resulting from expansion" \ "(expected match of $(printf %q "$exp"), got $(printf %q "$got"))" got=$(PATH=/opt/ast/bin:$PATH; "$SHELL" -o restricted -c 'cat --version' 2>&1) - $got == $exp || err_exit "restricted shells do not recognize path-bound builtins" \ + $got == $exp && $got != *$'\n'* || err_exit "restricted shells do not recognize path-bound builtins" \ "(expected match of $(printf %q "$exp"), got $(printf %q "$got"))" - got=$(set +x; PATH=/opt/ast/bin cat --version 2>&1) - $got == $exp || err_exit "path-bound builtin not found on PATH in preceding assignment" \ + got=$(set +x; PATH=/dev/null; PATH=/opt/ast/bin cat --version 2>&1) + $got == $exp && $got != *$'\n'* || err_exit "path-bound builtin on PATH in preceding assignment" \ "(expected match of $(printf %q "$exp"), got $(printf %q "$got"))" else warning 'skipping path-bound builtin tests: builtin /opt/ast/bin/cat not found' fi
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/locale.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/locale.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -455,4 +455,18 @@ fi # ====== +# double-width characters should count for two for default justification width +# https://github.com/ksh93/ksh/issues/189 +if ((SHOPT_MULTIBYTE)) +then unset s "${!LC_@}" + LANG=C.UTF-8 + s='コーンシェル' + typeset -L s + got=$(typeset -p s; echo ${#s}) + exp=$'typeset -L 12 s=コーンシェル\n6' # each double-width character counts for two terminal positions + $got == "$exp" || err_exit "default terminal width for typeset -L incorrect" \ + "(expected $(printf %q "$exp"); got $(printf %q "$got"))" +fi + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/loop.sh
Added
@@ -0,0 +1,73 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 1982-2011 AT&T Intellectual Property # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # +# and is licensed under the # +# Eclipse Public License, Version 2.0 # +# # +# A copy of the License is available at # +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # +# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # +# # +# David Korn <dgk@research.att.com> # +# Martijn Dekker <martijn@inlv.org> # +# # +######################################################################## + +. "${SHTESTS_COMMON:-${0%/*}/_common}" + +PS3='ABC ' + +cat > $tmp/1 <<\! +1) foo +2) bar +3) bam +! + +select i in foo bar bam +do case $i in + foo) break;; + *) err_exit "select 1 not working" + break;; + esac +done 2> /dev/null <<! +1 +! + +unset i +select i in foo bar bam +do case $i in + foo) err_exit "select foo not working" 2>&3 + break;; + *) if $REPLY != foo + then err_exit "select REPLY not correct" 2>&3 + fi + ( set -u; : $i ) || err_exit "select: i not set to null" 2>&3 + break;; + esac +done 3>&2 2> $tmp/2 <<! +foo +! + +# ====== +# break, continue + +got=$(for i in a b c; do print -n $i; for j in 1 2 3; do print -n $j; break 2; done; done) +exp=a1 + $got == "$exp" || err_exit "'break 2' broken (expected '$exp', got '$got')" + +got=$(for i in a b c; do print -n $i; for j in 1 2 3; do print -n $j; continue 2; done; done) +exp=a1b1c1 + $got == "$exp" || err_exit "'continue 2' broken (expected '$exp', got '$got')" + +got=$(for i in a b c; do print -n $i; for j in 1 2 3; do print -n $j; for k in x y z; do print -n $k; break 3; done; done; done) +exp=a1x + $got == "$exp" || err_exit "'break 3' broken (expected '$exp', got '$got')" + +got=$(for i in a b c; do print -n $i; for j in 1 2 3; do print -n $j; for k in x y z; do print -n $k; continue 3; done; done; done) +exp=a1xb1xc1x + $got == "$exp" || err_exit "'continue 3' broken (expected '$exp', got '$got')" + +# ====== +exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/nameref.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/nameref.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -757,4 +757,18 @@ "got status $e$( ((e>128)) && print -n /SIG && kill -l "$e") and $(printf %q "$got"))" # ====== +# https://github.com/ksh93/ksh/issues/704 +# test backported from ksh 93v- 2013-02-14 +unset one bar baz arr val vv +one=1 bar=2 baz=3 +arr=(one bar baz) +nameref vv +val=$( + for vv in "${arr@}" + do print -n -- "$vv" + done +) + $val == 123 || err_exit 'optimization bug with for loops with references' + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/namespace.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/namespace.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -210,6 +210,18 @@ e=$? -eq 2 && $got =~ $exp || err_exit "'unset -f $b' fails in subshell (1b)" \ "(expected status 2 and ERE match of $(printf %q "$exp"), got status $e and $(printf %q "$got"))" + # bug introduced on 2023-06-02 + got=$( + eval "$b() { echo BAD; }" + namespace ns + { + (unset -f "$b"; PATH=/dev/null; "$b" --version 2>&1) + exit # avoid optimizing out the subshell + } + ) + e=$? -eq 2 && $got =~ $exp || err_exit "'unset -f $b' fails in subshell (1c)" \ + "(expected status 2 and ERE match of $(printf %q "$exp"), got status $e and $(printf %q "$got"))" + got=$( namespace ns { @@ -234,4 +246,25 @@ done # ====== +# https://github.com/ksh93/ksh/issues/727 +exp=foo +got=$(unset _AST_FEATURES; "$SHELL" -c 'namespace foo { echo foo; }' 2>&1) + $got == "$exp" || err_exit "'echo' botched in namespace" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" +case $'\n'${ builtin;}$'\n' in +*$'\n'/opt/ast/bin/getconf$'\n'*) + got=$(unset _AST_FEATURES; "$SHELL" -c 'namespace ucb { /opt/ast/bin/getconf UNIVERSE = ucb; echo foo; }' 2>&1) + $got == "$exp" || err_exit "'getconf' and/or 'echo' botched in namespace" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + ;; +esac + +# ====== +# https://github.com/ksh93/ksh/issues/728 +got=$(PATH=/opt/ast/bin; PATH=$(getconf PATH); "$SHELL" -c 'builtin basename; namespace ns { basename --version; }' 2>&1) +exp=' version basename (*) ????-??-??' + $got == $exp || err_exit "optional builtin not found when run from namespace" \ + "(expected match of $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/options.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/options.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -638,4 +638,12 @@ done # ====== +# showme only printed the first redirection in a list +# https://github.com/ksh93/ksh/issues/753 +got=$(set +x --showme; eval ';true >/dev/null 2>&1 3>&1 4>&3' 2>&1) +exp=$'+ true\n+ 1> /dev/null 2>& 1 3>& 1 4>& 3' + $got == "$exp" || err_exit "showme doesn't print redirects properly" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/path.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/path.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -265,8 +265,11 @@ command -p mkdir bin print 'print ok' > bin/tst command -p chmod +x bin/tst -if $(PATH=$PWD/bin tst 2>/dev/null) != ok -then err_exit '(PATH=$PWD/bin foo) does not find $PWD/bin/foo' +exp=ok +got=$(set +x; PATH=$PWD/bin tst 2>&1) +if $exp != "$got" +then err_exit '"PATH=$PWD/bin tst" does not run $PWD/bin/tst' \ + "(expected $exp, got $(printf %q "$got"))" fi cd / if whence ls > /dev/null @@ -315,6 +318,7 @@ fi PATH=$path +builtin -d /bin/getconf scr=$tmp/script exp=126 @@ -534,7 +538,8 @@ sleep 5 # if it's slow, display a counter for ((i=35; i>0; i--)) - do printf '\t%s%d: command -x: %2ds...\r' "$Command" LINENO i + do kill -s 0 "$$" 2>/dev/null || exit # parent shell exited + printf '\t%s%d: command -x: %2ds...\r' "$Command" LINENO i sleep 1 done # if this subshell is not killed yet, give up and kill the test by triggering the TERM trap in parent @@ -1004,7 +1009,7 @@ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" # https://github.com/ksh93/ksh/issues/609 exp=$(builtin -d cat; whence -p cat) - got=$(PATH=/opt/ast/bin:$PATH "$SHELL" -c 'command -vx cat; command -x cat /dev/null' 2>&1) + got=$(set +x; PATH=/opt/ast/bin:$PATH "$SHELL" -c 'command -vx cat; command -x cat /dev/null' 2>&1) e=$? -eq 0 && $got == "$exp" || err_exit "'command -vx' breakage" \ "(expected status 0, $(printf %q "$exp"); got status $e, $(printf %q "$got"))" fi @@ -1019,4 +1024,18 @@ $got == "$exp" || err_exit "incorrect 'type -t' output for undefined function (expected '$exp', got '$got')" # ====== +( + builtin getconf 2>/dev/null || exit 1 + p=$(getconf GETCONF) + $p == /*/getconf || exit 2 + builtin -d getconf + builtin "$p" + PATH=${p%/getconf} + getconf some_nonexistent_config_variable # be sure to trigger fallback to external command + exit 0 +) >/dev/null 2>&1 +(((e = $?) > 1)) && err_exit 'getconf builtin fails when on same path as external getconf' \ + "(got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/posix.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/posix.sh
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2022-2023 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2022-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -119,6 +118,7 @@ set --posix # disables the special handling of repeated isspace class characters in the IFS variable; +IFS.get() { :; } # tests if sh_invalidate_ifs() in init.c correctly gets IFS_disc IFS=$'x\t\ty' val=$'\tun\t\tduo\ttres\t' got=$(set $val; echo "$#") exp=3 @@ -132,6 +132,7 @@ $got == "$exp" || err_exit "repeated IFS whitespace char (default): incorrect number of fields" \ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" IFS=$' \t\n' # default +unset -f IFS.get # causes file descriptors > 2 to be left open when invoking another program; exp='ok'
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/printf.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/printf.sh
Changed
@@ -1,8 +1,7 @@ ######################################################################## # # # This file is part of the ksh 93u+m package # -# Copyright (c) 2022-2023 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2022-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -286,6 +285,24 @@ T '2020-2-3T12:34:56Z' '2020-02-03 12:34:56' T '2020-2-3 12:34:56Z' '2020-02-03 12:34:56' +C='Ordinal access' +format='%F' +T '1th tuesday in 2016-3' '2016-03-01' +T '2th tuesday in 2016-3' '2016-03-08' +T '3th tuesday in 2016-3' '2016-03-15' +T '4th tuesday in 2016-3' '2016-03-22' +T '5th tuesday in 2016-3' '2016-03-29' +T 'first tuesday in march 2016' '2016-03-01' +T 'second tuesday in march 2016' '2016-03-08' +T 'third tuesday in march 2016' '2016-03-15' +T 'fourth tuesday in march 2016' '2016-03-22' +T 'fifth tuesday in march 2016' '2016-03-29' +T '1st tuesday in march 2016' '2016-03-01' +T '2nd tuesday in march 2016' '2016-03-08' +T '3rd tuesday in march 2016' '2016-03-15' +T '4th tuesday in march 2016' '2016-03-22' +T '5th tuesday in march 2016' '2016-03-29' + # The following tests for times relative to the current time require GNU 'date' to compare our results to. if ! gd=$( set -o noglob IFS=: @@ -506,4 +523,32 @@ unset format gd # ====== +# negative non-base-10 numbers were mangled as they were incorrectly treated as unsigned +# https://github.com/ksh93/ksh/issues/696 +integer 20 n=20#j12 +printf -v got '%s %s %d %..20d %s' "$n" "$((n *= -1))" n n "$n" +exp='20#j12 -7622 -7622 -j12 -20#j12' + $got == "$exp" || err_exit "issue 696 reproducer (expected $(printf %q "$exp"), got $(printf %q "$got"))" +unset n + +# ====== +# '\0' in format string skips input +# https://github.com/ksh93/ksh/issues/725 +exp=1N2N3N4N5N6N7N +got=$(printf '%s\0' 1 2 3 4 5 6 7 | tr '\0' N) + $got == "$exp" || err_exit "'\0' in format string skips input (expected $(printf %q "$exp"), got $(printf %q "$got"))" +got=$(printf '%s%Z' 1 2 3 4 5 6 7 | tr '\0' N) + $got == "$exp" || err_exit "'%Z' in format string skips input (expected $(printf %q "$exp"), got $(printf %q "$got"))" + +exp=1NN2NN3NN4NN5NN6NN7NN +got=$(printf '%s\0\0' 1 2 3 4 5 6 7 | tr '\0' N) + $got == "$exp" || err_exit "'\0\0' in format string skips input (expected $(printf %q "$exp"), got $(printf %q "$got"))" +got=$(printf '%s%Z%Z' 1 2 3 4 5 6 7 | tr '\0' N) + $got == "$exp" || err_exit "'%Z%Z' in format string skips input (expected $(printf %q "$exp"), got $(printf %q "$got"))" + +exp=$'1N\n2N\n3N\n4N\nX' +got=$(printf '%s%c%c' 1 $'\0' $'\n' 2 $'\0' $'\n' 3 $'\0' $'\n' 4 $'\0' $'\n' | tr '\0' N; echo X) + $got == "$exp" || err_exit "regression involving %c as \$'\0' (expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/pty.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/pty.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -33,7 +33,7 @@ ((!SHOPT_SCRIPTONLY)) || { warning "interactive shell was compiled out -- tests skipped"; exit 0; } whence -q pty || { warning "pty command not found -- tests skipped"; exit 0; } -case $(uname -s) in +case $(uname -s; $HOSTTYPE == android.* && echo _no_) in Darwin | DragonFly | FreeBSD | Linux | MidnightBSD ) ;; * ) warning "pty not confirmed to work correctly on this system -- tests skipped" @@ -466,8 +466,8 @@ disabled # Test file name completion in vi mode -if((SHOPT_VSH)); then -mkdir "/tmp/fakehome_$$" && tst $LINENO <<! +if((SHOPT_VSH)) && mkdir "/tmp/fakehome_$$" 2>/dev/null; then +tst $LINENO <<! L vi mode file name completion # Completing a file name in vi mode that contains '~' and has a @@ -954,9 +954,14 @@ r : \.\./\r\n$ ! -tst $LINENO <<"!" +((SHOPT_VSH)) && tst $LINENO <<"!" L Ctrl+C with SIGINT ignored # https://github.com/ksh93/ksh/issues/343 +# Fix improved on 2024-02-12. +# Note: without emacs, the Ctrl+C should be echoed as ^C. +# +# TODO: a bug in the regex engine seems to make it impossible to match a +# literal '^' in any way, so we substitute a '.' metacharacter for now. d 40 @@ -966,20 +971,16 @@ p :child-1: w trap '' INT p :child-2: -c \\\cC -r :child-2: -w echo "OK $PS1" -u ^OK :child-!: \r\n$ +w : lorem\cCipsum +r ^:child-2: : lorem.Cipsum\r\n$ w exit # SIGINT ignored by parent p :test-2: w (trap '' INT; ENV=/./dev/null PS1=':child-!: ' "$SHELL") p :child-1: -c \\\cC -r :child-1: -w echo "OK $PS1" -u ^OK :child-!: \r\n$ +w : lorem\cCipsum +r ^:child-1: : lorem.Cipsum\r\n$ w exit # SIGINT ignored by parent, trapped in child @@ -988,10 +989,8 @@ p :child-1: w trap 'echo test' INT p :child-2: -c \\\cC -r :child-2: -w echo "OK $PS1" -u ^OK :child-!: \r\n$ +w : lorem\cCipsum +r ^:child-2: : lorem.Cipsum\r\n$ w exit ! @@ -1080,20 +1079,29 @@ ((SHOPT_VSH)) && tst $LINENO <<"!" L reverse search isn't canceled after an interrupt in vi mode +# note: must unignore SIGINT with undocumented 'trap + INT' d 15 p :test-1: -w echo WRONG +w trap + INT; echo WRONG +r echo WRONG +r WRONG p :test-2: w print CORREC +r print CORREC +r CORREC p :test-3: w echo foo +r echo foo +r foo p :test-4: w sleep 0 +r sleep 0 p :test-5: c e\EA\EA\cC\EA\EA\EA w $aT -u CORRECT +r :test-5: +r :test-5: print CORRECT ! ((SHOPT_ESH)) && VISUAL=emacs tst $LINENO <<"!" @@ -1255,5 +1263,79 @@ r :test-2: _ksh_93u_m_cmdcomplete_test_ \r\n$ ! +tst $LINENO <<"!" +L terminate interactive shell using the kill built-in + +d 40 +p :test-1: +w PS1=':child-!: ' "$SHELL" +p :child-1: +w kill -s HUP \$\$ +r ^:child-1: kill -s HUP \$\$\r\n$ +r ^Hangup\r\n$ +! + +((SHOPT_VSH)) && HISTFILE=$tmp/tmp_histfile tst $LINENO <<"!" +L 'read -s' reads from history file on first go + +d 40 +p :test-1: +w "$SHELL" -o vi -c 'read -s "foo?:prompt: "' +p :prompt: +c \Ek +r ^:prompt: "\$SHELL" -o vi -c 'read -s "foo\?:prompt: "'$ +! + +tst $LINENO <<"!" +L crash when attempting to cancel a heredoc in an interactive shell +# https://github.com/ksh93/ksh/pull/721 + +d 40 +p :test-1: +w "$SHELL" +p :test-2: +w cat << EOS +p :test-3: +w \cD +p :test-4: +w print Exit status $? +u ^Exit status 0\r\n$ +! + +tst $LINENO << "!" +L crash when discipline functions exit with an error +# https://github.com/ksh93/ksh/issues/346 + +d 40 +w "$SHELL" +w PS1.get() {; printf '$ '; trap --invalid-flag 2>/dev/null; } +w PS2.get() {; printf '> '; trap --invalid-flag 2>/dev/null; } +w .sh.tilde.set() { +w case ${.sh.value} in +w '~ret') .sh.value='Exit status is' ;; +w esac +w trap --invalid-flag 2>/dev/null +w } +w echo ~ +w echo ~ret +w echo ~ +w echo ~ret $? +u ^Exit status is 0\r\n$ +! + +((multiline && (SHOPT_VSH || SHOPT_ESH))) && TERM=vt100 tst $LINENO <<"!" +L crash when TERM is undefined +# https://github.com/ksh93/ksh/issues/722 + +d 40 +p :test-1: +w unset TERM +p :test-2: +w "$SHELL" +p :test-3: +w print Exit status $? +u ^Exit status 0\r\n$ +! + # ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/readonly.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/readonly.sh
Changed
@@ -2,8 +2,7 @@ # # # This file is part of the ksh 93u+m package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2021-2022 Contributors to ksh 93u+m # -# <https://github.com/ksh93/ksh> # +# Copyright (c) 2021-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # #
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/return.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/return.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -248,4 +248,36 @@ foo && err_exit "'exit' within subshell does not preserve exit status" # ====== +if let ".sh.version >= 20211208" && builtin getconf 2>/dev/null +then max=$(getconf INT_MAX) min=$(getconf INT_MIN) err=$tmp/stderr + exp=': out of range' + foo() { return $((max+1)); } + foo 2>$err + e=$? -eq 128 && $(<$err) == *"$exp" || err_exit 'return fails to warn for INT_MAX+1' \ + "(expected status 128 and *$(printf %q "$exp"), got status $e and $(printf %q "$(<$err)"))" + foo() { return $((min-1)); } + foo 2>$err + e=$? -eq 128 && $(<$err) == *"$exp" || err_exit 'return fails to warn for INT_MIN-1' \ + "(expected status 128 and *$(printf %q "$exp"), got status $e and $(printf %q "$(<$err)"))" + foo() { return $max; } + foo 2>$err + e=$? -eq max && -z $got || err_exit 'return fails for INT_MAX' \ + "(expected status 128 and '', got status $e and $(printf %q "$(<$err)"))" + foo() { return $min; } + foo 2>$err + e=$? -eq min && -z $got || err_exit 'return fails for INT_MIN' \ + "(expected status 128 and '', got status $e and $(printf %q "$(<$err)"))" +fi + +# ====== +# old AT&T bug reintroduced in v1.0.8 (commit aea99158) +f() { true; return; } +trap 'f; echo $? >out' USR1 +(exit 13) +kill -s USR1 ${.sh.pid} +trap - USR1 +unset -f f + $(<out) == 0 || err_exit "default return status in traps is broken (expected 0, got $(<out))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/sh_match.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/sh_match.sh
Changed
@@ -3,7 +3,7 @@ # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # # Copyright (c) 2012 Roland Mainz # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -78,7 +78,10 @@ $'\cg' =~ :cntrl: || err_exit 'pattern :cntrl: broken' \$ =~ :graph: || err_exit 'pattern :graph: broken' ' ' =~ :graph: && err_exit 'pattern :graph: broken' - \$ =~ :punct: || err_exit 'pattern :punct: broken' +for c in '!' '"' '#' '$' '%' '&' \' '(' ')' '*' '+' ',' '-' '.' '/' ':' ';' \ + '<' '=' '>' '?' '@' '' '\\' '' '^' '_' '`' '{' '|' '}' '~' +do $c =~ :punct: || err_exit "pattern :punct: broken for $c" +done / =~ :punct: || err_exit 'pattern :punct: broken' ' ' =~ :punct: && err_exit 'pattern :punct: broken' x =~ :punct: && err_exit 'pattern :punct: broken' @@ -1072,5 +1075,13 @@ "a b c d" =~ ^\^+\ ${.sh.match} == 'a' || err_exit 'pattern ^\^+ broken' +# Avoid printing excessive elements for .sh.match +# https://github.com/ksh93/ksh/issues/308#issuecomment-1033259414 +# https://github.com/ksh93/ksh/pull/709 +exp='.sh.match .sh.match1 .sh.match2' +got=${ $SHELL -c 'print ${!.sh.match} ${!.sh.match1} ${!.sh.match2}' } + $exp == "$got" || err_exit "'print \${!.sh.match}' should not print excessive elements" \ + "(expected ${ printf %q "$exp" }, got ${ printf %q "$got" })" + # ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/shtests -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/shtests
Changed
@@ -8,7 +8,7 @@ USAGE=$' -s8? -@(#)$Id: shtests (ksh 93u+m) 2023-05-18 $ +@(#)$Id: shtests (ksh 93u+m) 2024-06-28 $ -author?David Korn <dgk@research.att.com> -author?Glenn Fowler <gsf@research.att.com> @@ -274,10 +274,13 @@ then PATH=$PATH:/usr/ucb fi PATH=$PATH:$d -if $INSTALLROOT && -r $INSTALLROOT/bin/.paths -then PATH=$INSTALLROOT/bin:$PATH +if ! -v INSTALLROOT || $INSTALLROOT != /* +then echo "$0: cannot continue: INSTALLROOT must be set" >&2 + echo "$0: invoke me after 'bin/package use', or via 'bin/shtests' or 'bin/package test'" >&2 + exit 1 fi -if ${SHELL%/*} != $INSTALLROOT/bin +PATH=$INSTALLROOT/bin:$PATH +if ${SHELL%/*} != $INSTALLROOT/bin && ${SHELL%/*} != $INSTALLROOT/dyn/bin then PATH=${SHELL%/*}:$PATH fi if ! $SHCOMP @@ -291,6 +294,11 @@ fi fi +# when testing a shell outside of INSTALLROOT, make sure libraries in INSTALLROOT are not loaded +if ! ${SHELL%/*} -ef $INSTALLROOT/bin || ${SHELL%/*} -ef $INSTALLROOT/dyn/bin +then unset -v LD_LIBRARY_PATH LIBPATH SHLIB_PATH DYLD_LIBRARY_PATH _RLD_ROOT +fi + tmp=$( d=${TMPDIR:-/tmp}/ksh93.shtests.$$.${RANDOM:-0} mkdir -m700 -- "$d" && CDPATH= cd -P -- "$d" && pwd @@ -308,13 +316,28 @@ export HOME=$tmp # make the SHOPT_* macros available to the tests as environment variables +command unset "${!SHOPT_@}" 2>/dev/null SHOPT() { $1 == *=* && eval "export SHOPT_${ printf %q "${1%%=*}"; }=${ printf %q "${1#*=}"; }" } . "${SHOPTFILE:-../SHOPT.sh}" unset -f SHOPT - -n $SHOPT_MULTIBYTE || SHOPT_MULTIBYTE=$( LC_ALL=C.UTF-8; x=$'\xc3\xa9'; print $(( ${#x}==1 )) ) +# override with probed values from shopt.h: +# change '#define SHOPT_foo = bar' to 'export SHOPT_foo=bar' and evaluate +if -f $INSTALLROOT/src/cmd/ksh93/shopt.h && + i=$(sed -n $'/^# \t*define \t \t*SHOPT_/ { + s/.*define \t \t*// + s/ \t \t*/=/ + s/^/export / + p + }' "$INSTALLROOT"/src/cmd/ksh93/shopt.h) +then eval "$i" || exit +else echo "$0: cannot grep shopt.h" >&2 + exit 1 +fi + +SHOPT_MULTIBYTE=$( LC_ALL=C.UTF-8; x=$'\xc3\xa9'; print $(( ${#x}==1 )) ) if (( !SHOPT_MULTIBYTE && utf8 && !posix && !compile )) then echo "-u/--utf8 is unavailable because multibyte support was not compiled in." >&2 exit 1 @@ -348,7 +371,7 @@ t=$( case $i in glob.sh) grep -c '^:blank:*test_a-z\{3,\}' $i ;; leaks.sh) grep -c ^TEST $i ;; - printf.sh) grep -c '^:blank:*T ' $i ;; + printf.sh) grep -c -E '(:blank:err_exit|^:blank:*T):blank:' $i ;; pty.sh) grep -c 'tst ' $i ;; *) grep -c err_exit $i ;; esac )
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/signal.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/signal.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -371,9 +371,15 @@ $x == done || err_exit "output failed -- expected 'done', got '$x'" (( SECONDS > .35 )) && err_exit "took $SECONDS seconds, expected around .2" -trap '' SIGBUS - $($SHELL -c 'trap date SIGBUS; trap -p SIGBUS') && err_exit 'SIGBUS should not have a trap' -trap -- - SIGBUS +# The test for SIGBUS trap handling below is incompatible with ASan because ASan +# implements its own SIGBUS handler independently of ksh. +if ! -v ASAN_OPTIONS || -v TSAN_OPTIONS || -v MSAN_OPTIONS || -v LSAN_OPTIONS ; then + trap '' SIGBUS + got=$("$SHELL" -c 'trap date SIGBUS; trap -p SIGBUS') + "$got" && err_exit 'SIGBUS should not have a trap' \ + "(got $(printf %q "$got"))" + trap -- - SIGBUS +fi { x=$( @@ -589,4 +595,16 @@ (( (SECONDS-s) < 1.8)) && err_exit "'trap - INT' causing trap to not be ignored" # ====== +# Ancient SIGCONT nonsense present as early as ksh88: +# the 'kill' built-in sent SIGCONT along with every non-SIGCONT signal issued! +for sig in TERM HUP INT USR1 +do for cmd in kill $(whence -p kill) + do got=$("$SHELL" -c "trap 'echo \"SIGCONT (!!)\"' CONT; trap 'echo SIG$sig' $sig; $cmd -s $sig \$\$") + e=$? -eq 0 && $got == "SIG$sig" || err_exit "CONT+$sig trap, SIG$sig issued using '$cmd':" \ + "expected status 0, SIG$sig;" \ + "got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"), $(printf %q "$got"))" + done +done + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/subshell.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/subshell.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -624,7 +624,7 @@ dot=$(cat <<-EOF $(ls -d .) EOF -) ) & "$binsleep" .1 +) ) & sleep .1 if kill -0 $! 2> /dev/null then err_exit 'command substitution containing here-doc with command substitution fails' fi @@ -860,7 +860,7 @@ EOF "$SHELL" -i "$tmp/backtick_crash.ksh" 2>/dev/null & # run test as bg job test_pid=$! -(sleep 20; kill -s KILL "$test_pid" 2>/dev/null) & # another bg job to kill frozen test job +(sleep 40; kill -s KILL "$test_pid" 2>/dev/null) & # another bg job to kill frozen test job sleep_pid=$! { wait "$test_pid"; } 2>/dev/null # get job's exit status, suppressing signal messages ((!(e = $?))) || err_exit "backtick comsub crash/freeze (got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"))" @@ -1196,4 +1196,16 @@ kill "$sleep_pid" 2>/dev/null # ====== +unset x +exp=$'1\nx= 2' +got=$( + ((.sh.version <= 20210430)) && ulimit -c 0 # fork to stop 'exec' from ending whole script (see commit 88a1f3d6) + echo 1 + ( x=${ sh() { echo BADFUN; }; foo=BADOUTPUT exec sh -c 'echo $foo'; echo BADEXEC; } ) + echo x=$x 2 +) + $got == "$exp" || err_exit "incorrect result from 'exec' in subshare in subshell" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/tilde.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/tilde.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2022 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -117,8 +117,6 @@ ((.sh.version >= 20210316)) && for disc in get set do ( - ulimit -t unlimited 2>/dev/null # fork subshell to cope with a possible crash - eval ".sh.tilde.$disc() { case \${.sh.${ $disc == get && print tilde || print value; }} in @@ -183,4 +181,17 @@ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" # ====== + +.sh.tilde.set() { print -n BAD; } +.sh.tilde.get() { .sh.value=' & WRONG'; } +echo 'echo ~okay' >test.sh +chmod +x test.sh +./test.sh >test.out +got=$(<test.out) +unset .sh.tilde # removes discipline functions +exp=~okay + $got == "$exp" || err_exit "child script inherits .sh.tilde discipline" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/types.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/types.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -673,7 +673,7 @@ # ====== # Bugs involving scripts without a #! path -# Hashbangless scripts are executed in a reinitialised fork of ksh, which is very bug-prone. +# Hashbangless scripts are executed in a reinitialised fork of ksh. # https://github.com/ksh93/ksh/issues/350 # Some of these fixed bugs don't involve types at all, but the tests need to go somewhere. # Plus, invoking these from an environment with a bunch of types defined is an additional test. @@ -796,4 +796,54 @@ "(got status $e$( ((e>128)) && print -n /SIG && kill -l "$e"), $(printf %q "$got"))" # ====== +# loop invariants optimizer bug +# reproducer by Daniel Douglas +# https://github.com/ksh93/ksh/issues/704 +typeset -T Thing=( + integer x + typeset y +) +function f +{ + Thing -a t=( + 0=(x=1; y=hi) + 1=(x=2; y=yo) + 2=(x=3; y=moo) + 5=(x=6; y=boo) + 9=(x=10; y=boom) + ) + typeset -p t + g t +} +function g +{ + typeset -n ref=$1 d e + set -- "${!ref@}" + set -- "${@/*/ref\0}" + for e do + for d in e.x e.y + do printf '%s %s %-14s %s\n' "${@e}" "${!d}" "${@d}" "${d}" + done + done + echo +} +exp='Thing -a t=(0=(typeset -l -i x=1;y=hi) 1=(typeset -l -i x=2;y=yo) 2=(typeset -l -i x=3;y=moo) 5=(typeset -l -i x=6;y=boo) 9=(typeset -l -i x=10;y=boom)) +Thing t0.x typeset -l -i 1 +Thing t0.y hi +Thing t1.x typeset -l -i 2 +Thing t1.y yo +Thing t2.x typeset -l -i 3 +Thing t2.y moo +Thing t5.x typeset -l -i 6 +Thing t5.y boo +Thing t9.x typeset -l -i 10 +Thing t9.y boom' +got=$(f 2>&1) + $got == "$exp" || +{ + err_exit "issue 704: expected '-' lines, got '+' lines:" + diff -U1 <(print "$exp") <(print "$got") | sed $'1,3 d; s,^,\t,' >&2 +} + +# ====== exit $((Errors<125?Errors:125))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/cmd/ksh93/tests/variables.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/cmd/ksh93/tests/variables.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1982-2012 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -125,6 +125,12 @@ $got == "$exp" || err_exit "Background job influences reproducible $RANDOM sequence" \ "(expected $(printf %q "$exp"), got $(printf %q "$got"))" +# Seeding with an arithmetic expression should be identical to seeding using a shell assignment +RANDOM=12345; exp="$RANDOM $RANDOM $RANDOM $RANDOM" +let "RANDOM = 12345"; got="$RANDOM $RANDOM $RANDOM $RANDOM" + $got == "$exp" || err_exit "Seeding RANDOM using arithmetic expression fails" \ + "(expected $(printf %q "$exp"), got $(printf %q "$got"))" + # SECONDS float secElapsed=0.0 secSleep=0.001 let SECONDS=$secElapsed @@ -308,7 +314,7 @@ kill -s 0 $! || err_exit '$! does not point to latest asynchronous process' kill $! unset x -cd /tmp || exit +cd /dev || exit CDPATH=/ x=$(cd ${tmp#/}) if $x != $tmp @@ -899,6 +905,10 @@ SHLVL=1 level=$($SHELL -c $'$SHELL -c \'print -r "$SHLVL"\'') $level == 3 || err_exit "SHLVL should be 3 not $level" +echo 'print -r "$SHLVL"' >script +chmod +x script +level=$($SHELL -c '$SHELL ./script') + $level == 3 || err_exit "SHLVL should be 3 not $level" $($SHELL -c '{ x=1; : ${x.};print ok;}' 2> /dev/null) == ok || err_exit '${x.} where x is a simple variable causes shell to abort'
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/Mamfile
Changed
@@ -1,15 +1,14 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -make test - make install - make all + +setv MAMAKE_STRICT 3 + +make test virtual + make install virtual + make all virtual exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual -done test virtual + done + done +done
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/Mamfile
Changed
@@ -1,5355 +1,5033 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} setv CC cc -setv mam_cc_FLAGS ${mam_cc_DLL} -D_BLD_ast -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} -D_BLD_ast ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCFLAGS setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -setv COTEMP $$ setv IFFEFLAGS setv LDFLAGS -make install - make ast - make libast.a archive - make ast.req - make _always_generate_releaseflags.h - exec - git_commit=$(git rev-parse --short=8 HEAD 2>/dev/null) - exec - case $?,$git_commit in - exec - 0,0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z) - exec - echo "/* generated by libast/Mamfile using $(git --version) */" - exec - git update-index --really-refresh >/dev/null - exec - git diff-index --quiet HEAD - exec - wd_clean=$((! $?)) # working directory clean? - exec - case $(git branch) in - exec - '' | *\*\ 0-9*.0-9*) - exec - # If we're not on a branch that starts with a number - exec - # (release branch), then compile as a release version - exec - case $wd_clean in - exec - 1) echo "#ifndef _AST_release" - exec - echo "# define _AST_release 1" - exec - echo "#endif" - exec - ;; - exec - 0) echo "/*" - exec - echo " * on a git release branch, but changes were made;" - exec - echo " * _AST_release not defined by default" - exec - echo " */" - exec - ;; - exec - esac - exec - ;; - exec - *) - exec - echo "/* not on a git release branch; _AST_release not defined by default */" - exec - ;; - exec - esac - exec - case $wd_clean in - exec - 1) echo "#define _AST_git_commit \"$git_commit\"" ;; - exec - 0) echo "#define _AST_git_commit \"$git_commit/MOD\"" ;; - exec - esac - exec - ;; - exec - *) - exec - echo "/* generated by libast/Mamfile (we're not in a git repo) */" - exec - echo "#ifndef _AST_release" - exec - echo "# define _AST_release 1" - exec - echo "#endif" - exec - echo "#undef _AST_git_commit" - exec - ;; - exec - esac > releaseflags.h.new - exec - if ${STDCMP} -s releaseflags.h.new releaseflags.h - exec - then ${STDRM} releaseflags.h.new - exec - else ${STDMV} -f releaseflags.h.new releaseflags.h - exec - fi - done _always_generate_releaseflags.h virtual - make ast_standards.h implicit - make FEATURE/standards - prev features/standards - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/standards - done FEATURE/standards generated - exec - ${STDCMP} -s FEATURE/standards ast_standards.h || { ${STDRM} -f ast_standards.h; ${STDCP} FEATURE/standards ast_standards.h; } - done ast_standards.h generated - make FEATURE/lib - prev features/lib - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/lib - done FEATURE/lib generated - make FEATURE/common - prev features/common - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/common - done FEATURE/common generated - make FEATURE/param - prev features/param.sh - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/param.sh - make std/endian.h implicit - make std/bytesex.h implicit - make ast_common.h implicit - prev FEATURE/common - exec - sed '/define _def_map_ast/d' < FEATURE/common > 1.${COTEMP}.x - exec - if ${STDCMP} -s ast_common.h 1.${COTEMP}.x - exec - then ${STDRM} -f 1.${COTEMP}.x - exec - else ${STDMV} 1.${COTEMP}.x ast_common.h - exec - fi - make ast_map.h implicit - make FEATURE/map - make features/map.c - make FEATURE/api implicit - prev features/api - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/api - done FEATURE/api generated - make FEATURE/eaccess implicit - prev features/eaccess - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/eaccess - done FEATURE/eaccess generated - make FEATURE/vmalloc implicit - prev features/vmalloc - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/vmalloc - make FEATURE/mmap implicit - prev features/mmap - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/mmap - done FEATURE/mmap generated - done FEATURE/vmalloc generated - make FEATURE/options implicit - prev features/options - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/options - done FEATURE/options generated - prev FEATURE/mmap - prev FEATURE/lib - done features/map.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. ${LDFLAGS}" run features/map.c - done FEATURE/map generated - exec - ${STDCMP} -s FEATURE/map ast_map.h || { ${STDRM} -f ast_map.h; ${STDCP} FEATURE/map ast_map.h; } - done ast_map.h dontcare generated - done ast_common.h dontcare generated - done std/bytesex.h dontcare - done std/endian.h dontcare - done FEATURE/param generated - make FEATURE/aso - prev features/aso - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/aso - done FEATURE/aso generated - prev ast_map.h - make ast_limits.h - make FEATURE/limits - make features/limits.c - make conflim.h implicit - make conf - prev comp/conf.sh - exec - case static,port:$OPTIND:$RANDOM in - exec - ?*:*:*|*::*|*:*:$RANDOM) - exec - ;; - exec - *) if ENV= LC_ALL=C x= $SHELL -nc ' a || b && : ${listlevel} !(pattern)' 2>/dev/null - exec - then if grep '### .*archaic.* ###' >/dev/null - exec - then : conf contains archaic constructs : - exec - else ENV= LC_ALL=C $SHELL -n comp/conf.sh - exec - fi - exec - fi - exec - ;; - exec - esac - exec - case '${mam_cc_SHELLMAGIC}' in - exec - "") case 29 in - exec - 0) ${STDCP} comp/conf.sh conf - exec - ;; - exec - *) { - exec - i=`(read x; echo $x) < comp/conf.sh` - exec - case $i in - exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; - exec - esac - exec - ${STDCAT} - comp/conf.sh <<'!' - exec - HOSTTYPE="${mam_cc_HOSTTYPE}" - exec - ! - exec - } > conf - exec - ;; - exec - esac - exec - ;; - exec - *) ${STDCAT} - comp/conf.sh > conf <<'!' - exec - ${mam_cc_SHELLMAGIC} - exec - HOSTTYPE="${mam_cc_HOSTTYPE}" - exec - ! - exec - ;; - exec - esac - exec - test -w conf -a -x conf || ${STDCHMOD} u+w,+x conf - done conf generated - prev comp/conf.tab - exec - ${INSTALLROOT}/src/lib/libast/conf -v comp/conf.tab ${CC} ${mam_cc_FLAGS} ${CCFLAGS} - done conflim.h generated - make joint.conflim.h - prev conflim.h - make conftab.c - prev conftab.h generated - prev FEATURE/param - prev FEATURE/common - prev FEATURE/standards - done conftab.c generated - done joint.conflim.h generated virtual - prev FEATURE/param - make comp/getopt.h implicit - prev include/ast_getopt.h implicit - done comp/getopt.h dontcare - prev FEATURE/common - prev FEATURE/lib - prev FEATURE/standards - done features/limits.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd ${LDFLAGS}" run features/limits.c - done FEATURE/limits generated - exec - ${STDCMP} -s FEATURE/limits ast_limits.h || { ${STDRM} -f ast_limits.h; ${STDCP} FEATURE/limits ast_limits.h; } - done ast_limits.h generated - make ast_stdio.h - make FEATURE/stdio - prev features/stdio - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/stdio - prev include/sfio_s.h implicit - make include/ast_std.h implicit - make include/regex.h implicit - make ast_api.h implicit - prev FEATURE/api - exec - ${STDCMP} -s FEATURE/api ast_api.h || { ${STDRM} -f ast_api.h; ${STDCP} FEATURE/api ast_api.h; } - done ast_api.h dontcare generated - make ast_wchar.h implicit - make FEATURE/wchar - make features/wchar - prev ast_common.h - done features/wchar - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/wchar - make std/wctype.h implicit - make ast_wctype.h implicit - make FEATURE/wctype - prev features/wctype - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/wctype - prev std/endian.h - make std/wchar.h implicit - prev ast_wchar.h - done std/wchar.h dontcare - done FEATURE/wctype generated - exec - ${STDCMP} -s FEATURE/wctype ast_wctype.h || { ${STDRM} -f ast_wctype.h; ${STDCP} FEATURE/wctype ast_wctype.h; } - done ast_wctype.h dontcare generated - done std/wctype.h dontcare - make std/stdio.h implicit - prev ast_stdio.h - done std/stdio.h dontcare - prev ast_common.h - done FEATURE/wchar generated - exec - ${STDCMP} -s FEATURE/wchar ast_wchar.h || { ${STDRM} -f ast_wchar.h; ${STDCP} FEATURE/wchar ast_wchar.h; } - prev std/stdio.h - prev ast_common.h - done ast_wchar.h dontcare generated - prev ast_common.h - done include/regex.h - prev comp/getopt.h - prev ast_map.h - make ast_botch.h implicit - make FEATURE/botch - make features/botch.c - make FEATURE/sys implicit - prev features/sys - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/sys - prev std/endian.h - prev std/endian.h - done FEATURE/sys generated - prev FEATURE/lib - done features/botch.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd ${LDFLAGS}" run features/botch.c - done FEATURE/botch generated - exec - ${STDCMP} -s FEATURE/botch ast_botch.h || { ${STDRM} -f ast_botch.h; ${STDCP} FEATURE/botch ast_botch.h; } - done ast_botch.h dontcare generated - prev ast_limits.h - make ast_fcntl.h implicit - make FEATURE/fcntl - make features/fcntl.c - make FEATURE/tty implicit - prev features/tty - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/tty - done FEATURE/tty generated - make FEATURE/fs implicit - prev features/fs - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/fs - done FEATURE/fs generated - prev FEATURE/lib - prev FEATURE/standards - done features/fcntl.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd ${LDFLAGS}" run features/fcntl.c - make ast_fs.h implicit - prev FEATURE/fs - exec - ${STDCMP} -s FEATURE/fs ast_fs.h || { ${STDRM} -f ast_fs.h; ${STDCP} FEATURE/fs ast_fs.h; } - done ast_fs.h dontcare generated - done FEATURE/fcntl generated - exec - ${STDCMP} -s FEATURE/fcntl ast_fcntl.h || { ${STDRM} -f ast_fcntl.h; ${STDCP} FEATURE/fcntl ast_fcntl.h; } - prev ast_fs.h - done ast_fcntl.h dontcare generated - prev include/ast_getopt.h - make ast_sys.h implicit - prev FEATURE/sys - exec - ${STDCMP} -s FEATURE/sys ast_sys.h || { ${STDRM} -f ast_sys.h; ${STDCP} FEATURE/sys ast_sys.h; } - done ast_sys.h dontcare generated - make ast_lib.h implicit - prev FEATURE/lib - exec - ${STDCMP} -s FEATURE/lib ast_lib.h || { ${STDRM} -f ast_lib.h; ${STDCP} FEATURE/lib ast_lib.h; } - done ast_lib.h dontcare generated - prev ast_common.h - prev ast_standards.h - done include/ast_std.h - done FEATURE/stdio generated - exec - ${STDCMP} -s FEATURE/stdio ast_stdio.h || { ${STDRM} -f ast_stdio.h; ${STDCP} FEATURE/stdio ast_stdio.h; } - prev include/sfio_s.h - prev include/ast_std.h - done ast_stdio.h dontcare generated - make ast_nl_types.h - make FEATURE/nl_types - prev features/nl_types - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/nl_types - done FEATURE/nl_types generated - exec - ${STDCMP} -s FEATURE/nl_types ast_nl_types.h || { ${STDRM} -f ast_nl_types.h; ${STDCP} FEATURE/nl_types ast_nl_types.h; } - done ast_nl_types.h generated +setv DYLIB_VERSION 6.0 + +note * +note * iffe and cc invocations are mostly the same but some add custom flags; +note * set shim functions for brevity and "single source of truth" while allowing for variety in invocations +note * + +shim - invoke_iffe() +shim - { +shim - s=$1 +shim - shift +shim - set -- ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS} "$@" +shim - iffe ${IFFEFLAGS} -v -X ast -X std -c "$*" run "$s" +shim - } +shim - +shim - compile() +shim - { +shim - s=$1 +shim - shift +shim - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} -I. -Icomp "$@" -Iinclude -Istd -c "$s" +shim - } + +make install virtual + note * + note * Generate release information + note * + note * (The target is 'virtual' as it needs to be run at + note * every build, so we can catch changes of git commit) + note * + make releaseflags.h notrace virtual + exec - git_commit=$(git rev-parse --short=8 HEAD 2>/dev/null) + exec - case $?,$git_commit in + exec - 0,0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z0-9a-z) + exec - echo "/* generated by libast/Mamfile using $(git --version) */" + exec - git update-index --really-refresh >/dev/null + exec - git diff-index --quiet HEAD + exec - wd_clean=$((! $?)) # working directory clean? + exec - case $(git branch) in + exec - *\*\ 0-9*.0-9*) + exec - # If we're not on a branch that starts with a number + exec - # (release branch), then compile as a release version + exec - case $wd_clean in + exec - 1) echo "#ifndef _AST_release" + exec - echo "# define _AST_release 1" + exec - echo "#endif" + exec - ;; + exec - 0) echo "/*" + exec - echo " * on a git release branch, but changes were made;" + exec - echo " * _AST_release not defined by default" + exec - echo " */" + exec - ;; + exec - esac + exec - ;; + exec - *) + exec - echo "/* not on a git release branch; _AST_release not defined by default */" + exec - ;; + exec - esac + exec - test "$wd_clean" -eq 0 && git_commit=$git_commit/MOD + exec - echo "#define _AST_git_commit \"$git_commit\"" + exec - echo "# current git commit: $git_commit" >&2 # for the log + exec - ;; + exec - *) + exec - echo "/* generated by libast/Mamfile (we're not in a git repo) */" + exec - echo "#ifndef _AST_release" + exec - echo "# define _AST_release 1" + exec - echo "#endif" + exec - echo "#undef _AST_git_commit" + exec - ;; + exec - esac > releaseflags.h.new + exec - if cmp -s releaseflags.h.new releaseflags.h + exec - then rm -f releaseflags.h.new + exec - else mv -f releaseflags.h.new releaseflags.h + exec - fi + done + + note * + note * Generate some fundamental headers from iffe feature tests + note * + + note * The standards test influences all subsequent iffe feature tests, so must be made first + make ast_standards.h implicit + make FEATURE/standards implicit + prev features/standards + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + note * AST API versioning voodoo + make ast_api.h implicit + make FEATURE/api implicit + prev features/api + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + note * Compiler features, basic system headers, backward compat, etc. -- included by just about everything + make ast_common.h implicit + make FEATURE/common implicit + prev features/common + exec - invoke_iffe ${<} + done + note * include <ast_map.h> from ast_common.h but not from FEATURE/common + exec - sed '/define _def_map_ast/d' < ${<} > ${@} + done ast_common.h + + note * Main feature test for system libraries + make ast_lib.h implicit + make FEATURE/lib implicit + prev features/lib + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + note * AST replacement for <signal.h> + make sig.h implicit + make FEATURE/sig implicit + prev features/sig.sh + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make FEATURE/eaccess implicit + prev features/eaccess + exec - invoke_iffe ${<} + done + + make ast_mmap.h implicit + make FEATURE/mmap implicit + prev features/mmap + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make FEATURE/vmalloc implicit + prev FEATURE/mmap + prev features/vmalloc + exec - invoke_iffe ${<} + done + + make FEATURE/options implicit + prev features/options + exec - invoke_iffe ${<} + done + + make ast_map.h implicit + make FEATURE/map implicit + make features/map.c + prev sig.h + prev FEATURE/api + prev FEATURE/eaccess + prev FEATURE/vmalloc + prev FEATURE/options + prev FEATURE/mmap + prev FEATURE/lib + done + exec - invoke_iffe ${<} -I. + done + exec - cp -f ${<} ${@} + done ast_map.h + + make std/endian.h implicit + make std/bytesex.h implicit + prev ast_common.h + prev ast_map.h + done std/bytesex.h + done std/endian.h + + + note * Checks for system headers, data types, and C library functions. Emits prorotypes if needed. + make ast_sys.h implicit + make FEATURE/sys implicit + prev features/sys + exec - invoke_iffe ${<} + prev std/endian.h + done + exec - cp -f ${<} ${@} + done + + note * Feature test for atomic integer operations + make FEATURE/aso + prev FEATURE/common + prev features/aso + exec - invoke_iffe ${<} + done + + make ast_wait.h implicit + make FEATURE/wait + prev features/wait + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_param.h implicit + make FEATURE/param + prev std/endian.h + prev features/param.sh + exec - invoke_iffe ${<} + done FEATURE/param + exec - cp -f ${<} ${@} + done + + make ast_fs.h implicit + make FEATURE/fs implicit + prev features/fs + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_tty.h implicit + make FEATURE/tty implicit + prev ast_lib.h + prev features/tty + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_fcntl.h implicit + prev ast_fs.h + make FEATURE/fcntl + prev ast_fs.h + make features/fcntl.c + prev FEATURE/tty + prev FEATURE/fs + prev FEATURE/lib + prev FEATURE/standards + done + exec - invoke_iffe ${<} -I. -Icomp -Iinclude -Istd + done + exec - cp -f ${<} ${@} + done + + make ast_botch.h implicit + make FEATURE/botch + make features/botch.c + prev FEATURE/sys + prev FEATURE/lib + done + exec - invoke_iffe ${<} -I. -Icomp -Iinclude -Istd + done + exec - cp -f ${<} ${@} + done + + make ast_wchar.h implicit + make FEATURE/wchar + prev std/wctype.h implicit + prev std/stdio.h implicit + prev ast_common.h + make features/wchar + prev ast_common.h + done + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + prev std/stdio.h + prev ast_common.h + done + + note * + note * Generate system library dependency information + note * + + make ast.req + note * + note * generate initial ast.req + note * + prev ${INSTALLROOT}/bin/mkreq + exec - set -o errexit + exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} : ${LDFLAGS} : ast iconv w + note * + note * some systems move -lc routines to -lm; see astmath.c for details + note * + make astmath.out + make port/astmath.c + prev std/endian.h + done + setv _math_test ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS} -DN=$N -DIS -o astmath.exe ${<} + exec - X=1 + exec - for N in 1 2 3 4 5 6 7 8 + exec - do if ${_math_test} 2>/dev/null + exec - then : implicit math function N=$N : + exec - elif ${_math_test} -lm + exec - then : math function N=$N requires -lm : + exec - X=0 + exec - break + exec - else : ERROR: ${<} fails to compile or link, even with -lm : + exec - exit 1 + exec - fi + exec - done + exec - (set +f; exec rm -rf astmath.exe*) + exec - echo $X > astmath.out + done + note * + note * add library dependencies resulting from the aso feature test + note * + prev FEATURE/aso + exec - sed -e '/^#define _REQ_/!d' -e 's/#define _REQ_\(a-z0-9_*\).*/ -l\1/' ${<} >> ${@} + note * + note * add -lm if the astmath.c probe found it necessary + note * + exec - read no_libm_needed <astmath.out + exec - case $no_libm_needed in + exec - 0) echo ' -lm' >> ${@} ;; + exec - *) touch ${@} ;; + exec - esac + done ast.req + + note * + note * Probe all manner of configuration values from conf.tab + note * These are used for astconf(3) and the getconf(1) built-in + note * + + make ast_limits.h + make FEATURE/limits + make features/limits.c + prev FEATURE/param + prev FEATURE/common + prev FEATURE/lib + prev FEATURE/standards + make comp/getopt.h implicit + prev include/ast_getopt.h implicit + done + make conflim.h implicit + prev FEATURE/standards + prev FEATURE/common + prev FEATURE/param + prev FEATURE/wait + make conf + prev comp/conf.sh + exec - cat - comp/conf.sh <<'EOF' >conf && chmod u+w,+x conf + exec - HOSTTYPE='${mam_cc_HOSTTYPE}' + exec - EOF + done + prev comp/conf.tab + exec - conf -v ${<} ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} + done + done features/limits.c + exec - invoke_iffe ${<} -I. -Icomp -Iinclude -Istd + done FEATURE/limits + exec - cp -f ${<} ${@} + done ast_limits.h + + + note * + note * Declare implicit header dependencies + note * + + make include/ast.h implicit + prev ast_api.h + make include/ast_std.h + make include/regex.h implicit + prev ast_api.h prev ast_wchar.h - prev ast_wctype.h - note * clean up obsolete headers - exec - ${STDRM} -rf dirent.h iconv.h nl_types.h stdio.h wchar.h wctype.h ast_hdr.h ast_types.h ast_unistd.h iffeio.h \ - exec - ${INSTALLROOT}/include/ast/limits.h ${INSTALLROOT}/include/ast/unistd.h \ - exec - ${PACKAGEROOT}/src/lib/libast/std/limits.h - note * generate initial ast.req - prev ${INSTALLROOT}/bin/mkreq - exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} : ${LDFLAGS} : ast iconv w - make astmath.exe - make port/astmath.c - prev std/endian.h - prev std/endian.h - done port/astmath.c - exec - X=1 - exec - for N in 1 2 3 4 5 6 8 - exec - do if ${CC} ${CCLDFLAGS} -DN=$N -DIS ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd ${LDFLAGS} -o astmath.exe port/astmath.c 2>/dev/null - exec - then : implicit math function N=$N : - exec - elif ${CC} ${CCLDFLAGS} -DN=$N -DIS ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd ${LDFLAGS} -o astmath.exe port/astmath.c -lm 2>/dev/null - exec - then : math function N=$N requires -lm : - exec - X=0 - exec - break - exec - fi - exec - done - exec - case $X in - exec - 0) ${STDRM} -f astmath.exe ;; - exec - *) touch astmath.exe ;; - exec - esac - done astmath.exe dontcare generated - prev FEATURE/aso - exec - sed -e '/^#define _REQ_/!d' -e 's/#define _REQ_\(a-z0-9_*\).*/ -l\1/' FEATURE/aso >> ast.req - exec - if test -f astmath.exe - exec - then touch ast.req - exec - else echo ' -lm' >> ast.req - exec - fi - done ast.req generated - make state.o - make misc/state.c - make include/ast.h implicit - prev ast_api.h - make include/vmalloc.h implicit - prev ast_common.h - prev include/ast_std.h - done include/vmalloc.h - make include/sfio.h implicit - prev include/sfio_s.h - prev ast_common.h - prev include/ast_std.h - done include/sfio.h + prev ast_common.h + done + prev comp/getopt.h + prev ast_map.h + prev ast_botch.h + prev ast_limits.h + prev ast_fcntl.h + prev include/ast_getopt.h + prev ast_sys.h + prev ast_lib.h + prev ast_common.h + prev ast_standards.h + done include/ast_std.h + make include/sfio.h implicit + prev include/sfio_s.h implicit + prev ast_common.h + prev include/ast_std.h + done + make include/vmalloc.h implicit + prev ast_common.h + prev include/ast_std.h + done + done + + prev dir/dirstd.h implicit + + note * + note * Generate more header files based on iffe feature tests + note * + + make ast_dirent.h implicit + prev include/ast_std.h + make FEATURE/dirent + prev include/ast_std.h + prev features/dirent + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_wctype.h implicit + make FEATURE/wctype + prev features/wctype + exec - invoke_iffe ${<} + prev std/endian.h + make std/wchar.h implicit + prev ast_wchar.h + done + done + exec - cp -f ${<} ${@} + done + + make ast_stdio.h implicit + prev include/sfio_s.h + prev include/ast_std.h + make FEATURE/stdio + prev include/sfio_s.h + prev include/ast_std.h + prev features/stdio + exec - invoke_iffe ${<} + done FEATURE/stdio + exec - cp -f ${<} ${@} + done ast_stdio.h + + make ast_nl_types.h + make FEATURE/nl_types + prev features/nl_types + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_mode.h implicit + make FEATURE/mode + make features/mode.c + prev include/modecanon.h implicit + prev FEATURE/param + done + exec - invoke_iffe ${<} -I. -Iinclude -Istd + done + exec - cp -f ${<} ${@} + done + + make FEATURE/syscall implicit + prev features/syscall + exec - invoke_iffe ${<} + done + + make FEATURE/hack implicit + make features/hack + prev FEATURE/common + done + exec - invoke_iffe ${<} + done + + make ast_ccode.h implicit + make FEATURE/ccode + prev features/ccode + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_time.h implicit + make FEATURE/time + prev features/time + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make tv.h implicit + prev include/ast.h + make FEATURE/tv + prev include/ast.h + prev features/tv + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_float.h implicit + make FEATURE/float implicit + prev ast_common.h + prev features/float + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make lc.h implicit + prev include/ast.h + prev port/lc.tab + make lctab.c + make port/lclang.h implicit + prev include/ast_windows.h implicit + done + make lcgen + make port/lcgen.c + prev std/stdio.h + done + exec - ${CC} ${CCLDFLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS} -o lcgen port/lcgen.c + done + exec - lcgen lc.h lctab.c < port/lc.tab + done + done + note * The following block was moved out of lc.h to resolve a circular dependency on lc.h. + note * We have to break the dependency loop somewhere: lctab.c depends on lclib.h but we cannot declare that here. + make port/lclib.h implicit + prev lc.h + make include/error.h implicit + make include/option.h implicit + prev include/ast.h + done + prev include/ast.h + done + prev include/ast.h + done + + make ast_ndbm.h implicit + make FEATURE/ndbm implicit + prev std/stdio.h + prev features/ndbm + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make ast_sizeof.h implicit + make FEATURE/sizeof implicit + prev features/sizeof + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + done + + make align.h implicit + make FEATURE/align + make features/align.c + prev FEATURE/common + done + exec - invoke_iffe ${<} -I. + done + exec - cp -f ${<} ${@} + done + + note * + note * Build the library + note * + + make libast.a + + make state.o + make misc/state.c + prev include/ast.h + done + exec - compile ${<} + done + + make opendir.o + make dir/opendir.c + make dir/dirlib.h implicit + prev dir/dirstd.h + prev ast_param.h + make std/dirent.h implicit + prev ast_dirent.h + done + prev std/dirent.h + make include/ls.h implicit + prev ast_mode.h + prev ast_fs.h prev include/ast_std.h - done include/ast.h - done misc/state.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/state.c - done state.o generated - make opendir.o - make dir/opendir.c - make dir/dirlib.h implicit - prev dir/dirstd.h implicit dontcare - prev direntry.h implicit dontcare virtual - make ast_param.h implicit - prev FEATURE/param - exec - ${STDCMP} -s FEATURE/param ast_param.h || { ${STDRM} -f ast_param.h; ${STDCP} FEATURE/param ast_param.h; } - done ast_param.h dontcare generated - make std/dirent.h implicit - make ast_dirent.h implicit - make FEATURE/dirent - prev features/dirent - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/dirent - prev include/ast_std.h - done FEATURE/dirent generated - exec - ${STDCMP} -s FEATURE/dirent ast_dirent.h || { ${STDRM} -f ast_dirent.h; ${STDCP} FEATURE/dirent ast_dirent.h; } - prev include/ast_std.h - done ast_dirent.h dontcare generated - done std/dirent.h dontcare - prev ndir.h implicit dontcare virtual - prev std/dirent.h - make include/ls.h implicit - make ast_mode.h implicit - make FEATURE/mode - make features/mode.c - prev include/modecanon.h implicit - prev FEATURE/param - done features/mode.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -Istd ${LDFLAGS}" run features/mode.c - done FEATURE/mode generated - exec - ${STDCMP} -s FEATURE/mode ast_mode.h || { ${STDRM} -f ast_mode.h; ${STDCP} FEATURE/mode ast_mode.h; } - done ast_mode.h dontcare generated - prev ast_fs.h - prev include/ast_std.h - done include/ls.h - prev include/ast.h - done dir/dirlib.h - done dir/opendir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/opendir.c - done opendir.o generated - make readdir.o - make dir/readdir.c - prev dir/dirlib.h - done dir/readdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/readdir.c - done readdir.o generated - make rewinddir.o - make dir/rewinddir.c - prev dir/dirlib.h - done dir/rewinddir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/rewinddir.c - done rewinddir.o generated - make seekdir.o - make dir/seekdir.c - prev dir/dirlib.h - done dir/seekdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/seekdir.c - done seekdir.o generated - make telldir.o - make dir/telldir.c - prev dir/dirlib.h - done dir/telldir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/telldir.c - done telldir.o generated - make getcwd.o - make misc/getcwd.c - make include/ast_dir.h implicit - prev std/dirent.h - prev dir/dirlib.h - prev ast_lib.h - done include/ast_dir.h - make include/error.h implicit - make include/option.h implicit - prev include/ast.h - done include/option.h - prev include/ast.h - done include/error.h - make FEATURE/syscall implicit - prev features/syscall - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/syscall - done FEATURE/syscall generated + done prev include/ast.h - done misc/getcwd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c misc/getcwd.c - done getcwd.o generated - make fastfind.o - make misc/fastfind.c - make misc/findlib.h implicit - prev include/find.h implicit - prev include/vmalloc.h - prev include/regex.h - prev include/ls.h - prev include/error.h - prev std/endian.h - make include/cdt.h implicit - prev ast_common.h - prev include/ast_std.h - done include/cdt.h - prev include/ast.h - done misc/findlib.h - done misc/fastfind.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Icomp -Imisc -Iinclude -Istd -c misc/fastfind.c - done fastfind.o generated - make hashalloc.o - make hash/hashalloc.c - make FEATURE/hack implicit - make features/hack - prev FEATURE/common - done features/hack - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/hack - done FEATURE/hack generated - make hash/hashlib.h implicit - make include/hash.h implicit - prev include/hashpart.h implicit - done include/hash.h - prev include/ast.h - done hash/hashlib.h - done hash/hashalloc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashalloc.c - done hashalloc.o generated - make hashdump.o - make hash/hashdump.c - prev hash/hashlib.h - done hash/hashdump.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashdump.c - done hashdump.o generated - make hashfree.o - make hash/hashfree.c - prev hash/hashlib.h - done hash/hashfree.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashfree.c - done hashfree.o generated - make hashlast.o - make hash/hashlast.c - prev hash/hashlib.h - done hash/hashlast.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashlast.c - done hashlast.o generated - make hashlook.o - make hash/hashlook.c - prev hash/hashlib.h - done hash/hashlook.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashlook.c - done hashlook.o generated - make hashscan.o - make hash/hashscan.c - prev hash/hashlib.h - done hash/hashscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashscan.c - done hashscan.o generated - make hashsize.o - make hash/hashsize.c - prev hash/hashlib.h - done hash/hashsize.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashsize.c - done hashsize.o generated - make hashview.o - make hash/hashview.c - prev hash/hashlib.h - done hash/hashview.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashview.c - done hashview.o generated - make hashwalk.o - make hash/hashwalk.c - prev hash/hashlib.h - done hash/hashwalk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/hashwalk.c - done hashwalk.o generated - make memhash.o - make hash/memhash.c - prev hash/hashlib.h - done hash/memhash.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/memhash.c - done memhash.o generated - make memsum.o - make hash/memsum.c - prev hash/hashlib.h - done hash/memsum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/memsum.c - done memsum.o generated - make strhash.o - make hash/strhash.c - prev hash/hashlib.h - done hash/strhash.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/strhash.c - done strhash.o generated - make strkey.o - make hash/strkey.c - prev include/hashkey.h implicit - prev include/ast.h - done hash/strkey.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c hash/strkey.c - done strkey.o generated - make strsum.o - make hash/strsum.c - prev hash/hashlib.h - done hash/strsum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ihash -Iinclude -Istd -c hash/strsum.c - done strsum.o generated - make stracmp.o - make string/stracmp.c - make include/ccode.h implicit - make ast_ccode.h implicit - make FEATURE/ccode - prev features/ccode - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/ccode - done FEATURE/ccode generated - exec - ${STDCMP} -s FEATURE/ccode ast_ccode.h || { ${STDRM} -f ast_ccode.h; ${STDCP} FEATURE/ccode ast_ccode.h; } - done ast_ccode.h dontcare generated - prev ast_common.h - done include/ccode.h - prev include/ast.h - done string/stracmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/stracmp.c - done stracmp.o generated - make strnacmp.o - make string/strnacmp.c - prev include/ccode.h - prev include/ast.h - done string/strnacmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strnacmp.c - done strnacmp.o generated - make ccmap.o - make string/ccmap.c - prev include/ccode.h - prev include/ast.h - done string/ccmap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/ccmap.c - done ccmap.o generated - make ccmapid.o - make string/ccmapid.c - prev include/ccode.h - prev include/ast.h - done string/ccmapid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/ccmapid.c - done ccmapid.o generated - make ccnative.o - make string/ccnative.c - prev include/ccode.h - prev include/ast.h - done string/ccnative.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/ccnative.c - done ccnative.o generated - make chresc.o - make string/chresc.c - prev include/regex.h - prev include/ccode.h - prev include/ast.h - done string/chresc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/chresc.c - done chresc.o generated - make chrtoi.o - make string/chrtoi.c - prev include/ast.h - done string/chrtoi.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/chrtoi.c - done chrtoi.o generated - make streval.o - make string/streval.c - prev include/ast.h - done string/streval.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/streval.c - done streval.o generated - make strexpr.o - make string/strexpr.c - prev include/ast.h - done string/strexpr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strexpr.c - done strexpr.o generated - make strmatch.o - make string/strmatch.c + done + done + exec - compile ${<} -Idir + done + + make readdir.o + make dir/readdir.c + prev dir/dirlib.h + done + exec - compile ${<} -Idir + done + + make rewinddir.o + make dir/rewinddir.c + prev dir/dirlib.h + done + exec - compile ${<} -Idir + done + + make seekdir.o + make dir/seekdir.c + prev dir/dirlib.h + done + exec - compile ${<} -Idir + done + + make telldir.o + make dir/telldir.c + prev dir/dirlib.h + done + exec - compile ${<} -Idir + done + + make getcwd.o + make misc/getcwd.c + make include/ast_dir.h implicit + prev std/dirent.h + prev dir/dirlib.h + prev ast_lib.h + done + prev include/error.h + prev FEATURE/syscall + prev include/ast.h + done + exec - compile ${<} -Idir + done + + make fastfind.o + make misc/fastfind.c + make misc/findlib.h implicit + prev include/find.h implicit + prev include/vmalloc.h prev include/regex.h - prev include/ast.h - done string/strmatch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strmatch.c - done strmatch.o generated - make strcopy.o - make string/strcopy.c - prev include/ast.h - done string/strcopy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strcopy.c - done strcopy.o generated - make modei.o - make string/modei.c - make string/modelib.h implicit - make include/modex.h implicit - prev include/modecanon.h - prev ast_fs.h - done include/modex.h - prev include/ls.h - prev include/ast.h - done string/modelib.h - done string/modei.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Istring -Iinclude -Istd -c string/modei.c - done modei.o generated - make modex.o - make string/modex.c - prev string/modelib.h - done string/modex.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Istring -Iinclude -Istd -c string/modex.c - done modex.o generated - make strmode.o - make string/strmode.c - prev string/modelib.h - done string/strmode.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Istring -Iinclude -Istd -c string/strmode.c - done strmode.o generated - make strlcat.o - make string/strlcat.c - prev ast_map.h - prev include/ast.h - done string/strlcat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strlcat.c - done strlcat.o generated - make strlcpy.o - make string/strlcpy.c - prev ast_map.h - prev include/ast.h - done string/strlcpy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strlcpy.c - done strlcpy.o generated - make strlook.o - make string/strlook.c - prev include/ast.h - done string/strlook.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strlook.c - done strlook.o generated - make strncopy.o - make string/strncopy.c - prev include/ast.h - done string/strncopy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strncopy.c - done strncopy.o generated - make strsearch.o - make string/strsearch.c - prev include/ast.h - done string/strsearch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strsearch.c - done strsearch.o generated - make strpsearch.o - make string/strpsearch.c - prev include/ccode.h - prev include/ast.h - done string/strpsearch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strpsearch.c - done strpsearch.o generated - make stresc.o - make string/stresc.c - prev include/ast.h - done string/stresc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/stresc.c - done stresc.o generated - make stropt.o - make string/stropt.c - prev include/ast.h - done string/stropt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/stropt.c - done stropt.o generated - make strtape.o - make string/strtape.c - prev include/ast.h - done string/strtape.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strtape.c - done strtape.o generated - make strpcmp.o - make string/strpcmp.c - prev include/ast.h - done string/strpcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strpcmp.c - done strpcmp.o generated - make strnpcmp.o - make string/strnpcmp.c - prev include/ast.h - done string/strnpcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strnpcmp.c - done strnpcmp.o generated - make strvcmp.o - make string/strvcmp.c - prev include/ast.h - done string/strvcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strvcmp.c - done strvcmp.o generated - make strnvcmp.o - make string/strnvcmp.c - prev include/ast.h - done string/strnvcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strnvcmp.c - done strnvcmp.o generated - make tok.o - make string/tok.c - make include/tok.h implicit - prev include/ast.h - done include/tok.h - prev include/ast.h - done string/tok.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/tok.c - done tok.o generated - make tokline.o - make string/tokline.c - prev include/tok.h - prev include/error.h - prev include/ast.h - done string/tokline.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/tokline.c - done tokline.o generated - make tokscan.o - make string/tokscan.c - prev FEATURE/hack - prev include/tok.h - prev include/ast.h - done string/tokscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/tokscan.c - done tokscan.o generated - make pathaccess.o - make path/pathaccess.c - prev ast_api.h - prev include/ast.h - done path/pathaccess.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathaccess.c - done pathaccess.o generated - make pathcat.o - make path/pathcat.c - prev ast_api.h - prev include/ast.h - done path/pathcat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathcat.c - done pathcat.o generated - make pathcanon.o - make path/pathcanon.c - prev ast_api.h - prev include/error.h prev include/ls.h - prev include/ast.h - done path/pathcanon.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathcanon.c - done pathcanon.o generated - make pathcheck.o - make path/pathcheck.c - make include/times.h implicit - make ast_time.h implicit - make FEATURE/time - prev features/time - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/time - done FEATURE/time generated - exec - ${STDCMP} -s FEATURE/time ast_time.h || { ${STDRM} -f ast_time.h; ${STDCP} FEATURE/time ast_time.h; } - done ast_time.h dontcare generated - prev include/ast.h - done include/times.h prev include/error.h - prev include/ls.h - prev include/ast.h - done path/pathcheck.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathcheck.c - done pathcheck.o generated - make pathpath.o - make path/pathpath.c - prev ast_api.h - prev include/ast.h - done path/pathpath.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathpath.c - done pathpath.o generated - make pathexists.o - make path/pathexists.c - prev include/error.h - prev include/ls.h - make port/lclib.h implicit - make lc.h implicit - make lcgen - make port/lcgen.c - prev std/stdio.h - done port/lcgen.c - exec - ${CC} ${CCLDFLAGS} ${CCFLAGS} ${LDFLAGS} -o lcgen port/lcgen.c - done lcgen generated - prev port/lc.tab - exec - ./lcgen ${COTEMP}.1 ${COTEMP}.2 < port/lc.tab - exec - if ${STDCMP} -s ${COTEMP}.1 lc.h - exec - then ${STDRM} ${COTEMP}.1 - exec - else ${STDMV} ${COTEMP}.1 lc.h - exec - fi - exec - if ${STDCMP} -s ${COTEMP}.2 lctab.c - exec - then ${STDRM} ${COTEMP}.2 - exec - else ${STDMV} ${COTEMP}.2 lctab.c - exec - fi - prev include/ast.h - done lc.h generated - prev include/error.h - prev include/ast.h - done port/lclib.h - make joint.lc.h - prev lc.h - make lctab.c - make port/lclang.h implicit - make include/ast_windows.h implicit - prev windows.h implicit dontcare virtual - done include/ast_windows.h - done port/lclang.h - prev port/lclib.h - done lctab.c - done joint.lc.h generated virtual - done path/pathexists.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c path/pathexists.c - done pathexists.o generated - make pathfind.o - make path/pathfind.c - prev include/ls.h - prev include/error.h - prev include/ast.h - done path/pathfind.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathfind.c - done pathfind.o generated - make pathicase.o - make path/pathicase.c - prev include/error.h - prev include/ast.h - done path/pathicase.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathicase.c - done pathicase.o generated - make pathkey.o - make path/pathkey.c - prev ast_api.h - prev include/ls.h + prev std/endian.h + make include/cdt.h implicit + prev ast_common.h + prev include/ast_std.h + done prev include/ast.h - done path/pathkey.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathkey.c - done pathkey.o generated - make pathprobe.o - make path/pathprobe.c - prev ast_api.h - make include/proc.h implicit - prev include/ast.h - done include/proc.h + done + done + exec - compile ${<} -Imisc + done + + make hashalloc.o + make hash/hashalloc.c + prev FEATURE/hack + make hash/hashlib.h implicit + make include/hash.h implicit + prev include/hashpart.h implicit + done + prev include/ast.h + done + done + exec - compile ${<} -Ihash + done + + make hashdump.o + make hash/hashdump.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashfree.o + make hash/hashfree.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashlast.o + make hash/hashlast.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashlook.o + make hash/hashlook.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashscan.o + make hash/hashscan.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashsize.o + make hash/hashsize.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashview.o + make hash/hashview.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make hashwalk.o + make hash/hashwalk.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make memhash.o + make hash/memhash.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make memsum.o + make hash/memsum.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make strhash.o + make hash/strhash.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make strkey.o + make hash/strkey.c + prev include/hashkey.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make strsum.o + make hash/strsum.c + prev hash/hashlib.h + done + exec - compile ${<} -Ihash + done + + make stracmp.o + make string/stracmp.c + make include/ccode.h implicit + prev ast_ccode.h + prev ast_common.h + done + prev include/ast.h + done + exec - compile ${<} + done + + make strnacmp.o + make string/strnacmp.c + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make ccmap.o + make string/ccmap.c + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make ccmapid.o + make string/ccmapid.c + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make ccnative.o + make string/ccnative.c + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make chresc.o + make string/chresc.c + prev include/regex.h + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make chrtoi.o + make string/chrtoi.c + prev include/ast.h + done + exec - compile ${<} + done + + make streval.o + make string/streval.c + prev include/ast.h + done + exec - compile ${<} + done + + make strexpr.o + make string/strexpr.c + prev include/ast.h + done + exec - compile ${<} + done + + make strmatch.o + make string/strmatch.c + prev include/regex.h + prev include/ast.h + done + exec - compile ${<} + done + + make strcopy.o + make string/strcopy.c + prev include/ast.h + done + exec - compile ${<} + done + + make modei.o + make string/modei.c + make string/modelib.h implicit + make include/modex.h implicit + prev include/modecanon.h + prev ast_fs.h + done prev include/ls.h - prev include/error.h - prev include/ast.h - done path/pathprobe.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -c path/pathprobe.c - done pathprobe.o generated - make pathrepl.o - make path/pathrepl.c - prev ast_api.h prev include/ast.h - done path/pathrepl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathrepl.c - done pathrepl.o generated - make pathnative.o - make path/pathnative.c - prev include/ast.h - done path/pathnative.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathnative.c - done pathnative.o generated - make pathposix.o - make path/pathposix.c + done + done + exec - compile ${<} -Istring + done + + make modex.o + make string/modex.c + prev string/modelib.h + done + exec - compile ${<} -Istring + done + + make strmode.o + make string/strmode.c + prev string/modelib.h + done + exec - compile ${<} -Istring + done + + make strlcat.o + make string/strlcat.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make strlcpy.o + make string/strlcpy.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make strlook.o + make string/strlook.c + prev include/ast.h + done + exec - compile ${<} + done + + make strncopy.o + make string/strncopy.c + prev include/ast.h + done + exec - compile ${<} + done + + make strsearch.o + make string/strsearch.c + prev include/ast.h + done + exec - compile ${<} + done + + make strpsearch.o + make string/strpsearch.c + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make stresc.o + make string/stresc.c + prev include/ast.h + done + exec - compile ${<} + done + + make stropt.o + make string/stropt.c + prev include/ast.h + done + exec - compile ${<} + done + + make strtape.o + make string/strtape.c + prev include/ast.h + done + exec - compile ${<} + done + + make strpcmp.o + make string/strpcmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make strnpcmp.o + make string/strnpcmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make strvcmp.o + make string/strvcmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make strnvcmp.o + make string/strnvcmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make tok.o + make string/tok.c + make include/tok.h implicit + prev include/ast.h + done + prev include/ast.h + done + exec - compile ${<} + done + + make tokline.o + make string/tokline.c + prev include/tok.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make tokscan.o + make string/tokscan.c + prev FEATURE/hack + prev include/tok.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathaccess.o + make path/pathaccess.c + prev ast_api.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathcat.o + make path/pathcat.c + prev ast_api.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathcanon.o + make path/pathcanon.c + prev ast_api.h + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathcheck.o + make path/pathcheck.c + make include/times.h implicit + prev ast_time.h + prev include/ast.h + done + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathpath.o + make path/pathpath.c + prev ast_api.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathexists.o + make path/pathexists.c + prev include/error.h + prev include/ls.h + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make pathfind.o + make path/pathfind.c + prev include/ls.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathicase.o + make path/pathicase.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathkey.o + make path/pathkey.c + prev ast_api.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathprobe.o + make path/pathprobe.c + prev ast_api.h + make include/proc.h implicit + prev include/ast.h + done + prev include/ls.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" + done + + make pathrepl.o + make path/pathrepl.c + prev ast_api.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathnative.o + make path/pathnative.c + prev include/ast.h + done + exec - compile ${<} + done + + make pathposix.o + make path/pathposix.c + prev include/ast.h + done + exec - compile ${<} + done + + make pathtemp.o + make path/pathtemp.c + prev include/error.h + make include/tm.h implicit + prev include/times.h prev include/ast.h - done path/pathposix.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathposix.c - done pathposix.o generated - make pathtemp.o - make path/pathtemp.c - prev include/error.h - make include/tm.h implicit - prev include/times.h - prev include/ast.h - done include/tm.h - make tv.h implicit - make FEATURE/tv - prev features/tv - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/tv - prev include/ast.h - done FEATURE/tv generated - exec - ${STDCMP} -s FEATURE/tv tv.h || { ${STDRM} -f tv.h; ${STDCP} FEATURE/tv tv.h; } - prev include/ast.h - done tv.h generated + done + prev tv.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathtmp.o + make path/pathtmp.c + prev std/stdio.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathstat.o + make path/pathstat.c + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathgetlink.o + make path/pathgetlink.c + make misc/univlib.h implicit prev include/ls.h prev include/ast.h - done path/pathtemp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathtemp.c - done pathtemp.o generated - make pathtmp.o - make path/pathtmp.c - prev std/stdio.h - prev include/ast.h - done path/pathtmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathtmp.c - done pathtmp.o generated - make pathstat.o - make path/pathstat.c + done + done + exec - compile ${<} -Imisc + done + + make pathsetlink.o + make path/pathsetlink.c + prev misc/univlib.h + done + exec - compile ${<} -Imisc + done + + make pathbin.o + make path/pathbin.c + prev include/ast.h + done + exec - compile ${<} + done + + make pathshell.o + make path/pathshell.c + prev include/ast.h + done + exec - compile ${<} + done + + make pathcd.o + make path/pathcd.c + make include/stk.h implicit + prev include/sfio.h + done + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make pathprog.o + make path/pathprog.c + make FEATURE/prog implicit + prev features/prog + exec - invoke_iffe ${<} + done + prev include/ast_windows.h + prev include/ast.h + done + exec - compile ${<} + done + + make ftwalk.o + make misc/ftwalk.c + make include/ftwalk.h implicit + make include/fts.h implicit + prev ast_mode.h + prev ast_fs.h + prev include/ast_std.h + done + done + prev include/ast.h + done + exec - compile ${<} + done + + make ftwflags.o + make misc/ftwflags.c + prev include/ftwalk.h + prev include/ast.h + done + exec - compile ${<} + done + + make fts.o + make misc/fts.c + prev include/fts.h + prev include/ls.h + prev include/error.h + prev include/ast_dir.h + prev include/ast.h + done + exec - compile ${<} -Idir + done + + make astintercept.o + make misc/astintercept.c + make misc/intercepts.h implicit + prev include/shcmd.h implicit + prev include/ast.h + done + done + exec - compile ${<} -Imisc + done + + make conformance.o + make misc/conformance.c + prev include/ast.h + done + exec - compile ${<} + done + + make getenv.o + make misc/getenv.c + prev misc/intercepts.h + done + exec - compile ${<} -Imisc + done + + make setenviron.o + make misc/setenviron.c + prev misc/intercepts.h + done + exec - compile ${<} -Imisc + done + + make optget.o + make misc/optget.c + prev include/ccode.h + make include/debug.h implicit prev include/error.h - prev include/ls.h - prev include/ast.h - done path/pathstat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathstat.c - done pathstat.o generated - make pathgetlink.o - make path/pathgetlink.c - make misc/univlib.h implicit - prev include/ls.h - prev include/ast.h - done misc/univlib.h - done path/pathgetlink.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c path/pathgetlink.c - done pathgetlink.o generated - make pathsetlink.o - make path/pathsetlink.c - prev misc/univlib.h - done path/pathsetlink.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c path/pathsetlink.c - done pathsetlink.o generated - make pathbin.o - make path/pathbin.c - prev include/ast.h - done path/pathbin.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathbin.c - done pathbin.o generated - make pathshell.o - make path/pathshell.c prev include/ast.h - done path/pathshell.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathshell.c - done pathshell.o generated - make pathcd.o - make path/pathcd.c - make include/stk.h implicit - prev include/sfio.h - done include/stk.h + done + make misc/optlib.h implicit prev include/error.h + prev include/cdt.h prev include/ast.h - done path/pathcd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathcd.c - done pathcd.o generated - make pathprog.o - make path/pathprog.c - make FEATURE/prog implicit - prev features/prog - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/prog - done FEATURE/prog generated - prev include/ast_windows.h - prev include/ast.h - done path/pathprog.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c path/pathprog.c - done pathprog.o generated - make ftwalk.o - make misc/ftwalk.c - make include/ftwalk.h implicit - make include/fts.h implicit - prev ast_mode.h - prev ast_fs.h - prev include/ast_std.h - done include/fts.h - done include/ftwalk.h - prev include/ast.h - done misc/ftwalk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/ftwalk.c - done ftwalk.o generated - make ftwflags.o - make misc/ftwflags.c - prev include/ftwalk.h - prev include/ast.h - done misc/ftwflags.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/ftwflags.c - done ftwflags.o generated - make fts.o - make misc/fts.c - prev include/fts.h + done + done + exec - compile ${<} -Imisc + done + + make optjoin.o + make misc/optjoin.c + prev misc/optlib.h + done + exec - compile ${<} -Imisc + done + + make optesc.o + make misc/optesc.c + prev misc/optlib.h + done + exec - compile ${<} -Imisc + done + + make optctx.o + make misc/optctx.c + prev misc/optlib.h + done + exec - compile ${<} -Imisc + done + + make strsort.o + make string/strsort.c + prev include/ast.h + done + exec - compile ${<} + done + + make struniq.o + make string/struniq.c + prev include/ast.h + done + exec - compile ${<} + done + + make magic.o + make misc/magic.c + make include/magic.h implicit prev include/ls.h - prev include/error.h - prev include/ast_dir.h - prev include/ast.h - done misc/fts.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -D__OBSOLETE__=20120101 -c misc/fts.c - done fts.o generated - make astintercept.o - make misc/astintercept.c - make misc/intercepts.h implicit - prev include/shcmd.h implicit - prev include/ast.h - done misc/intercepts.h - done misc/astintercept.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/astintercept.c - done astintercept.o generated - make conformance.o - make misc/conformance.c - prev include/ast.h - done misc/conformance.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/conformance.c - done conformance.o generated - make getenv.o - make misc/getenv.c - prev windows.h - prev misc/intercepts.h - done misc/getenv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/getenv.c - done getenv.o generated - make setenviron.o - make misc/setenviron.c - prev misc/intercepts.h - done misc/setenviron.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/setenviron.c - done setenviron.o generated - make optget.o - make misc/optget.c - prev include/ccode.h - make include/debug.h implicit - prev include/error.h - prev include/ast.h - done include/debug.h - make misc/optlib.h implicit - prev include/error.h - prev include/cdt.h - prev include/ast.h - done misc/optlib.h - done misc/optget.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/optget.c - done optget.o generated - make optjoin.o - make misc/optjoin.c - prev misc/optlib.h - done misc/optjoin.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/optjoin.c - done optjoin.o generated - make optesc.o - make misc/optesc.c - prev misc/optlib.h - done misc/optesc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/optesc.c - done optesc.o generated - make optctx.o - make misc/optctx.c - prev misc/optlib.h - done misc/optctx.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/optctx.c - done optctx.o generated - make strsort.o - make string/strsort.c - prev include/ast.h - done string/strsort.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strsort.c - done strsort.o generated - make struniq.o - make string/struniq.c - prev include/ast.h - done string/struniq.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/struniq.c - done struniq.o generated - make magic.o - make misc/magic.c - make include/magic.h implicit + prev include/sfio.h + done + make include/swap.h implicit + prev ast_common.h + done + prev include/regex.h + prev include/error.h + prev include/modex.h + make include/dt.h implicit + prev include/vmalloc.h + prev include/cdt.h + done + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make mime.o + make misc/mime.c + make misc/mimelib.h implicit + make include/mime.h implicit prev include/ls.h prev include/sfio.h - done include/magic.h - make include/swap.h implicit - prev ast_common.h - done include/swap.h - prev include/regex.h - prev include/error.h - prev include/modex.h - make include/dt.h implicit - prev include/vmalloc.h - prev include/cdt.h - done include/dt.h - prev include/ccode.h - prev include/ast.h - done misc/magic.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/magic.c - done magic.o generated - make mime.o - make misc/mime.c - make misc/mimelib.h implicit - make include/mime.h implicit - prev include/ls.h - prev include/sfio.h - done include/mime.h - prev include/tok.h - prev include/magic.h - prev include/cdt.h - prev include/ast.h - done misc/mimelib.h - done misc/mime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/mime.c - done mime.o generated - make mimetype.o - make misc/mimetype.c - prev misc/mimelib.h - done misc/mimetype.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/mimetype.c - done mimetype.o generated - make signal.o - make misc/signal.c - prev ast_map.h - make sig.h implicit - make FEATURE/sig - prev features/sig.sh - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/sig.sh - done FEATURE/sig generated - exec - ${STDCMP} -s FEATURE/sig sig.h || { ${STDRM} -f sig.h; ${STDCP} FEATURE/sig sig.h; } - done sig.h generated - prev include/ast.h - done misc/signal.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/signal.c - done signal.o generated - make sigflag.o - make comp/sigflag.c - prev sig.h + done + prev include/tok.h + prev include/magic.h + prev include/cdt.h prev include/ast.h - done comp/sigflag.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/sigflag.c - done sigflag.o generated - make systrace.o - make misc/systrace.c - prev include/debug.h - prev include/proc.h - prev include/error.h + done + done + exec - compile ${<} -Imisc + done + + make mimetype.o + make misc/mimetype.c + prev misc/mimelib.h + done + exec - compile ${<} -Imisc + done + + make signal.o + make misc/signal.c + prev ast_map.h + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make sigflag.o + make comp/sigflag.c + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make systrace.o + make misc/systrace.c + prev include/debug.h + prev include/proc.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make error.o + make misc/error.c + prev include/regex.h + prev include/times.h + prev include/stk.h + prev sig.h + prev include/namval.h implicit + prev include/ccode.h + prev port/lclib.h + done + exec - compile ${<} -Iport -DERROR_CATALOG=\""libast"\" + done + + make errorf.o + make misc/errorf.c + prev include/error.h + done + exec - compile ${<} + done + + make errormsg.o + make misc/errormsg.c + prev include/error.h + done + exec - compile ${<} + done + + make errorx.o + make misc/errorx.c + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make localeconv.o + make comp/localeconv.c + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make setlocale.o + make comp/setlocale.c + prev include/ast_windows.h + prev std/wctype.h + prev include/error.h + prev include/namval.h + make include/mc.h implicit prev include/ast.h - done misc/systrace.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/systrace.c - done systrace.o generated - make error.o - make misc/error.c - prev include/regex.h - prev include/times.h - prev include/stk.h - prev sig.h - prev include/namval.h implicit - prev include/ccode.h - prev port/lclib.h - done misc/error.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -DERROR_CATALOG=\""libast"\" -c misc/error.c - done error.o generated - make errorf.o - make misc/errorf.c - prev include/error.h - done misc/errorf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/errorf.c - done errorf.o generated - make errormsg.o - make misc/errormsg.c - prev include/error.h - done misc/errormsg.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/errormsg.c - done errormsg.o generated - make errorx.o - make misc/errorx.c - prev port/lclib.h - done misc/errorx.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c misc/errorx.c - done errorx.o generated - make localeconv.o - make comp/localeconv.c - prev port/lclib.h - done comp/localeconv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c comp/localeconv.c - done localeconv.o generated - make setlocale.o - make comp/setlocale.c - prev include/ast_windows.h - prev std/wctype.h - prev include/error.h - prev include/namval.h - make include/mc.h implicit - prev include/ast.h - done include/mc.h - prev ast_wchar.h - prev port/lclib.h - prev ast_standards.h - done comp/setlocale.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c comp/setlocale.c - done setlocale.o generated - make translate.o - make misc/translate.c - make std/nl_types.h implicit - prev ast_nl_types.h - done std/nl_types.h - prev include/mc.h - prev include/error.h - prev include/cdt.h - prev port/lclib.h - done misc/translate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c misc/translate.c - done translate.o generated - make catopen.o - make comp/catopen.c - make std/iconv.h implicit - make ast_iconv.h implicit - make FEATURE/iconv - prev features/iconv - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/iconv - prev include/ccode.h - prev ast_common.h - done FEATURE/iconv generated - exec - ${STDCMP} -s FEATURE/iconv ast_iconv.h || { ${STDRM} -f ast_iconv.h; ${STDCP} FEATURE/iconv ast_iconv.h; } + done + prev ast_wchar.h + prev port/lclib.h + prev ast_standards.h + done + exec - compile ${<} -Iport + done + + make translate.o + make misc/translate.c + make std/nl_types.h implicit + prev ast_nl_types.h + done + prev include/mc.h + prev include/error.h + prev include/cdt.h + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make catopen.o + make comp/catopen.c + make std/iconv.h implicit + make ast_iconv.h implicit + make FEATURE/iconv prev include/ccode.h prev ast_common.h - done ast_iconv.h generated - done std/iconv.h - prev std/nl_types.h - prev include/mc.h - prev include/ast.h - done comp/catopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/catopen.c - done catopen.o generated - make iconv.o - make comp/iconv.c - prev include/ast_windows.h - prev port/lclib.h - prev std/iconv.h - prev include/ccode.h - prev include/error.h - prev std/dirent.h - prev include/ast.h - done comp/iconv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c comp/iconv.c - done iconv.o generated - make lc.o - make port/lc.c - make FEATURE/locale implicit - prev features/locale - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/locale - done FEATURE/locale generated - prev port/lclang.h - prev port/lclib.h - done port/lc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c port/lc.c - done lc.o generated - make lctab.o - prev lctab.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c lctab.c - done lctab.o generated - make mc.o - make port/mc.c - prev std/nl_types.h - prev include/mc.h - prev include/error.h - prev include/vmalloc.h - prev std/iconv.h + prev features/iconv + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} + prev include/ccode.h + prev ast_common.h + done + done + prev std/nl_types.h + prev include/mc.h + prev include/ast.h + done + exec - compile ${<} + done + + make iconv.o + make comp/iconv.c + prev include/ast_windows.h + prev port/lclib.h + prev std/iconv.h + prev include/ccode.h + prev include/error.h + prev std/dirent.h + prev include/ast.h + done + exec - compile ${<} -Iport + done + + make lc.o + make port/lc.c + make FEATURE/locale implicit + prev features/locale + exec - invoke_iffe ${<} + done + prev port/lclang.h + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make lctab.o + prev lctab.c + exec - compile ${<} -Iport + done + + make mc.o + make port/mc.c + prev std/nl_types.h + prev include/mc.h + prev include/error.h + prev include/vmalloc.h + prev std/iconv.h + prev port/lclib.h + make sfio/sfhdr.h implicit prev port/lclib.h - make sfio/sfhdr.h implicit - prev port/lclib.h - prev stropts.h implicit dontcare virtual - prev std/wchar.h - prev include/error.h - make FEATURE/float implicit - make features/float - prev FEATURE/standards - done features/float - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/float - prev ast_common.h - done FEATURE/float generated - prev mman.h implicit dontcare virtual - prev filio.h implicit dontcare virtual - prev stat.h implicit dontcare virtual - prev include/ls.h - make ast_tty.h implicit - prev FEATURE/tty - exec - ${STDCMP} -s FEATURE/tty ast_tty.h || { ${STDRM} -f ast_tty.h; ${STDCP} FEATURE/tty ast_tty.h; } - done ast_tty.h dontcare generated - prev ast_time.h - prev include/ast.h - make include/sfio_t.h implicit - prev include/sfio.h - done include/sfio_t.h - prev FEATURE/common - prev FEATURE/mmap - make FEATURE/sfio implicit - prev features/sfio - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/sfio - done FEATURE/sfio generated - done sfio/sfhdr.h - done port/mc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c port/mc.c - done mc.o generated - make base64.o - make string/base64.c - prev include/ast.h - done string/base64.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/base64.c - done base64.o generated - make recfmt.o - make misc/recfmt.c - make include/recfmt.h implicit - prev include/ast.h - done include/recfmt.h - done misc/recfmt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/recfmt.c - done recfmt.o generated - make recstr.o - make misc/recstr.c - prev include/recfmt.h - done misc/recstr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/recstr.c - done recstr.o generated - make reclen.o - make misc/reclen.c - prev include/recfmt.h - done misc/reclen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/reclen.c - done reclen.o generated - make fmtrec.o - make misc/fmtrec.c - prev include/recfmt.h - done misc/fmtrec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/fmtrec.c - done fmtrec.o generated - make fmtbase.o - make string/fmtbase.c - prev include/ast.h - done string/fmtbase.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D__OBSOLETE__=20120101 -c string/fmtbase.c - done fmtbase.o generated - make fmtbuf.o - make string/fmtbuf.c - prev include/ast.h - done string/fmtbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtbuf.c - done fmtbuf.o generated - make fmtclock.o - make string/fmtclock.c - prev include/tm.h - prev include/ast.h - done string/fmtclock.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtclock.c - done fmtclock.o generated - make fmtdev.o - make string/fmtdev.c - prev include/ls.h - prev include/ast.h - done string/fmtdev.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtdev.c - done fmtdev.o generated - make fmtelapsed.o - make string/fmtelapsed.c - prev include/ast.h - done string/fmtelapsed.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtelapsed.c - done fmtelapsed.o generated - make fmterror.o - make string/fmterror.c - prev include/ast.h - done string/fmterror.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmterror.c - done fmterror.o generated - make fmtesc.o - make string/fmtesc.c - prev std/wctype.h prev std/wchar.h - prev include/ccode.h - prev include/ast.h - done string/fmtesc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtesc.c - done fmtesc.o generated - make fmtfmt.o - make string/fmtfmt.c - prev include/ast.h - done string/fmtfmt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtfmt.c - done fmtfmt.o generated - make fmtfs.o - make string/fmtfs.c - prev include/cdt.h - prev FEATURE/fs - prev include/mnt.h implicit - prev include/ls.h - prev include/ast.h - done string/fmtfs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtfs.c - done fmtfs.o generated - make fmtident.o - make string/fmtident.c - prev include/ast.h - done string/fmtident.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtident.c - done fmtident.o generated - make fmtint.o - make string/fmtint.c - prev include/ast.h - done string/fmtint.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtint.c - done fmtint.o generated - make fmtip4.o - make string/fmtip4.c - prev include/ast.h - done string/fmtip4.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtip4.c - done fmtip4.o generated - make fmtip6.o - make string/fmtip6.c - prev include/ip6.h implicit - prev include/ast.h - done string/fmtip6.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtip6.c - done fmtip6.o generated - make fmtls.o - make string/fmtls.c - prev include/tm.h - prev include/ls.h - prev include/ast.h - done string/fmtls.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtls.c - done fmtls.o generated - make fmtmatch.o - make string/fmtmatch.c - prev include/ast.h - done string/fmtmatch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtmatch.c - done fmtmatch.o generated - make fmtmode.o - make string/fmtmode.c - prev string/modelib.h - done string/fmtmode.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Istring -Iinclude -Istd -c string/fmtmode.c - done fmtmode.o generated - make fmtnum.o - make string/fmtnum.c - prev include/ast.h - done string/fmtnum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtnum.c - done fmtnum.o generated - make fmtperm.o - make string/fmtperm.c + prev include/error.h + prev FEATURE/float prev include/ls.h + prev ast_tty.h + prev ast_time.h prev include/ast.h - done string/fmtperm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtperm.c - done fmtperm.o generated - make fmtre.o - make string/fmtre.c - prev include/ast.h - done string/fmtre.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtre.c - done fmtre.o generated - make fmttime.o - make string/fmttime.c - prev include/tm.h - done string/fmttime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmttime.c - done fmttime.o generated - make fmtuid.o - make string/fmtuid.c - prev std/stdio.h - prev include/cdt.h - prev include/ast.h - done string/fmtuid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtuid.c - done fmtuid.o generated - make fmtgid.o - make string/fmtgid.c - prev std/stdio.h - prev include/cdt.h - prev include/ast.h - done string/fmtgid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtgid.c - done fmtgid.o generated - make fmtsignal.o - make string/fmtsignal.c - prev sig.h - prev include/ast.h - done string/fmtsignal.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtsignal.c - done fmtsignal.o generated - make fmtscale.o - make string/fmtscale.c - prev port/lclib.h - prev include/ast.h - done string/fmtscale.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c string/fmtscale.c - done fmtscale.o generated - make fmttmx.o - make string/fmttmx.c - prev tv.h - make tmx.h implicit - make FEATURE/tmx - make features/tmx - prev FEATURE/common - done features/tmx - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/tmx - prev tv.h - prev include/tm.h - done FEATURE/tmx generated - exec - ${STDCMP} -s FEATURE/tmx tmx.h || { ${STDRM} -f tmx.h; ${STDCP} FEATURE/tmx tmx.h; } + make include/sfio_t.h implicit + prev include/sfio.h + done + prev FEATURE/common + prev FEATURE/mmap + make FEATURE/sfio implicit + prev features/sfio + exec - invoke_iffe ${<} + done + done + done + exec - compile ${<} ${DEBUG+-DDEBUG=${DEBUG}} -Iport -Isfio + done + + make base64.o + make string/base64.c + prev include/ast.h + done + exec - compile ${<} + done + + make recfmt.o + make misc/recfmt.c + make include/recfmt.h implicit + prev include/ast.h + done + done + exec - compile ${<} + done + + make recstr.o + make misc/recstr.c + prev include/recfmt.h + done + exec - compile ${<} + done + + make reclen.o + make misc/reclen.c + prev include/recfmt.h + done + exec - compile ${<} + done + + make fmtrec.o + make misc/fmtrec.c + prev include/recfmt.h + done + exec - compile ${<} + done + + make fmtbuf.o + make string/fmtbuf.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtclock.o + make string/fmtclock.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtdev.o + make string/fmtdev.c + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtelapsed.o + make string/fmtelapsed.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmterror.o + make string/fmterror.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtesc.o + make string/fmtesc.c + prev std/wctype.h + prev std/wchar.h + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtfmt.o + make string/fmtfmt.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtfs.o + make string/fmtfs.c + prev include/cdt.h + prev FEATURE/fs + prev include/mnt.h implicit + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtident.o + make string/fmtident.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtint.o + make string/fmtint.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtip4.o + make string/fmtip4.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtip6.o + make string/fmtip6.c + prev include/ip6.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make fmtls.o + make string/fmtls.c + prev include/tm.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtmatch.o + make string/fmtmatch.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtmode.o + make string/fmtmode.c + prev string/modelib.h + done + exec - compile ${<} -Istring + done + + make fmtnum.o + make string/fmtnum.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmtperm.o + make string/fmtperm.c + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtre.o + make string/fmtre.c + prev include/ast.h + done + exec - compile ${<} + done + + make fmttime.o + make string/fmttime.c + prev include/tm.h + done + exec - compile ${<} + done + + make fmtuid.o + make string/fmtuid.c + prev std/stdio.h + prev include/cdt.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtgid.o + make string/fmtgid.c + prev std/stdio.h + prev include/cdt.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtsignal.o + make string/fmtsignal.c + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make fmtscale.o + make string/fmtscale.c + prev port/lclib.h + prev include/ast.h + done + exec - compile ${<} -Iport + done + + make fmttmx.o + make string/fmttmx.c + prev tv.h + make tmx.h implicit + make FEATURE/tmx prev tv.h prev include/tm.h - done tmx.h generated - done string/fmttmx.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmttmx.c - done fmttmx.o generated - make fmttv.o - make string/fmttv.c - prev include/tm.h - prev tv.h - done string/fmttv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmttv.c - done fmttv.o generated - make fmtversion.o - make string/fmtversion.c - prev include/ast.h - done string/fmtversion.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/fmtversion.c - done fmtversion.o generated - make strelapsed.o - make string/strelapsed.c - prev include/ast.h - done string/strelapsed.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strelapsed.c - done strelapsed.o generated - make strperm.o - make string/strperm.c - prev include/modex.h - prev include/ls.h - prev include/ast.h - done string/strperm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strperm.c - done strperm.o generated - make struid.o - make string/struid.c - prev include/cdt.h - prev include/ast.h - done string/struid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/struid.c - done struid.o generated - make strgid.o - make string/strgid.c - prev include/cdt.h - prev include/ast.h - done string/strgid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strgid.c - done strgid.o generated - make strtoip4.o - make string/strtoip4.c - prev include/ast.h - done string/strtoip4.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strtoip4.c - done strtoip4.o generated - make strtoip6.o - make string/strtoip6.c - prev include/ip6.h - prev include/ast.h - done string/strtoip6.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strtoip6.c - done strtoip6.o generated - make stack.o - make misc/stack.c - prev include/stack.h implicit - prev include/ast.h - done misc/stack.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/stack.c - done stack.o generated - make stk.o - make misc/stk.c - prev include/stk.h - make align.h implicit - make FEATURE/align - make features/align.c - prev FEATURE/common - done features/align.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. ${LDFLAGS}" run features/align.c - done FEATURE/align generated - exec - ${STDCMP} -s FEATURE/align align.h || { ${STDRM} -f align.h; ${STDCP} FEATURE/align align.h; } - done align.h generated - prev include/ast.h - prev include/sfio_t.h - done misc/stk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/stk.c - done stk.o generated - make swapget.o - make string/swapget.c - prev include/swap.h - prev include/ast.h - done string/swapget.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/swapget.c - done swapget.o generated - make swapmem.o - make string/swapmem.c - prev include/swap.h - prev include/ast.h - done string/swapmem.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/swapmem.c - done swapmem.o generated - make swapop.o - make string/swapop.c - prev include/swap.h - prev include/ast.h - done string/swapop.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/swapop.c - done swapop.o generated - make swapput.o - make string/swapput.c - prev include/swap.h - prev include/ast.h - done string/swapput.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/swapput.c - done swapput.o generated - make sigdata.o - make misc/sigdata.c - make FEATURE/signal implicit - make features/signal.c - make FEATURE/siglist implicit - prev features/siglist - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/siglist - done FEATURE/siglist generated - prev FEATURE/standards - done features/signal.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. ${LDFLAGS}" run features/signal.c - done FEATURE/signal generated - prev sig.h - prev include/ast.h - done misc/sigdata.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/sigdata.c - done sigdata.o generated - make sigcrit.o - make misc/sigcrit.c - prev sig.h - prev include/ast.h - done misc/sigcrit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/sigcrit.c - done sigcrit.o generated - make sigunblock.o - make comp/sigunblock.c - prev sig.h - prev include/ast.h - done comp/sigunblock.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/sigunblock.c - done sigunblock.o generated - make procopen.o - make misc/procopen.c - prev include/namval.h - prev ast_tty.h - prev include/ls.h - make misc/proclib.h implicit - prev include/proc.h - make include/wait.h implicit - make ast_wait.h implicit - make FEATURE/wait - prev features/wait - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/wait - done FEATURE/wait generated - exec - ${STDCMP} -s FEATURE/wait ast_wait.h || { ${STDRM} -f ast_wait.h; ${STDCP} FEATURE/wait ast_wait.h; } - done ast_wait.h dontcare generated - prev include/ast.h - done include/wait.h - prev sig.h - prev include/ast.h - done misc/proclib.h - done misc/procopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/procopen.c - done procopen.o generated - make procclose.o - make misc/procclose.c - prev misc/proclib.h - done misc/procclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/procclose.c - done procclose.o generated - make procrun.o - make misc/procrun.c - prev misc/proclib.h - done misc/procrun.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -D__OBSOLETE__=20120101 -c misc/procrun.c - done procrun.o generated - make procfree.o - make misc/procfree.c - prev misc/proclib.h - done misc/procfree.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/procfree.c - done procfree.o generated - make tmdate.o - make tm/tmdate.c - prev tmx.h - done tm/tmdate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmdate.c - done tmdate.o generated - make tmequiv.o - make tm/tmequiv.c - prev include/tm.h - done tm/tmequiv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmequiv.c - done tmequiv.o generated - make tmfix.o - make tm/tmfix.c - prev tmx.h - prev include/ast.h - done tm/tmfix.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmfix.c - done tmfix.o generated - make tmfmt.o - make tm/tmfmt.c - prev tmx.h - done tm/tmfmt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmfmt.c - done tmfmt.o generated - make tmform.o - make tm/tmform.c - prev include/tm.h - prev include/ast.h - done tm/tmform.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmform.c - done tmform.o generated - make tmgoff.o - make tm/tmgoff.c - prev include/tm.h - prev include/ast.h - done tm/tmgoff.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmgoff.c - done tmgoff.o generated - make tminit.o - make tm/tminit.c - make FEATURE/tmlib implicit - prev features/tmlib - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/tmlib - done FEATURE/tmlib generated - prev include/namval.h - prev include/tm.h - done tm/tminit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tminit.c - done tminit.o generated - make tmleap.o - make tm/tmleap.c - prev tmx.h - done tm/tmleap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmleap.c - done tmleap.o generated - make tmlex.o - make tm/tmlex.c - prev include/tm.h - prev include/ast.h - done tm/tmlex.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmlex.c - done tmlex.o generated - make tmlocale.o - make tm/tmlocale.c - prev std/nl_types.h - prev std/nl_types.h - prev include/ast_windows.h - prev port/lclib.h - prev ast_nl_types.h - prev include/tm.h - prev include/mc.h - prev std/iconv.h - prev include/cdt.h - prev include/ast.h - done tm/tmlocale.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c tm/tmlocale.c - done tmlocale.o generated - make tmmake.o - make tm/tmmake.c - prev tmx.h - done tm/tmmake.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmmake.c - done tmmake.o generated - make tmpoff.o - make tm/tmpoff.c - prev include/tm.h - prev include/ast.h - done tm/tmpoff.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmpoff.c - done tmpoff.o generated - make tmscan.o - make tm/tmscan.c - prev tmx.h - done tm/tmscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmscan.c - done tmscan.o generated - make tmsleep.o - make tm/tmsleep.c - prev tv.h - prev include/tm.h - prev include/ast.h - done tm/tmsleep.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmsleep.c - done tmsleep.o generated - make tmtime.o - make tm/tmtime.c - prev tmx.h - done tm/tmtime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmtime.c - done tmtime.o generated - make tmtype.o - make tm/tmtype.c - prev include/tm.h - prev include/ast.h - done tm/tmtype.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmtype.c - done tmtype.o generated - make tmweek.o - make tm/tmweek.c - prev tmx.h - done tm/tmweek.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmweek.c - done tmweek.o generated - make tmword.o - make tm/tmword.c - prev include/tm.h - prev include/ast.h - done tm/tmword.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmword.c - done tmword.o generated - make tmzone.o - make tm/tmzone.c - prev include/tm.h - prev include/ast.h - done tm/tmzone.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmzone.c - done tmzone.o generated - make tmxdate.o - make tm/tmxdate.c - prev include/debug.h - prev tmx.h - done tm/tmxdate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxdate.c - done tmxdate.o generated - make tmxduration.o - make tm/tmxduration.c - prev tmx.h - done tm/tmxduration.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxduration.c - done tmxduration.o generated - make tmxfmt.o - make tm/tmxfmt.c - prev tmx.h - done tm/tmxfmt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Icomp -Iinclude -Istd -c tm/tmxfmt.c - done tmxfmt.o generated - make tmxgettime.o - make tm/tmxgettime.c - prev tv.h - prev tmx.h - done tm/tmxgettime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxgettime.c - done tmxgettime.o generated - make tmxleap.o - make tm/tmxleap.c - prev tmx.h - done tm/tmxleap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxleap.c - done tmxleap.o generated - make tmxmake.o - make tm/tmxmake.c - prev FEATURE/tmlib - prev tmx.h - done tm/tmxmake.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxmake.c - done tmxmake.o generated - make tmxscan.o - make tm/tmxscan.c - prev tmx.h - done tm/tmxscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxscan.c - done tmxscan.o generated - make tmxsettime.o - make tm/tmxsettime.c - prev tv.h - prev tmx.h - done tm/tmxsettime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxsettime.c - done tmxsettime.o generated - make tmxsleep.o - make tm/tmxsleep.c - prev tv.h - prev tmx.h - done tm/tmxsleep.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxsleep.c - done tmxsleep.o generated - make tmxtime.o - make tm/tmxtime.c - prev FEATURE/tmlib - prev tmx.h - done tm/tmxtime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxtime.c - done tmxtime.o generated - make tmxtouch.o - make tm/tmxtouch.c - prev tv.h - prev tmx.h - done tm/tmxtouch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmxtouch.c - done tmxtouch.o generated - make tvcmp.o - make tm/tvcmp.c - prev tv.h - done tm/tvcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tvcmp.c - done tvcmp.o generated - make tvgettime.o - make tm/tvgettime.c - make FEATURE/tvlib implicit - prev features/tvlib - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/tvlib - done FEATURE/tvlib generated - prev include/tm.h - prev tv.h - done tm/tvgettime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tvgettime.c - done tvgettime.o generated - make tvsettime.o - make tm/tvsettime.c - prev FEATURE/tvlib - prev include/tm.h + make features/tmx + prev FEATURE/common + done + exec - invoke_iffe ${<} + done + exec - cp -f ${<} ${@} prev tv.h - done tm/tvsettime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tvsettime.c - done tvsettime.o generated - make tvsleep.o - make tm/tvsleep.c - prev FEATURE/tvlib - prev include/error.h prev include/tm.h - prev tv.h - prev include/ast.h - done tm/tvsleep.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tvsleep.c - done tvsleep.o generated - make tvtouch.o - make tm/tvtouch.c - prev FEATURE/tvlib - prev include/error.h - prev include/times.h - prev tv.h - prev include/ls.h - prev include/ast.h - done tm/tvtouch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tvtouch.c - done tvtouch.o generated - make cmdarg.o - make misc/cmdarg.c - prev ast_api.h - prev include/proc.h - make misc/cmdlib.h implicit - make include/cmdarg.h implicit - prev include/error.h - done include/cmdarg.h - done misc/cmdlib.h - prev include/ast.h - done misc/cmdarg.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/cmdarg.c - done cmdarg.o generated - make vecargs.o - make vec/vecargs.c - prev include/vecargs.h implicit - prev include/ast.h - done vec/vecargs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vec/vecargs.c - done vecargs.o generated - make vecfile.o - make vec/vecfile.c - prev include/vecargs.h - prev include/ls.h - prev include/ast.h - done vec/vecfile.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vec/vecfile.c - done vecfile.o generated - make vecfree.o - make vec/vecfree.c - prev include/vecargs.h - prev include/ast.h - done vec/vecfree.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vec/vecfree.c - done vecfree.o generated - make vecload.o - make vec/vecload.c - prev include/vecargs.h - prev include/ast.h - done vec/vecload.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vec/vecload.c - done vecload.o generated - make vecstring.o - make vec/vecstring.c - prev include/vecargs.h - prev include/ast.h - done vec/vecstring.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vec/vecstring.c - done vecstring.o generated - make univdata.o - make misc/univdata.c - prev misc/univlib.h - done misc/univdata.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -c misc/univdata.c - done univdata.o generated - make touch.o - make port/touch.c - prev tv.h - prev include/times.h - prev include/ast.h - done port/touch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/touch.c - done touch.o generated - make mnt.o - make port/mnt.c - prev mnttab.h implicit dontcare virtual - prev std/stdio.h - prev std/stdio.h - prev include/ast_windows.h - prev include/ls.h - prev include/mnt.h - prev include/ast.h - done port/mnt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/mnt.c - done mnt.o generated - make debug.o - make misc/debug.c - prev include/times.h - prev FEATURE/time - prev include/debug.h - prev include/error.h - prev include/ast.h - done misc/debug.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c misc/debug.c - done debug.o generated - make memccpy.o - make comp/memccpy.c - prev include/ast.h - done comp/memccpy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memccpy.c - done memccpy.o generated - make memchr.o - make comp/memchr.c - prev include/ast.h - done comp/memchr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memchr.c - done memchr.o generated - make memcmp.o - make comp/memcmp.c - prev include/ast.h - done comp/memcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memcmp.c - done memcmp.o generated - make memcpy.o - make comp/memcpy.c - prev include/ast.h - done comp/memcpy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memcpy.c - done memcpy.o generated - make memdup.o - make string/memdup.c - prev include/ast.h - done string/memdup.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/memdup.c - done memdup.o generated - make memmove.o - make comp/memmove.c - prev include/ast.h - done comp/memmove.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memmove.c - done memmove.o generated - make memset.o - make comp/memset.c - prev include/ast.h - done comp/memset.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/memset.c - done memset.o generated - make mkdir.o - make comp/mkdir.c - prev include/error.h - prev include/wait.h - prev include/ls.h - prev include/ast.h - done comp/mkdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mkdir.c - done mkdir.o generated - make mkfifo.o - make comp/mkfifo.c - prev include/error.h - prev include/ls.h - prev include/ast.h - done comp/mkfifo.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mkfifo.c - done mkfifo.o generated - make mknod.o - make comp/mknod.c - prev include/error.h - prev include/ls.h - prev include/ast.h - done comp/mknod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mknod.c - done mknod.o generated - make rmdir.o - make comp/rmdir.c - prev include/error.h - prev include/ls.h - prev include/ast.h - done comp/rmdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/rmdir.c - done rmdir.o generated - make remove.o - make comp/remove.c - prev ast_map.h - prev include/ast.h - done comp/remove.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/remove.c - done remove.o generated - make rename.o - make comp/rename.c + done + done + exec - compile ${<} + done + + make fmttv.o + make string/fmttv.c + prev include/tm.h + prev tv.h + done + exec - compile ${<} + done + + make fmtversion.o + make string/fmtversion.c + prev include/ast.h + done + exec - compile ${<} + done + + make strelapsed.o + make string/strelapsed.c + prev include/ast.h + done + exec - compile ${<} + done + + make strperm.o + make string/strperm.c + prev include/modex.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make struid.o + make string/struid.c + prev include/cdt.h + prev include/ast.h + done + exec - compile ${<} + done + + make strgid.o + make string/strgid.c + prev include/cdt.h + prev include/ast.h + done + exec - compile ${<} + done + + make strtoip4.o + make string/strtoip4.c + prev include/ast.h + done + exec - compile ${<} + done + + make strtoip6.o + make string/strtoip6.c + prev include/ip6.h + prev include/ast.h + done + exec - compile ${<} + done + + make stk.o + make misc/stk.c + prev include/stk.h + prev align.h + prev include/ast.h + prev include/sfio_t.h + done + exec - compile ${<} + done + + make swapget.o + make string/swapget.c + prev include/swap.h + prev include/ast.h + done + exec - compile ${<} + done + + make swapmem.o + make string/swapmem.c + prev include/swap.h + prev include/ast.h + done + exec - compile ${<} + done + + make swapop.o + make string/swapop.c + prev include/swap.h + prev include/ast.h + done + exec - compile ${<} + done + + make swapput.o + make string/swapput.c + prev include/swap.h + prev include/ast.h + done + exec - compile ${<} + done + + make sigdata.o + make misc/sigdata.c + make FEATURE/signal implicit + make features/signal.c + make FEATURE/siglist implicit + prev features/siglist + exec - invoke_iffe ${<} + done + prev FEATURE/standards + done + exec - invoke_iffe ${<} -I. + done + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make sigcrit.o + make misc/sigcrit.c + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make sigunblock.o + make comp/sigunblock.c + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make procopen.o + make misc/procopen.c + prev include/namval.h + prev ast_tty.h + prev include/ls.h + make misc/proclib.h implicit prev include/proc.h - prev include/error.h - prev include/ast.h - done comp/rename.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/rename.c - done rename.o generated - make link.o - make comp/link.c - prev include/error.h - prev include/ast.h - done comp/link.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/link.c - done link.o generated - make unlink.o - make comp/unlink.c - prev include/ast.h - done comp/unlink.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/unlink.c - done unlink.o generated - make strdup.o - make string/strdup.c - prev include/ast.h - done string/strdup.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/strdup.c - done strdup.o generated - make strchr.o - make comp/strchr.c - prev include/ast.h - done comp/strchr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strchr.c - done strchr.o generated - make strrchr.o - make comp/strrchr.c - prev include/ast.h - done comp/strrchr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strrchr.c - done strrchr.o generated - make strstr.o - make comp/strstr.c - prev include/ast.h - done comp/strstr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strstr.c - done strstr.o generated - make strtod.o - make comp/strtod.c - make sfio/sfstrtof.h implicit - prev FEATURE/float - prev sfio/sfhdr.h - done sfio/sfstrtof.h - prev include/ast.h - done comp/strtod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtod.c - done strtod.o generated - make strtold.o - make comp/strtold.c - prev sfio/sfstrtof.h - prev include/ast.h - prev ast_sys.h - prev ast_lib.h - prev ast_common.h - done comp/strtold.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtold.c - done strtold.o generated - make strtol.o - make comp/strtol.c - make string/strtoi.h implicit - prev sfio/sfhdr.h - prev include/error.h + make include/wait.h implicit + prev ast_wait.h prev include/ast.h - done string/strtoi.h dontcare - done comp/strtol.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtol.c - done strtol.o generated - make strtoll.o - make comp/strtoll.c - prev string/strtoi.h - prev ast_map.h - prev include/ast.h - done comp/strtoll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtoll.c - done strtoll.o generated - make strtoul.o - make comp/strtoul.c - prev string/strtoi.h - done comp/strtoul.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtoul.c - done strtoul.o generated - make strtoull.o - make comp/strtoull.c - prev string/strtoi.h - prev ast_map.h - prev include/ast.h - done comp/strtoull.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c comp/strtoull.c - done strtoull.o generated - make strton.o - make string/strton.c - prev string/strtoi.h - done string/strton.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strton.c - done strton.o generated - make strtonll.o - make string/strtonll.c - prev string/strtoi.h - done string/strtonll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strtonll.c - done strtonll.o generated - make strntod.o - make string/strntod.c - prev sfio/sfstrtof.h - prev include/ast.h - done string/strntod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntod.c - done strntod.o generated - make strntold.o - make string/strntold.c - prev sfio/sfstrtof.h - prev include/ast.h - done string/strntold.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntold.c - done strntold.o generated - make strnton.o - make string/strnton.c - prev string/strtoi.h - done string/strnton.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strnton.c - done strnton.o generated - make strntonll.o - make string/strntonll.c - prev string/strtoi.h - done string/strntonll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntonll.c - done strntonll.o generated - make strntol.o - make string/strntol.c - prev string/strtoi.h - done string/strntol.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntol.c - done strntol.o generated - make strntoll.o - make string/strntoll.c - prev string/strtoi.h - done string/strntoll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntoll.c - done strntoll.o generated - make strntoul.o - make string/strntoul.c - prev string/strtoi.h - done string/strntoul.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntoul.c - done strntoul.o generated - make strntoull.o - make string/strntoull.c - prev string/strtoi.h - done string/strntoull.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istring -Iinclude -Istd -I${INSTALLROOT}/include -c string/strntoull.c - done strntoull.o generated - make strcasecmp.o - make comp/strcasecmp.c - prev include/ast.h - done comp/strcasecmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strcasecmp.c - done strcasecmp.o generated - make strncasecmp.o - make comp/strncasecmp.c - prev include/ast.h - done comp/strncasecmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strncasecmp.c - done strncasecmp.o generated - make strerror.o - make string/strerror.c - make FEATURE/errno implicit - prev features/errno - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/errno - done FEATURE/errno generated - prev port/lclib.h - done string/strerror.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Iinclude -Istd -I${INSTALLROOT}/include -c string/strerror.c - done strerror.o generated - make mktemp.o - make comp/mktemp.c - prev ast_map.h - prev std/stdio.h - prev include/ast.h - done comp/mktemp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mktemp.c - done mktemp.o generated - make tmpnam.o - make comp/tmpnam.c - prev ast_map.h - prev std/stdio.h - prev include/ast.h - done comp/tmpnam.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/tmpnam.c - done tmpnam.o generated - make fsync.o - make comp/fsync.c - prev include/error.h - prev include/ast.h - done comp/fsync.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/fsync.c - done fsync.o generated - make execlp.o - make comp/execlp.c - prev include/ast.h - prev ast_lib.h - done comp/execlp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/execlp.c - done execlp.o generated - make execve.o - make comp/execve.c - prev include/error.h - prev include/wait.h + done prev sig.h prev include/ast.h - done comp/execve.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/execve.c - done execve.o generated - make execvp.o - make comp/execvp.c - prev include/ast.h - prev ast_lib.h - done comp/execvp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/execvp.c - done execvp.o generated - make execvpe.o - make comp/execvpe.c - prev include/ast.h - prev ast_lib.h - done comp/execvpe.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/execvpe.c - done execvpe.o generated - make spawnveg.o - make comp/spawnveg.c - prev ast_tty.h - prev sig.h - prev process.h implicit dontcare virtual - prev include/wait.h - prev include/error.h - prev include/ast.h - done comp/spawnveg.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Icomp -Iinclude -Istd -c comp/spawnveg.c - done spawnveg.o generated - make killpg.o - make comp/killpg.c - prev sig.h - prev include/ast.h - done comp/killpg.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/killpg.c - done killpg.o generated - make getlogin.o - make comp/getlogin.c - prev include/ast.h - done comp/getlogin.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getlogin.c - done getlogin.o generated - make putenv.o - make comp/putenv.c - prev ast_map.h - prev include/ast.h - done comp/putenv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/putenv.c - done putenv.o generated - make setenv.o - make comp/setenv.c - prev ast_map.h - prev include/ast.h - done comp/setenv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/setenv.c - done setenv.o generated - make unsetenv.o - make comp/unsetenv.c - prev ast_map.h - prev include/ast.h - done comp/unsetenv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/unsetenv.c - done unsetenv.o generated - make lstat.o - make comp/lstat.c - prev include/ls.h - prev include/ast.h - done comp/lstat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/lstat.c - done lstat.o generated - make statvfs.o - make comp/statvfs.c - prev include/error.h - prev include/ls.h - prev include/ast.h - done comp/statvfs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/statvfs.c - done statvfs.o generated - make eaccess.o - make comp/eaccess.c - prev FEATURE/eaccess - prev include/ls.h - prev include/ast.h - done comp/eaccess.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/eaccess.c - done eaccess.o generated - make gross.o - make comp/gross.c - make comp/gross_sgi.h implicit - prev locale_attr.h implicit dontcare virtual - done comp/gross_sgi.h dontcare - prev FEATURE/hack - prev include/ls.h - prev include/ast.h - done comp/gross.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/gross.c - done gross.o generated - make omitted.o - make comp/omitted.c - prev process.h - prev include/ast_windows.h - prev include/ls.h - make FEATURE/omitted implicit - prev features/omitted - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/omitted - done FEATURE/omitted generated - prev include/tm.h - prev include/error.h - prev ast_stdio.h - prev include/ast.h + done + done + exec - compile ${<} -Imisc + done + + make procclose.o + make misc/procclose.c + prev misc/proclib.h + done + exec - compile ${<} -Imisc + done + + make procrun.o + make misc/procrun.c + prev misc/proclib.h + done + exec - compile ${<} -Imisc + done + + make procfree.o + make misc/procfree.c + prev misc/proclib.h + done + exec - compile ${<} -Imisc + done + + make tmdate.o + make tm/tmdate.c + prev tmx.h + done + exec - compile ${<} + done + + make tmequiv.o + make tm/tmequiv.c + prev include/tm.h + done + exec - compile ${<} + done + + make tmfix.o + make tm/tmfix.c + prev tmx.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmfmt.o + make tm/tmfmt.c + prev tmx.h + done + exec - compile ${<} + done + + make tmform.o + make tm/tmform.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmgoff.o + make tm/tmgoff.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tminit.o + make tm/tminit.c + make FEATURE/tmlib implicit + prev features/tmlib + exec - invoke_iffe ${<} + done + prev include/namval.h + prev include/tm.h + done + exec - compile ${<} + done + + make tmleap.o + make tm/tmleap.c + prev tmx.h + done + exec - compile ${<} + done + + make tmlex.o + make tm/tmlex.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmlocale.o + make tm/tmlocale.c + prev std/nl_types.h + prev include/ast_windows.h + prev port/lclib.h + prev ast_nl_types.h + prev include/tm.h + prev include/mc.h + prev std/iconv.h + prev include/cdt.h + prev include/ast.h + done + exec - compile ${<} -Iport + done + + make tmmake.o + make tm/tmmake.c + prev tmx.h + done + exec - compile ${<} + done + + make tmpoff.o + make tm/tmpoff.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmscan.o + make tm/tmscan.c + prev tmx.h + done + exec - compile ${<} + done + + make tmsleep.o + make tm/tmsleep.c + prev tv.h + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmtime.o + make tm/tmtime.c + prev tmx.h + done + exec - compile ${<} + done + + make tmtype.o + make tm/tmtype.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmweek.o + make tm/tmweek.c + prev tmx.h + done + exec - compile ${<} + done + + make tmword.o + make tm/tmword.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmzone.o + make tm/tmzone.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmxdate.o + make tm/tmxdate.c + prev include/debug.h + prev tmx.h + done + exec - compile ${<} + done + + make tmxduration.o + make tm/tmxduration.c + prev tmx.h + done + exec - compile ${<} + done + + make tmxfmt.o + make tm/tmxfmt.c + prev tmx.h + done + exec - compile ${<} + done + + make tmxgettime.o + make tm/tmxgettime.c + prev tv.h + prev tmx.h + done + exec - compile ${<} + done + + make tmxleap.o + make tm/tmxleap.c + prev tmx.h + done + exec - compile ${<} + done + + make tmxmake.o + make tm/tmxmake.c + prev FEATURE/tmlib + prev tmx.h + done + exec - compile ${<} + done + + make tmxscan.o + make tm/tmxscan.c + prev tmx.h + done + exec - compile ${<} + done + + make tmxsettime.o + make tm/tmxsettime.c + prev tv.h + prev tmx.h + done + exec - compile ${<} + done + + make tmxsleep.o + make tm/tmxsleep.c + prev tv.h + prev tmx.h + done + exec - compile ${<} + done + + make tmxtime.o + make tm/tmxtime.c + prev FEATURE/tmlib + prev tmx.h + done + exec - compile ${<} + done + + make tmxtouch.o + make tm/tmxtouch.c + prev tv.h + prev tmx.h + done + exec - compile ${<} + done + + make tvcmp.o + make tm/tvcmp.c + prev tv.h + done + exec - compile ${<} + done + + make tvgettime.o + make tm/tvgettime.c + make FEATURE/tvlib implicit + prev features/tvlib + exec - invoke_iffe ${<} + done + prev include/tm.h + prev tv.h + done + exec - compile ${<} + done + + make tvsettime.o + make tm/tvsettime.c + prev FEATURE/tvlib + prev include/tm.h + prev tv.h + done + exec - compile ${<} + done + + make tvsleep.o + make tm/tvsleep.c + prev FEATURE/tvlib + prev include/error.h + prev include/tm.h + prev tv.h + prev include/ast.h + done + exec - compile ${<} + done + + make tvtouch.o + make tm/tvtouch.c + prev FEATURE/tvlib + prev include/error.h + prev include/times.h + prev tv.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make cmdarg.o + make misc/cmdarg.c + prev ast_api.h + prev include/proc.h + make misc/cmdlib.h implicit + make include/cmdarg.h implicit + prev include/error.h + done + done + prev include/ast.h + done + exec - compile ${<} -Imisc + done + + make univdata.o + make misc/univdata.c + prev misc/univlib.h + done + exec - compile ${<} -Imisc + done + + make touch.o + make port/touch.c + prev tv.h + prev include/times.h + prev include/ast.h + done + exec - compile ${<} + done + + make mnt.o + make port/mnt.c + prev std/stdio.h + prev include/ast_windows.h + prev include/ls.h + prev include/mnt.h + prev include/ast.h + done + exec - compile ${<} + done + + make debug.o + make misc/debug.c + prev include/times.h + prev FEATURE/time + prev include/debug.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make memccpy.o + make comp/memccpy.c + prev include/ast.h + done + exec - compile ${<} + done + + make memchr.o + make comp/memchr.c + prev include/ast.h + done + exec - compile ${<} + done + + make memcmp.o + make comp/memcmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make memcpy.o + make comp/memcpy.c + prev include/ast.h + done + exec - compile ${<} + done + + make memdup.o + make string/memdup.c + prev include/ast.h + done + exec - compile ${<} + done + + make memmove.o + make comp/memmove.c + prev include/ast.h + done + exec - compile ${<} + done + + make memset.o + make comp/memset.c + prev include/ast.h + done + exec - compile ${<} + done + + make mkdir.o + make comp/mkdir.c + prev include/error.h + prev include/wait.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make mkfifo.o + make comp/mkfifo.c + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make mknod.o + make comp/mknod.c + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make rmdir.o + make comp/rmdir.c + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make remove.o + make comp/remove.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make rename.o + make comp/rename.c + prev include/proc.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make link.o + make comp/link.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make unlink.o + make comp/unlink.c + prev include/ast.h + done + exec - compile ${<} + done + + make strdup.o + make string/strdup.c + prev include/ast.h + done + exec - compile ${<} + done + + make strtod.o + make comp/strtod.c + make sfio/sfstrtof.h implicit prev FEATURE/float - done comp/omitted.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/omitted.c - done omitted.o generated - make readlink.o - make comp/readlink.c - prev include/error.h - prev comp/fakelink.h implicit dontcare - prev include/ast.h - done comp/readlink.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/readlink.c - done readlink.o generated - make symlink.o - make comp/symlink.c - prev include/error.h - prev comp/fakelink.h - prev include/ast.h - done comp/symlink.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/symlink.c - done symlink.o generated - make getpgrp.o - make comp/getpgrp.c - prev include/ast_std.h - done comp/getpgrp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getpgrp.c - done getpgrp.o generated - make setpgid.o - make comp/setpgid.c - prev include/error.h - prev include/ast.h - done comp/setpgid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/setpgid.c - done setpgid.o generated - make setsid.o - make comp/setsid.c - prev include/error.h - prev ast_tty.h - prev include/ast.h - done comp/setsid.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/setsid.c - done setsid.o generated - make fcntl.o - make comp/fcntl.c - prev include/error.h - prev ast_tty.h - prev include/ls.h - prev include/ast.h - done comp/fcntl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/fcntl.c - done fcntl.o generated - make open.o - make comp/open.c - prev ast_tty.h - prev include/error.h - prev include/ls.h - prev include/ast.h - done comp/open.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/open.c - done open.o generated - make atexit.o - make comp/atexit.c - prev include/ast.h - done comp/atexit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/atexit.c - done atexit.o generated - make getdents.o - make dir/getdents.c - prev dir/dirlib.h - done dir/getdents.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c dir/getdents.c - done getdents.o generated - make getwd.o - make comp/getwd.c - prev include/ast.h - done comp/getwd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getwd.c - done getwd.o generated - make dup2.o - make comp/dup2.c - prev include/error.h - prev include/ast.h - done comp/dup2.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/dup2.c - done dup2.o generated - make errno.o - make comp/errno.c - prev include/ast.h - done comp/errno.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/errno.c - done errno.o generated - make getgroups.o - make comp/getgroups.c - prev include/error.h - prev include/ast.h - done comp/getgroups.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getgroups.c - done getgroups.o generated - make mount.o - make comp/mount.c - prev include/error.h - prev include/ast.h - done comp/mount.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mount.c - done mount.o generated - make system.o - make comp/system.c - prev ast_map.h - prev include/proc.h - prev include/ast.h - done comp/system.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/system.c - done system.o generated - make iblocks.o - make port/iblocks.c - prev include/ls.h - prev ast_param.h - prev include/ast.h - done port/iblocks.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/iblocks.c - done iblocks.o generated - make modedata.o - make string/modedata.c - prev string/modelib.h - done string/modedata.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Istring -Iinclude -Istd -c string/modedata.c - done modedata.o generated - make tmdata.o - make tm/tmdata.c - prev include/tm.h - prev include/ast.h - done tm/tmdata.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c tm/tmdata.c - done tmdata.o generated - make memfatal.o - make disc/memfatal.c - prev FEATURE/vmalloc - prev include/vmalloc.h + prev sfio/sfhdr.h + done + prev include/ast.h + done + exec - compile ${<} -Iport -Isfio + done + + make strtold.o + make comp/strtold.c + prev sfio/sfstrtof.h + prev include/ast.h + prev ast_sys.h + prev ast_lib.h + prev ast_common.h + done + exec - compile ${<} -Iport -Isfio + done + + make strtol.o + make comp/strtol.c + make string/strtoi.h implicit + prev sfio/sfhdr.h prev include/error.h prev include/ast.h - done disc/memfatal.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c disc/memfatal.c - done memfatal.o generated - make sfkeyprintf.o - make disc/sfkeyprintf.c - prev ast_api.h - prev include/regex.h - make include/sfdisc.h implicit - prev include/ast.h - done include/sfdisc.h - prev include/ccode.h - prev include/ast.h - done disc/sfkeyprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c disc/sfkeyprintf.c - done sfkeyprintf.o generated - make sfdcdio.o - make disc/sfdcdio.c - make disc/sfdchdr.h implicit - prev include/sfdisc.h - prev sfio/sfhdr.h - done disc/sfdchdr.h - done disc/sfdcdio.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcdio.c - done sfdcdio.o generated - make sfdcdos.o - make disc/sfdcdos.c - prev disc/sfdchdr.h - done disc/sfdcdos.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcdos.c - done sfdcdos.o generated - make sfdcfilter.o - make disc/sfdcfilter.c - prev disc/sfdchdr.h - done disc/sfdcfilter.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcfilter.c - done sfdcfilter.o generated - make sfdcseekable.o - make disc/sfdcseekable.c - prev disc/sfdchdr.h - done disc/sfdcseekable.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcseekable.c - done sfdcseekable.o generated - make sfdcslow.o - make disc/sfdcslow.c - prev disc/sfdchdr.h - done disc/sfdcslow.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcslow.c - done sfdcslow.o generated - make sfdcsubstr.o - make disc/sfdcsubstr.c - prev disc/sfdchdr.h - done disc/sfdcsubstr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcsubstr.c - done sfdcsubstr.o generated - make sfdctee.o - make disc/sfdctee.c - prev disc/sfdchdr.h - done disc/sfdctee.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdctee.c - done sfdctee.o generated - make sfdcunion.o - make disc/sfdcunion.c - prev disc/sfdchdr.h - done disc/sfdcunion.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcunion.c - done sfdcunion.o generated - make sfdcmore.o - make disc/sfdcmore.c - prev ast_tty.h - prev disc/sfdchdr.h - done disc/sfdcmore.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcmore.c - done sfdcmore.o generated - make sfdcprefix.o - make disc/sfdcprefix.c - prev disc/sfdchdr.h - done disc/sfdcprefix.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idisc -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c disc/sfdcprefix.c - done sfdcprefix.o generated - make wc.o - make comp/wc.c + done + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strtoll.o + make comp/strtoll.c + prev string/strtoi.h + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strtoul.o + make comp/strtoul.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strtoull.o + make comp/strtoull.c + prev string/strtoi.h + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strton.o + make string/strton.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strtonll.o + make string/strtonll.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntod.o + make string/strntod.c + prev sfio/sfstrtof.h + prev include/ast.h + done + exec - compile ${<} -Iport -Isfio + done + + make strntold.o + make string/strntold.c + prev sfio/sfstrtof.h + prev include/ast.h + done + exec - compile ${<} -Iport -Isfio + done + + make strnton.o + make string/strnton.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntonll.o + make string/strntonll.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntol.o + make string/strntol.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntoll.o + make string/strntoll.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntoul.o + make string/strntoul.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strntoull.o + make string/strntoull.c + prev string/strtoi.h + done + exec - compile ${<} -Iport -Isfio -Istring + done + + make strcasecmp.o + make comp/strcasecmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make strncasecmp.o + make comp/strncasecmp.c + prev include/ast.h + done + exec - compile ${<} + done + + make strerror.o + make string/strerror.c + make FEATURE/errno implicit + prev features/errno + exec - invoke_iffe ${<} + done + prev port/lclib.h + done + exec - compile ${<} -Iport + done + + make mktemp.o + make comp/mktemp.c + prev ast_map.h + prev std/stdio.h + prev include/ast.h + done + exec - compile ${<} + done + + make tmpnam.o + make comp/tmpnam.c + prev ast_map.h + prev std/stdio.h + prev include/ast.h + done + exec - compile ${<} + done + + make fsync.o + make comp/fsync.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make execlp.o + make comp/execlp.c + prev include/ast.h + prev ast_lib.h + done + exec - compile ${<} + done + + make execve.o + make comp/execve.c + prev include/error.h + prev include/wait.h + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make execvp.o + make comp/execvp.c + prev include/ast.h + prev ast_lib.h + done + exec - compile ${<} + done + + make execvpe.o + make comp/execvpe.c + prev include/ast.h + prev ast_lib.h + done + exec - compile ${<} + done + + make spawnveg.o + make comp/spawnveg.c + prev ast_tty.h + prev sig.h + prev include/wait.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make killpg.o + make comp/killpg.c + prev sig.h + prev include/ast.h + done + exec - compile ${<} + done + + make getlogin.o + make comp/getlogin.c + prev include/ast.h + done + exec - compile ${<} + done + + make putenv.o + make comp/putenv.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make setenv.o + make comp/setenv.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make unsetenv.o + make comp/unsetenv.c + prev ast_map.h + prev include/ast.h + done + exec - compile ${<} + done + + make lstat.o + make comp/lstat.c + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make statvfs.o + make comp/statvfs.c + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make eaccess.o + make comp/eaccess.c + prev FEATURE/eaccess + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make gross.o + make comp/gross.c + prev comp/gross_sgi.h implicit + prev FEATURE/hack + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make omitted.o + make comp/omitted.c + prev include/ast_windows.h + prev include/ls.h + make FEATURE/omitted implicit + prev features/omitted + exec - invoke_iffe ${<} + done + prev include/tm.h + prev include/error.h + prev ast_stdio.h + prev include/ast.h + prev FEATURE/float + done + exec - compile ${<} + done + + make getpgrp.o + make comp/getpgrp.c + prev include/ast_std.h + done + exec - compile ${<} + done + + make setpgid.o + make comp/setpgid.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make setsid.o + make comp/setsid.c + prev include/error.h + prev ast_tty.h + prev include/ast.h + done + exec - compile ${<} + done + + make fcntl.o + make comp/fcntl.c + prev include/error.h + prev ast_tty.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make open.o + make comp/open.c + prev ast_tty.h + prev include/error.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} + done + + make getdents.o + make dir/getdents.c + prev dir/dirlib.h + done + exec - compile ${<} -Idir + done + + make getwd.o + make comp/getwd.c + prev include/ast.h + done + exec - compile ${<} + done + + make dup2.o + make comp/dup2.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make errno.o + make comp/errno.c + prev include/ast.h + done + exec - compile ${<} + done + + make getgroups.o + make comp/getgroups.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make mount.o + make comp/mount.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make system.o + make comp/system.c + prev ast_map.h + prev include/proc.h + prev include/ast.h + done + exec - compile ${<} + done + + make iblocks.o + make port/iblocks.c + prev include/ls.h + prev ast_param.h + prev include/ast.h + done + exec - compile ${<} + done + + make modedata.o + make string/modedata.c + prev string/modelib.h + done + exec - compile ${<} -Istring + done + + make tmdata.o + make tm/tmdata.c + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make memfatal.o + make disc/memfatal.c + prev FEATURE/vmalloc + prev include/vmalloc.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make sfkeyprintf.o + make disc/sfkeyprintf.c + prev ast_api.h + prev include/regex.h + make include/sfdisc.h implicit + prev include/ast.h + done + prev include/ccode.h + prev include/ast.h + done + exec - compile ${<} + done + + make sfdcdio.o + make disc/sfdcdio.c + make disc/sfdchdr.h implicit + prev include/sfdisc.h + prev sfio/sfhdr.h + done + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcdos.o + make disc/sfdcdos.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcfilter.o + make disc/sfdcfilter.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcseekable.o + make disc/sfdcseekable.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcslow.o + make disc/sfdcslow.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcsubstr.o + make disc/sfdcsubstr.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdctee.o + make disc/sfdctee.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcunion.o + make disc/sfdcunion.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcmore.o + make disc/sfdcmore.c + prev ast_tty.h + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make sfdcprefix.o + make disc/sfdcprefix.c + prev disc/sfdchdr.h + done + exec - compile ${<} -Idisc -Iport -Isfio + done + + make wc.o + make comp/wc.c + prev std/wchar.h + prev include/ast.h + done + exec - compile ${<} + done + + make wc2utf8.o + make string/wc2utf8.c + prev include/ast.h + done + exec - compile ${<} + done + + make dirname.o + make comp/dirname.c + prev include/ast_std.h + done + exec - compile ${<} + done + + make fmtmsglib.o + make comp/fmtmsglib.c + prev comp/fmtmsg.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make fnmatch.o + make comp/fnmatch.c + make comp/fnmatch.h implicit + prev ast_common.h + done + prev include/regex.h + prev include/ast.h + prev ast_lib.h + done + exec - compile ${<} + done + + make ftw.o + make comp/ftw.c + make comp/ftw.h implicit + prev include/ftwalk.h + done + prev include/ast.h + done + exec - compile ${<} + done + + make getdate.o + make comp/getdate.c + prev ast_map.h + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make getsubopt.o + make comp/getsubopt.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make glob.o + make misc/glob.c + prev include/glob.h implicit + prev include/regex.h + prev include/error.h + prev include/ast_dir.h + prev include/stk.h + prev include/ls.h + prev include/ast.h + done + exec - compile ${<} -Idir + done + + make nftw.o + make comp/nftw.c + prev comp/ftw.h + prev include/ast.h + done + exec - compile ${<} + done + + make re_comp.o + make comp/re_comp.c + prev include/regex.h + prev comp/re_comp.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make resolvepath.o + make comp/resolvepath.c + prev ast_api.h + prev ast_map.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make regcmp.o + make comp/regcmp.c + prev align.h + prev include/regex.h + prev comp/libgen.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make regexp.o + make comp/regexp.c + prev align.h + prev include/regex.h + prev comp/regexp.h implicit + prev include/ast.h + done + exec - compile ${<} + done + + make strftime.o + make comp/strftime.c + prev ast_map.h + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make strptime.o + make comp/strptime.c + prev ast_map.h + prev tmx.h + prev include/ast.h + done + exec - compile ${<} + done + + make swab.o + make comp/swab.c + prev include/swap.h + prev include/ast.h + done + exec - compile ${<} + done + + make tempnam.o + make comp/tempnam.c + prev std/stdio.h + prev include/ast.h + prev include/ast_std.h + done + exec - compile ${<} + done + + make wordexp.o + make comp/wordexp.c + prev include/stk.h + make comp/wordexp.h implicit + prev ast_common.h + done + prev include/ast.h + done + exec - compile ${<} + done + + make mktime.o + make comp/mktime.c + prev ast_map.h + prev include/tm.h + prev include/ast.h + done + exec - compile ${<} + done + + make regalloc.o + make regex/regalloc.c + make regex/reglib.h implicit + prev std/wctype.h prev std/wchar.h - prev include/ast.h - done comp/wc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/wc.c - done wc.o generated - make wc2utf8.o - make string/wc2utf8.c - prev include/ast.h - done string/wc2utf8.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c string/wc2utf8.c - done wc2utf8.o generated - make basename.o - make comp/basename.c - prev include/ast_std.h - done comp/basename.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/basename.c - done basename.o generated - make closelog.o - make comp/closelog.c - make comp/sysloglib.h implicit - make comp/syslog.h implicit - make ast_namval.h implicit - prev include/namval.h - exec - ${STDCMP} -s include/namval.h ast_namval.h || { ${STDRM} -f ast_namval.h; ${STDCP} include/namval.h ast_namval.h; } - done ast_namval.h dontcare generated - done comp/syslog.h dontcare - done comp/sysloglib.h dontcare - prev include/ast.h - done comp/closelog.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/closelog.c - done closelog.o generated - make dirname.o - make comp/dirname.c - prev include/ast_std.h - done comp/dirname.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/dirname.c - done dirname.o generated - make fmtmsglib.o - make comp/fmtmsglib.c - prev comp/fmtmsg.h implicit dontcare - prev include/ast.h - done comp/fmtmsglib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/fmtmsglib.c - done fmtmsglib.o generated - make fnmatch.o - make comp/fnmatch.c - make comp/fnmatch.h implicit - prev ast_common.h - done comp/fnmatch.h - prev include/regex.h - prev include/ast.h - prev ast_lib.h - done comp/fnmatch.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/fnmatch.c - done fnmatch.o generated - make ftw.o - make comp/ftw.c - make comp/ftw.h implicit - prev include/ftwalk.h - done comp/ftw.h - prev include/ast.h - done comp/ftw.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/ftw.c - done ftw.o generated - make getdate.o - make comp/getdate.c - prev ast_map.h - prev include/tm.h - prev include/ast.h - done comp/getdate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getdate.c - done getdate.o generated - make getsubopt.o - make comp/getsubopt.c - prev include/error.h - prev include/ast.h - done comp/getsubopt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getsubopt.c - done getsubopt.o generated - make glob.o - make misc/glob.c - prev include/glob.h implicit - prev include/regex.h - prev include/error.h - prev include/ast_dir.h - prev include/stk.h - prev include/ls.h - prev include/ast.h - done misc/glob.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Idir -Iinclude -Istd -c misc/glob.c - done glob.o generated - make nftw.o - make comp/nftw.c - prev comp/ftw.h - prev include/ast.h - done comp/nftw.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/nftw.c - done nftw.o generated - make openlog.o - make comp/openlog.c - prev comp/sysloglib.h - prev include/ast.h - done comp/openlog.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/openlog.c - done openlog.o generated - make re_comp.o - make comp/re_comp.c - prev include/regex.h - prev comp/re_comp.h implicit - prev include/ast.h - done comp/re_comp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/re_comp.c - done re_comp.o generated - make resolvepath.o - make comp/resolvepath.c - prev ast_api.h - prev ast_map.h - prev include/error.h - prev include/ast.h - done comp/resolvepath.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/resolvepath.c - done resolvepath.o generated - make realpath.o - make comp/realpath.c - prev ast_map.h - prev include/ast.h - done comp/realpath.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/realpath.c - done realpath.o generated - make regcmp.o - make comp/regcmp.c - prev align.h - prev include/regex.h - prev comp/libgen.h implicit - prev include/ast.h - done comp/regcmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/regcmp.c - done regcmp.o generated - make regexp.o - make comp/regexp.c - prev align.h - prev include/regex.h - prev comp/regexp.h implicit - prev include/ast.h - done comp/regexp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/regexp.c - done regexp.o generated - make setlogmask.o - make comp/setlogmask.c - prev comp/sysloglib.h - prev include/ast.h - done comp/setlogmask.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/setlogmask.c - done setlogmask.o generated - make strftime.o - make comp/strftime.c - prev ast_map.h - prev include/tm.h - prev include/ast.h - done comp/strftime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strftime.c - done strftime.o generated - make strptime.o - make comp/strptime.c - prev ast_map.h - prev tmx.h - prev include/ast.h - done comp/strptime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/strptime.c - done strptime.o generated - make swab.o - make comp/swab.c - prev include/swap.h - prev include/ast.h - done comp/swab.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/swab.c - done swab.o generated - make syslog.o - make comp/syslog.c - prev std/endian.h - prev include/ls.h - prev include/tm.h - prev include/error.h - prev comp/sysloglib.h - prev include/ast.h - done comp/syslog.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/syslog.c - done syslog.o generated - make tempnam.o - make comp/tempnam.c prev std/stdio.h - prev include/ast.h - prev include/ast_std.h - done comp/tempnam.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/tempnam.c - done tempnam.o generated - make wordexp.o - make comp/wordexp.c + prev include/regex.h prev include/stk.h - make comp/wordexp.h implicit - prev ast_common.h - done comp/wordexp.h - prev include/ast.h - done comp/wordexp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/wordexp.c - done wordexp.o generated - make mktime.o - make comp/mktime.c - prev ast_map.h - prev include/tm.h + prev include/cdt.h prev include/ast.h - done comp/mktime.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/mktime.c - done mktime.o generated - make regalloc.o - make regex/regalloc.c - make regex/reglib.h implicit - prev std/wctype.h - prev std/wchar.h - prev std/stdio.h - prev include/regex.h - prev include/stk.h + done + done + exec - compile ${<} -Iregex + done + + make regclass.o + make regex/regclass.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regcoll.o + make regex/regcoll.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regcomp.o + make regex/regcomp.c + prev port/lclib.h + prev regex/reglib.h + done + exec - compile ${<} -Iport -Iregex + done + + make regcache.o + make regex/regcache.c + prev include/regex.h + prev include/ast.h + done + exec - compile ${<} + done + + make regdecomp.o + make regex/regdecomp.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regerror.o + make regex/regerror.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regexec.o + make regex/regexec.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regfatal.o + make regex/regfatal.c + prev include/error.h + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make reginit.o + make regex/reginit.c + prev include/ccode.h + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regnexec.o + make regex/regnexec.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regsubcomp.o + make regex/regsubcomp.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regsubexec.o + make regex/regsubexec.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regsub.o + make regex/regsub.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regrecord.o + make regex/regrecord.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regrexec.o + make regex/regrexec.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make regstat.o + make regex/regstat.c + prev regex/reglib.h + done + exec - compile ${<} -Iregex + done + + make dtclose.o + make cdt/dtclose.c + make cdt/dthdr.h implicit + make cdt/cdtlib.h implicit + prev include/debug.h + make include/aso.h implicit + prev ast_common.h + done prev include/cdt.h prev include/ast.h - done regex/reglib.h - done regex/regalloc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regalloc.c - done regalloc.o generated - make regclass.o - make regex/regclass.c - prev regex/reglib.h - done regex/regclass.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regclass.c - done regclass.o generated - make regcoll.o - make regex/regcoll.c - prev regex/reglib.h - done regex/regcoll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regcoll.c - done regcoll.o generated - make regcomp.o - make regex/regcomp.c - prev port/lclib.h - prev regex/reglib.h - done regex/regcomp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Icomp -Iport -Iregex -Iinclude -Istd -I${INSTALLROOT}/include -c regex/regcomp.c - done regcomp.o generated - make regcache.o - make regex/regcache.c - prev include/regex.h - prev include/ast.h - done regex/regcache.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c regex/regcache.c - done regcache.o generated - make regdecomp.o - make regex/regdecomp.c - prev regex/reglib.h - done regex/regdecomp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regdecomp.c - done regdecomp.o generated - make regerror.o - make regex/regerror.c - prev regex/reglib.h - done regex/regerror.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regerror.c - done regerror.o generated - make regexec.o - make regex/regexec.c - prev regex/reglib.h - done regex/regexec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regexec.c - done regexec.o generated - make regfatal.o - make regex/regfatal.c - prev include/error.h - prev regex/reglib.h - done regex/regfatal.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regfatal.c - done regfatal.o generated - make reginit.o - make regex/reginit.c - prev include/ccode.h - prev regex/reglib.h - done regex/reginit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/reginit.c - done reginit.o generated - make regnexec.o - make regex/regnexec.c - prev regex/reglib.h - done regex/regnexec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regnexec.c - done regnexec.o generated - make regsubcomp.o - make regex/regsubcomp.c - prev regex/reglib.h - done regex/regsubcomp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regsubcomp.c - done regsubcomp.o generated - make regsubexec.o - make regex/regsubexec.c - prev regex/reglib.h - done regex/regsubexec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regsubexec.c - done regsubexec.o generated - make regsub.o - make regex/regsub.c - prev regex/reglib.h - done regex/regsub.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regsub.c - done regsub.o generated - make regrecord.o - make regex/regrecord.c - prev regex/reglib.h - done regex/regrecord.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regrecord.c - done regrecord.o generated - make regrexec.o - make regex/regrexec.c - prev regex/reglib.h - done regex/regrexec.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regrexec.c - done regrexec.o generated - make regstat.o - make regex/regstat.c - prev regex/reglib.h - done regex/regstat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iregex -Iinclude -Istd -c regex/regstat.c - done regstat.o generated - make dtclose.o - make cdt/dtclose.c - make cdt/dthdr.h implicit - make cdt/cdtlib.h implicit - prev include/debug.h - make include/aso.h implicit - prev ast_common.h - done include/aso.h - prev include/cdt.h - prev ${INSTALLROOT}/include/ast/dlldefs.h implicit dontcare - prev include/ast.h - done cdt/cdtlib.h dontcare - done cdt/dthdr.h dontcare - done cdt/dtclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtclose.c - done dtclose.o generated - make dtdisc.o - make cdt/dtdisc.c - prev cdt/dthdr.h - done cdt/dtdisc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtdisc.c - done dtdisc.o generated - make dthash.o - make cdt/dthash.c - prev cdt/dthdr.h - done cdt/dthash.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dthash.c - done dthash.o generated - make dtlist.o - make cdt/dtlist.c - prev cdt/dthdr.h - done cdt/dtlist.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtlist.c - done dtlist.o generated - make dtmethod.o - make cdt/dtmethod.c - prev cdt/dthdr.h - done cdt/dtmethod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtmethod.c - done dtmethod.o generated - make dtopen.o - make cdt/dtopen.c - prev cdt/dthdr.h - done cdt/dtopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtopen.c - done dtopen.o generated - make dtstat.o - make cdt/dtstat.c - prev cdt/dthdr.h - done cdt/dtstat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtstat.c - done dtstat.o generated - make dtstrhash.o - make cdt/dtstrhash.c - prev cdt/dthdr.h - done cdt/dtstrhash.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtstrhash.c - done dtstrhash.o generated - make dttree.o - make cdt/dttree.c - prev cdt/dthdr.h - done cdt/dttree.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dttree.c - done dttree.o generated - make dtuser.o - make cdt/dtuser.c - prev cdt/dthdr.h - done cdt/dtuser.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtuser.c - done dtuser.o generated - make dtview.o - make cdt/dtview.c - prev cdt/dthdr.h - done cdt/dtview.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtview.c - done dtview.o generated - make dtwalk.o - make cdt/dtwalk.c - prev cdt/dthdr.h - done cdt/dtwalk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -c cdt/dtwalk.c - done dtwalk.o generated - make dtnew.o - make cdt/dtnew.c - prev include/dt.h - done cdt/dtnew.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c cdt/dtnew.c - done dtnew.o generated - make dtcomp.o - make cdt/dtcomp.c - prev include/cdt.h - done cdt/dtcomp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c cdt/dtcomp.c - done dtcomp.o generated - make sfclose.o - make sfio/sfclose.c - prev sfio/sfhdr.h - done sfio/sfclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfclose.c - done sfclose.o generated - make sfclrlock.o - make sfio/sfclrlock.c - prev sfio/sfhdr.h - done sfio/sfclrlock.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfclrlock.c - done sfclrlock.o generated - make sfdisc.o - make sfio/sfdisc.c - prev sfio/sfhdr.h - done sfio/sfdisc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfdisc.c - done sfdisc.o generated - make sfdlen.o - make sfio/sfdlen.c - prev sfio/sfhdr.h - done sfio/sfdlen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfdlen.c - done sfdlen.o generated - make sfexcept.o - make sfio/sfexcept.c - prev sfio/sfhdr.h - done sfio/sfexcept.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfexcept.c - done sfexcept.o generated - make sfgetl.o - make sfio/sfgetl.c - prev sfio/sfhdr.h - done sfio/sfgetl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfgetl.c - done sfgetl.o generated - make sfgetu.o - make sfio/sfgetu.c - prev sfio/sfhdr.h - done sfio/sfgetu.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfgetu.c - done sfgetu.o generated - make sfcvt.o - make sfio/sfcvt.c - prev sfio/sfhdr.h - prev FEATURE/standards - done sfio/sfcvt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfcvt.c - done sfcvt.o generated - make sfecvt.o - make sfio/sfecvt.c - prev sfio/sfhdr.h - done sfio/sfecvt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfecvt.c - done sfecvt.o generated - make sffcvt.o - make sfio/sffcvt.c - prev sfio/sfhdr.h - done sfio/sffcvt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sffcvt.c - done sffcvt.o generated - make sfextern.o - make sfio/sfextern.c - prev sfio/sfhdr.h - done sfio/sfextern.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfextern.c - done sfextern.o generated - make sffilbuf.o - make sfio/sffilbuf.c - prev sfio/sfhdr.h - done sfio/sffilbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sffilbuf.c - done sffilbuf.o generated - make sfflsbuf.o - make sfio/sfflsbuf.c - prev sfio/sfhdr.h - done sfio/sfflsbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfflsbuf.c - done sfflsbuf.o generated - make sfprints.o - make sfio/sfprints.c - prev sfio/sfhdr.h - done sfio/sfprints.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfprints.c - done sfprints.o generated - make sfgetd.o - make sfio/sfgetd.c - prev sfio/sfhdr.h - done sfio/sfgetd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfgetd.c - done sfgetd.o generated - make sfgetr.o - make sfio/sfgetr.c - prev sfio/sfhdr.h - done sfio/sfgetr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfgetr.c - done sfgetr.o generated - make sfllen.o - make sfio/sfllen.c - prev sfio/sfhdr.h - done sfio/sfllen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfllen.c - done sfllen.o generated - make sfmode.o - make sfio/sfmode.c - prev include/wait.h - prev sig.h - prev sfio/sfhdr.h - done sfio/sfmode.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfmode.c - done sfmode.o generated - make sfmove.o - make sfio/sfmove.c - prev sfio/sfhdr.h - done sfio/sfmove.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfmove.c - done sfmove.o generated - make sfnew.o - make sfio/sfnew.c - prev sfio/sfhdr.h - done sfio/sfnew.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfnew.c - done sfnew.o generated - make sfpkrd.o - make sfio/sfpkrd.c - prev sfio/sfhdr.h - done sfio/sfpkrd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpkrd.c - done sfpkrd.o generated - make sfnotify.o - make sfio/sfnotify.c - prev sfio/sfhdr.h - done sfio/sfnotify.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfnotify.c - done sfnotify.o generated - make sfnputc.o - make sfio/sfnputc.c - prev sfio/sfhdr.h - done sfio/sfnputc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfnputc.c - done sfnputc.o generated - make sfopen.o - make sfio/sfopen.c - prev sfio/sfhdr.h - done sfio/sfopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfopen.c - done sfopen.o generated - make sfpeek.o - make sfio/sfpeek.c - prev sfio/sfhdr.h - done sfio/sfpeek.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpeek.c - done sfpeek.o generated - make sfpoll.o - make sfio/sfpoll.c - prev sfio/sfhdr.h - done sfio/sfpoll.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpoll.c - done sfpoll.o generated - make sfpool.o - make sfio/sfpool.c - prev sfio/sfhdr.h - done sfio/sfpool.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpool.c - done sfpool.o generated - make sfpopen.o - make sfio/sfpopen.c - prev include/proc.h - prev sfio/sfhdr.h - done sfio/sfpopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpopen.c - done sfpopen.o generated - make sfprintf.o - make sfio/sfprintf.c - prev sfio/sfhdr.h - done sfio/sfprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${CCFLAGS.FORCE} ${mam_cc_NOPROTECT} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfprintf.c - done sfprintf.o generated - make sfputd.o - make sfio/sfputd.c - prev sfio/sfhdr.h - done sfio/sfputd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfputd.c - done sfputd.o generated - make sfputl.o - make sfio/sfputl.c - prev sfio/sfhdr.h - done sfio/sfputl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfputl.c - done sfputl.o generated - make sfputr.o - make sfio/sfputr.c - prev sfio/sfhdr.h - done sfio/sfputr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfputr.c - done sfputr.o generated - make sfputu.o - make sfio/sfputu.c - prev sfio/sfhdr.h - done sfio/sfputu.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfputu.c - done sfputu.o generated - make sfrd.o - make sfio/sfrd.c - prev sfio/sfhdr.h - done sfio/sfrd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfrd.c - done sfrd.o generated - make sfread.o - make sfio/sfread.c - prev sfio/sfhdr.h - done sfio/sfread.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfread.c - done sfread.o generated - make sfreserve.o - make sfio/sfreserve.c - prev sfio/sfhdr.h - done sfio/sfreserve.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfreserve.c - done sfreserve.o generated - make sfscanf.o - make sfio/sfscanf.c - prev sfio/sfhdr.h - done sfio/sfscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${CCFLAGS.FORCE} ${mam_cc_NOPROTECT} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfscanf.c - done sfscanf.o generated - make sfseek.o - make sfio/sfseek.c - prev sfio/sfhdr.h - done sfio/sfseek.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfseek.c - done sfseek.o generated - make sfset.o - make sfio/sfset.c - prev sfio/sfhdr.h - done sfio/sfset.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfset.c - done sfset.o generated - make sfsetbuf.o - make sfio/sfsetbuf.c - prev sfio/sfhdr.h - done sfio/sfsetbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfsetbuf.c - done sfsetbuf.o generated - make sfsetfd.o - make sfio/sfsetfd.c - prev sfio/sfhdr.h - done sfio/sfsetfd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfsetfd.c - done sfsetfd.o generated - make sfsize.o - make sfio/sfsize.c - prev sfio/sfhdr.h - done sfio/sfsize.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfsize.c - done sfsize.o generated - make sfsk.o - make sfio/sfsk.c - prev sfio/sfhdr.h - done sfio/sfsk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfsk.c - done sfsk.o generated - make sfstack.o - make sfio/sfstack.c - prev sfio/sfhdr.h - done sfio/sfstack.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfstack.c - done sfstack.o generated - make sfstrtod.o - make sfio/sfstrtod.c - prev sfio/sfhdr.h - done sfio/sfstrtod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfstrtod.c - done sfstrtod.o generated - make sfsync.o - make sfio/sfsync.c - prev sfio/sfhdr.h - done sfio/sfsync.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfsync.c - done sfsync.o generated - make sfswap.o - make sfio/sfswap.c - prev sfio/sfhdr.h - done sfio/sfswap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfswap.c - done sfswap.o generated - make sftable.o - make sfio/sftable.c - make FEATURE/sfinit implicit - make features/sfinit.c - prev FEATURE/float - prev FEATURE/common - done features/sfinit.c - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd ${LDFLAGS}" run features/sfinit.c - done FEATURE/sfinit generated - prev FEATURE/float - prev sfio/sfhdr.h - done sfio/sftable.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sftable.c - done sftable.o generated - make sftell.o - make sfio/sftell.c - prev sfio/sfhdr.h - done sfio/sftell.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sftell.c - done sftell.o generated - make sftmp.o - make sfio/sftmp.c - prev sfio/sfhdr.h - done sfio/sftmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sftmp.c - done sftmp.o generated - make sfungetc.o - make sfio/sfungetc.c - prev sfio/sfhdr.h - done sfio/sfungetc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfungetc.c - done sfungetc.o generated - make sfvprintf.o - make sfio/sfvprintf.c - prev include/ccode.h - prev sfio/sfhdr.h - done sfio/sfvprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${mam_cc_NOPROTECT} ${DEBUG+-DDEBUG=${DEBUG}} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfvprintf.c - done sfvprintf.o generated - make sfvscanf.o - make sfio/sfvscanf.c - prev sfio/sfstrtof.h - prev sfio/sfhdr.h - done sfio/sfvscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${CCFLAGS.FORCE} ${mam_cc_NOPROTECT} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfvscanf.c - done sfvscanf.o generated - make sfwr.o - make sfio/sfwr.c - prev sfio/sfhdr.h - done sfio/sfwr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfwr.c - done sfwr.o generated - make sfwrite.o - make sfio/sfwrite.c - prev sfio/sfhdr.h - done sfio/sfwrite.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfwrite.c - done sfwrite.o generated - make sfpurge.o - make sfio/sfpurge.c - prev sfio/sfhdr.h - done sfio/sfpurge.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfpurge.c - done sfpurge.o generated - make sfraise.o - make sfio/sfraise.c - prev sfio/sfhdr.h - done sfio/sfraise.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfraise.c - done sfraise.o generated - make sfwalk.o - make sfio/sfwalk.c - prev sfio/sfhdr.h - done sfio/sfwalk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfwalk.c - done sfwalk.o generated - make sfgetm.o - make sfio/sfgetm.c - prev sfio/sfhdr.h - done sfio/sfgetm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfgetm.c - done sfgetm.o generated - make sfputm.o - make sfio/sfputm.c - prev sfio/sfhdr.h - done sfio/sfputm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfputm.c - done sfputm.o generated - make sfresize.o - make sfio/sfresize.c - prev sfio/sfhdr.h - done sfio/sfresize.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/sfresize.c - done sfresize.o generated - make _sfclrerr.o - make sfio/_sfclrerr.c - prev sfio/sfhdr.h - done sfio/_sfclrerr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfclrerr.c - done _sfclrerr.o generated - make _sfeof.o - make sfio/_sfeof.c - prev sfio/sfhdr.h - done sfio/_sfeof.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfeof.c - done _sfeof.o generated - make _sferror.o - make sfio/_sferror.c - prev sfio/sfhdr.h - done sfio/_sferror.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sferror.c - done _sferror.o generated - make _sffileno.o - make sfio/_sffileno.c - prev sfio/sfhdr.h - done sfio/_sffileno.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sffileno.c - done _sffileno.o generated - make _sfopen.o - make sfio/_sfopen.c - prev sfio/sfhdr.h - done sfio/_sfopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfopen.c - done _sfopen.o generated - make _sfstacked.o - make sfio/_sfstacked.c - prev sfio/sfhdr.h - done sfio/_sfstacked.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfstacked.c - done _sfstacked.o generated - make _sfvalue.o - make sfio/_sfvalue.c - prev sfio/sfhdr.h - done sfio/_sfvalue.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfvalue.c - done _sfvalue.o generated - make _sfgetc.o - make sfio/_sfgetc.c - prev sfio/sfhdr.h - done sfio/_sfgetc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfgetc.c - done _sfgetc.o generated - make _sfgetl.o - make sfio/_sfgetl.c - prev sfio/sfhdr.h - done sfio/_sfgetl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfgetl.c - done _sfgetl.o generated - make _sfgetl2.o - make sfio/_sfgetl2.c - prev sfio/sfhdr.h - done sfio/_sfgetl2.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfgetl2.c - done _sfgetl2.o generated - make _sfgetu.o - make sfio/_sfgetu.c - prev sfio/sfhdr.h - done sfio/_sfgetu.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfgetu.c - done _sfgetu.o generated - make _sfgetu2.o - make sfio/_sfgetu2.c - prev sfio/sfhdr.h - done sfio/_sfgetu2.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfgetu2.c - done _sfgetu2.o generated - make _sfdlen.o - make sfio/_sfdlen.c - prev sfio/sfhdr.h - done sfio/_sfdlen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfdlen.c - done _sfdlen.o generated - make _sfllen.o - make sfio/_sfllen.c - prev sfio/sfhdr.h - done sfio/_sfllen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfllen.c - done _sfllen.o generated - make _sfslen.o - make sfio/_sfslen.c - prev sfio/sfhdr.h - done sfio/_sfslen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfslen.c - done _sfslen.o generated - make _sfulen.o - make sfio/_sfulen.c - prev sfio/sfhdr.h - done sfio/_sfulen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfulen.c - done _sfulen.o generated - make _sfputc.o - make sfio/_sfputc.c - prev sfio/sfhdr.h - done sfio/_sfputc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfputc.c - done _sfputc.o generated - make _sfputd.o - make sfio/_sfputd.c - prev sfio/sfhdr.h - done sfio/_sfputd.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfputd.c - done _sfputd.o generated - make _sfputl.o - make sfio/_sfputl.c - prev sfio/sfhdr.h - done sfio/_sfputl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfputl.c - done _sfputl.o generated - make _sfputm.o - make sfio/_sfputm.c - prev sfio/sfhdr.h - done sfio/_sfputm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfputm.c - done _sfputm.o generated - make _sfputu.o - make sfio/_sfputu.c - prev sfio/sfhdr.h - done sfio/_sfputu.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c sfio/_sfputu.c - done _sfputu.o generated - make clearerr.o - make stdio/clearerr.c - make stdio/stdhdr.h implicit - prev std/stdio.h - prev sfio/sfhdr.h - prev ast_standards.h - done stdio/stdhdr.h - done stdio/clearerr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/clearerr.c - done clearerr.o generated - make fclose.o - make stdio/fclose.c - prev stdio/stdhdr.h - done stdio/fclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fclose.c - done fclose.o generated - make fdopen.o - make stdio/fdopen.c - prev stdio/stdhdr.h - done stdio/fdopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fdopen.c - done fdopen.o generated - make fflush.o - make stdio/fflush.c - prev stdio/stdhdr.h - done stdio/fflush.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fflush.c - done fflush.o generated - make fgetc.o - make stdio/fgetc.c - prev stdio/stdhdr.h - done stdio/fgetc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fgetc.c - done fgetc.o generated - make fgetpos.o - make stdio/fgetpos.c - prev stdio/stdhdr.h - done stdio/fgetpos.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fgetpos.c - done fgetpos.o generated - make fgets.o - make stdio/fgets.c - prev stdio/stdhdr.h - done stdio/fgets.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fgets.c - done fgets.o generated - make fopen.o - make stdio/fopen.c - prev stdio/stdhdr.h - done stdio/fopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fopen.c - done fopen.o generated - make fprintf.o - make stdio/fprintf.c - prev stdio/stdhdr.h - done stdio/fprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fprintf.c - done fprintf.o generated - make fpurge.o - make stdio/fpurge.c - prev stdio/stdhdr.h - done stdio/fpurge.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fpurge.c - done fpurge.o generated - make fputs.o - make stdio/fputs.c - prev stdio/stdhdr.h - done stdio/fputs.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fputs.c - done fputs.o generated - make fread.o - make stdio/fread.c - prev stdio/stdhdr.h - done stdio/fread.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fread.c - done fread.o generated - make freopen.o - make stdio/freopen.c - prev stdio/stdhdr.h - done stdio/freopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/freopen.c - done freopen.o generated - make fscanf.o - make stdio/fscanf.c - prev stdio/stdhdr.h - done stdio/fscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fscanf.c - done fscanf.o generated - make fseek.o - make stdio/fseek.c - prev stdio/stdhdr.h - done stdio/fseek.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fseek.c - done fseek.o generated - make fseeko.o - make stdio/fseeko.c - prev stdio/stdhdr.h - done stdio/fseeko.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fseeko.c - done fseeko.o generated - make fsetpos.o - make stdio/fsetpos.c - prev stdio/stdhdr.h - done stdio/fsetpos.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fsetpos.c - done fsetpos.o generated - make ftell.o - make stdio/ftell.c - prev stdio/stdhdr.h - done stdio/ftell.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/ftell.c - done ftell.o generated - make ftello.o - make stdio/ftello.c - prev stdio/stdhdr.h - done stdio/ftello.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/ftello.c - done ftello.o generated - make fwrite.o - make stdio/fwrite.c - prev stdio/stdhdr.h - done stdio/fwrite.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fwrite.c - done fwrite.o generated - make getw.o - make stdio/getw.c - prev stdio/stdhdr.h - done stdio/getw.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/getw.c - done getw.o generated - make pclose.o - make stdio/pclose.c - prev stdio/stdhdr.h - done stdio/pclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/pclose.c - done pclose.o generated - make popen.o - make stdio/popen.c - prev stdio/stdhdr.h - done stdio/popen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/popen.c - done popen.o generated - make printf.o - make stdio/printf.c - prev stdio/stdhdr.h - done stdio/printf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/printf.c - done printf.o generated - make putchar.o - make stdio/putchar.c - prev stdio/stdhdr.h - done stdio/putchar.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/putchar.c - done putchar.o generated - make puts.o - make stdio/puts.c - prev stdio/stdhdr.h - done stdio/puts.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/puts.c - done puts.o generated - make putw.o - make stdio/putw.c - prev stdio/stdhdr.h - done stdio/putw.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/putw.c - done putw.o generated - make rewind.o - make stdio/rewind.c - prev stdio/stdhdr.h - done stdio/rewind.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/rewind.c - done rewind.o generated - make scanf.o - make stdio/scanf.c - prev stdio/stdhdr.h - done stdio/scanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/scanf.c - done scanf.o generated - make setbuf.o - make stdio/setbuf.c - prev stdio/stdhdr.h - done stdio/setbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/setbuf.c - done setbuf.o generated - make setbuffer.o - make stdio/setbuffer.c - prev stdio/stdhdr.h - done stdio/setbuffer.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/setbuffer.c - done setbuffer.o generated - make setlinebuf.o - make stdio/setlinebuf.c - prev stdio/stdhdr.h - done stdio/setlinebuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/setlinebuf.c - done setlinebuf.o generated - make setvbuf.o - make stdio/setvbuf.c - prev stdio/stdhdr.h - done stdio/setvbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/setvbuf.c - done setvbuf.o generated - make snprintf.o - make stdio/snprintf.c - prev stdio/stdhdr.h - done stdio/snprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/snprintf.c - done snprintf.o generated - make sprintf.o - make stdio/sprintf.c - prev stdio/stdhdr.h - done stdio/sprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/sprintf.c - done sprintf.o generated - make sscanf.o - make stdio/sscanf.c - prev stdio/stdhdr.h - done stdio/sscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/sscanf.c - done sscanf.o generated - make asprintf.o - make stdio/asprintf.c - prev stdio/stdhdr.h - done stdio/asprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/asprintf.c - done asprintf.o generated - make vasprintf.o - make stdio/vasprintf.c - prev stdio/stdhdr.h - done stdio/vasprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vasprintf.c - done vasprintf.o generated - make tmpfile.o - make stdio/tmpfile.c - prev stdio/stdhdr.h - done stdio/tmpfile.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/tmpfile.c - done tmpfile.o generated - make ungetc.o - make stdio/ungetc.c - prev stdio/stdhdr.h - done stdio/ungetc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/ungetc.c - done ungetc.o generated - make vfprintf.o - make stdio/vfprintf.c - prev stdio/stdhdr.h - done stdio/vfprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vfprintf.c - done vfprintf.o generated - make vfscanf.o - make stdio/vfscanf.c - prev stdio/stdhdr.h - done stdio/vfscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vfscanf.c - done vfscanf.o generated - make vprintf.o - make stdio/vprintf.c - prev stdio/stdhdr.h - done stdio/vprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vprintf.c - done vprintf.o generated - make vscanf.o - make stdio/vscanf.c - prev stdio/stdhdr.h - done stdio/vscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vscanf.c - done vscanf.o generated - make vsnprintf.o - make stdio/vsnprintf.c - prev stdio/stdhdr.h - done stdio/vsnprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vsnprintf.c - done vsnprintf.o generated - make vsprintf.o - make stdio/vsprintf.c - prev stdio/stdhdr.h - done stdio/vsprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vsprintf.c - done vsprintf.o generated - make vsscanf.o - make stdio/vsscanf.c - prev stdio/stdhdr.h - done stdio/vsscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vsscanf.c - done vsscanf.o generated - make _doprnt.o - make stdio/_doprnt.c - prev stdio/stdhdr.h - done stdio/_doprnt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_doprnt.c - done _doprnt.o generated - make _doscan.o - make stdio/_doscan.c - prev stdio/stdhdr.h - done stdio/_doscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_doscan.c - done _doscan.o generated - make _filbuf.o - make stdio/_filbuf.c - prev stdio/stdhdr.h - done stdio/_filbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_filbuf.c - done _filbuf.o generated - make _flsbuf.o - make stdio/_flsbuf.c - prev stdio/stdhdr.h - done stdio/_flsbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_flsbuf.c - done _flsbuf.o generated - make _stdopen.o - make stdio/_stdopen.c - prev stdio/stdhdr.h - done stdio/_stdopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdopen.c - done _stdopen.o generated - make _stdprintf.o - make stdio/_stdprintf.c - prev stdio/stdhdr.h - done stdio/_stdprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdprintf.c - done _stdprintf.o generated - make _stdscanf.o - make stdio/_stdscanf.c - prev stdio/stdhdr.h - done stdio/_stdscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdscanf.c - done _stdscanf.o generated - make _stdsprnt.o - make stdio/_stdsprnt.c - prev stdio/stdhdr.h - done stdio/_stdsprnt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdsprnt.c - done _stdsprnt.o generated - make _stdvbuf.o - make stdio/_stdvbuf.c - prev stdio/stdhdr.h - done stdio/_stdvbuf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdvbuf.c - done _stdvbuf.o generated - make _stdvsnprnt.o - make stdio/_stdvsnprnt.c - prev stdio/stdhdr.h - done stdio/_stdvsnprnt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdvsnprnt.c - done _stdvsnprnt.o generated - make _stdvsprnt.o - make stdio/_stdvsprnt.c - prev stdio/stdhdr.h - done stdio/_stdvsprnt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdvsprnt.c - done _stdvsprnt.o generated - make _stdvsscn.o - make stdio/_stdvsscn.c - prev stdio/stdhdr.h - done stdio/_stdvsscn.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/_stdvsscn.c - done _stdvsscn.o generated - make fgetwc.o - make stdio/fgetwc.c - prev stdio/stdhdr.h - done stdio/fgetwc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fgetwc.c - done fgetwc.o generated - make fwprintf.o - make stdio/fwprintf.c - prev stdio/stdhdr.h - done stdio/fwprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fwprintf.c - done fwprintf.o generated - make putwchar.o - make stdio/putwchar.c - prev ast_wchar.h - prev stdio/stdhdr.h - done stdio/putwchar.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/putwchar.c - done putwchar.o generated - make vfwscanf.o - make stdio/vfwscanf.c - prev stdio/stdhdr.h - done stdio/vfwscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vfwscanf.c - done vfwscanf.o generated - make wprintf.o - make stdio/wprintf.c - prev stdio/stdhdr.h - done stdio/wprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/wprintf.c - done wprintf.o generated - make fgetws.o - make stdio/fgetws.c - prev stdio/stdhdr.h - done stdio/fgetws.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fgetws.c - done fgetws.o generated - make fwscanf.o - make stdio/fwscanf.c - prev stdio/stdhdr.h - done stdio/fwscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fwscanf.c - done fwscanf.o generated - make swprintf.o - make stdio/swprintf.c - prev stdio/stdhdr.h - done stdio/swprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/swprintf.c - done swprintf.o generated - make vswprintf.o - make stdio/vswprintf.c - prev stdio/stdhdr.h - done stdio/vswprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vswprintf.c - done vswprintf.o generated - make wscanf.o - make stdio/wscanf.c - prev stdio/stdhdr.h - done stdio/wscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/wscanf.c - done wscanf.o generated - make fputwc.o - make stdio/fputwc.c - prev stdio/stdhdr.h - done stdio/fputwc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fputwc.c - done fputwc.o generated - make getwc.o - make stdio/getwc.c - prev ast_wchar.h - prev stdio/stdhdr.h - done stdio/getwc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/getwc.c - done getwc.o generated - make swscanf.o - make stdio/swscanf.c - prev stdio/stdhdr.h - done stdio/swscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/swscanf.c - done swscanf.o generated - make vswscanf.o - make stdio/vswscanf.c - prev stdio/stdhdr.h - done stdio/vswscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vswscanf.c - done vswscanf.o generated - make fputws.o - make stdio/fputws.c - prev stdio/stdhdr.h - done stdio/fputws.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fputws.c - done fputws.o generated - make getwchar.o - make stdio/getwchar.c - prev ast_wchar.h - prev stdio/stdhdr.h - done stdio/getwchar.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/getwchar.c - done getwchar.o generated - make ungetwc.o - make stdio/ungetwc.c - prev stdio/stdhdr.h - done stdio/ungetwc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/ungetwc.c - done ungetwc.o generated - make vwprintf.o - make stdio/vwprintf.c - prev stdio/stdhdr.h - done stdio/vwprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vwprintf.c - done vwprintf.o generated - make fwide.o - make stdio/fwide.c - prev stdio/stdhdr.h - done stdio/fwide.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fwide.c - done fwide.o generated - make putwc.o - make stdio/putwc.c - prev ast_wchar.h - prev stdio/stdhdr.h - done stdio/putwc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/putwc.c - done putwc.o generated - make vfwprintf.o - make stdio/vfwprintf.c - prev stdio/stdhdr.h - done stdio/vfwprintf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vfwprintf.c - done vfwprintf.o generated - make vwscanf.o - make stdio/vwscanf.c - prev stdio/stdhdr.h - done stdio/vwscanf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/vwscanf.c - done vwscanf.o generated - make stdio_c99.o - make stdio/stdio_c99.c - prev stdio/stdhdr.h - done stdio/stdio_c99.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/stdio_c99.c - done stdio_c99.o generated - make fcloseall.o - make stdio/fcloseall.c - prev stdio/stdhdr.h - done stdio/fcloseall.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fcloseall.c - done fcloseall.o generated - make fmemopen.o - make stdio/fmemopen.c - prev stdio/stdhdr.h - done stdio/fmemopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/fmemopen.c - done fmemopen.o generated - make getdelim.o - make stdio/getdelim.c - prev stdio/stdhdr.h - done stdio/getdelim.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/getdelim.c - done getdelim.o generated - make getline.o - make stdio/getline.c - prev stdio/stdhdr.h - done stdio/getline.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -c stdio/getline.c - done getline.o generated - make frexp.o - make comp/frexp.c - prev FEATURE/float - prev include/ast.h - done comp/frexp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/frexp.c - done frexp.o generated - make frexpl.o - make comp/frexpl.c - prev FEATURE/float - prev include/ast.h - done comp/frexpl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/frexpl.c - done frexpl.o generated - make astcopy.o - make port/astcopy.c - prev include/ls.h - make ast_mmap.h implicit - prev FEATURE/mmap - exec - ${STDCMP} -s FEATURE/mmap ast_mmap.h || { ${STDRM} -f ast_mmap.h; ${STDCP} FEATURE/mmap ast_mmap.h; } - done ast_mmap.h generated - prev include/ast.h - done port/astcopy.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/astcopy.c - done astcopy.o generated - make astconf.o - make port/astconf.c - make FEATURE/libpath implicit - prev features/libpath.sh - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/libpath.sh - done FEATURE/libpath generated - prev conftab.h - prev include/ls.h - prev include/proc.h - prev include/regex.h - prev include/error.h - prev include/ast.h - prev misc/univlib.h - done port/astconf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Imisc -Iinclude -Istd -D__OBSOLETE__=20120101 -DCONF_LIBSUFFIX=\""${mam_cc_SUFFIX_DYNAMIC-${mam_cc_SUFFIX_SHARED}}"\" -DCONF_LIBPREFIX=\""${mam_cc_PREFIX_DYNAMIC-${mam_cc_PREFIX_SHARED}}"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -c port/astconf.c - done astconf.o generated - make astdynamic.o - make port/astdynamic.c + done + done + done + exec - compile ${<} -Icdt + done + + make dtdisc.o + make cdt/dtdisc.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dthash.o + make cdt/dthash.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtlist.o + make cdt/dtlist.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtmethod.o + make cdt/dtmethod.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtopen.o + make cdt/dtopen.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtstat.o + make cdt/dtstat.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtstrhash.o + make cdt/dtstrhash.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dttree.o + make cdt/dttree.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtuser.o + make cdt/dtuser.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtview.o + make cdt/dtview.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtwalk.o + make cdt/dtwalk.c + prev cdt/dthdr.h + done + exec - compile ${<} -Icdt + done + + make dtnew.o + make cdt/dtnew.c + prev include/dt.h + done + exec - compile ${<} + done + + make dtcomp.o + make cdt/dtcomp.c + prev include/cdt.h + done + exec - compile ${<} + done + + make sfclose.o + make sfio/sfclose.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfclrlock.o + make sfio/sfclrlock.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfdisc.o + make sfio/sfdisc.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfdlen.o + make sfio/sfdlen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfexcept.o + make sfio/sfexcept.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfgetl.o + make sfio/sfgetl.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfgetu.o + make sfio/sfgetu.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfcvt.o + make sfio/sfcvt.c + prev sfio/sfhdr.h + prev FEATURE/standards + done + exec - compile ${<} -Iport -Isfio + done + + make sfecvt.o + make sfio/sfecvt.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sffcvt.o + make sfio/sffcvt.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfextern.o + make sfio/sfextern.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sffilbuf.o + make sfio/sffilbuf.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfflsbuf.o + make sfio/sfflsbuf.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfprints.o + make sfio/sfprints.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfgetd.o + make sfio/sfgetd.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfgetr.o + make sfio/sfgetr.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfllen.o + make sfio/sfllen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfmode.o + make sfio/sfmode.c + prev include/wait.h + prev sig.h + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfmove.o + make sfio/sfmove.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfnew.o + make sfio/sfnew.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpkrd.o + make sfio/sfpkrd.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfnotify.o + make sfio/sfnotify.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfnputc.o + make sfio/sfnputc.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfopen.o + make sfio/sfopen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpeek.o + make sfio/sfpeek.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpoll.o + make sfio/sfpoll.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpool.o + make sfio/sfpool.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpopen.o + make sfio/sfpopen.c + prev include/proc.h + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfprintf.o + make sfio/sfprintf.c + prev sfio/sfhdr.h + done + exec - compile ${<} ${mam_cc_NOPROTECT} -Iport -Isfio + done + + make sfputd.o + make sfio/sfputd.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfputl.o + make sfio/sfputl.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfputr.o + make sfio/sfputr.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfputu.o + make sfio/sfputu.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfrd.o + make sfio/sfrd.c + prev sfio/sfhdr.h + done + exec - compile ${<} ${DEBUG+-DDEBUG=${DEBUG}} -Iport -Isfio + done + + make sfread.o + make sfio/sfread.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfreserve.o + make sfio/sfreserve.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfscanf.o + make sfio/sfscanf.c + prev sfio/sfhdr.h + done + exec - compile ${<} ${mam_cc_NOPROTECT} -Iport -Isfio + done + + make sfseek.o + make sfio/sfseek.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfset.o + make sfio/sfset.c + prev sfio/sfhdr.h + done + exec - compile ${<} ${DEBUG+-DDEBUG=${DEBUG}} -Iport -Isfio + done + + make sfsetbuf.o + make sfio/sfsetbuf.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfsetfd.o + make sfio/sfsetfd.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfsize.o + make sfio/sfsize.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfsk.o + make sfio/sfsk.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfstack.o + make sfio/sfstack.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfstrtod.o + make sfio/sfstrtod.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfsync.o + make sfio/sfsync.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfswap.o + make sfio/sfswap.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sftable.o + make sfio/sftable.c + make FEATURE/sfinit implicit + make features/sfinit.c + prev FEATURE/float + prev FEATURE/common + done + exec - invoke_iffe ${<} -I. -Istd + done + prev FEATURE/float + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sftell.o + make sfio/sftell.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sftmp.o + make sfio/sftmp.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfungetc.o + make sfio/sfungetc.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfvprintf.o + make sfio/sfvprintf.c + prev include/ccode.h + prev sfio/sfhdr.h + done + exec - compile ${<} ${mam_cc_NOPROTECT} ${DEBUG+-DDEBUG=${DEBUG}} -Iport -Isfio + done + + make sfvscanf.o + make sfio/sfvscanf.c + prev sfio/sfstrtof.h + prev sfio/sfhdr.h + done + exec - compile ${<} ${mam_cc_NOPROTECT} -Iport -Isfio + done + + make sfwr.o + make sfio/sfwr.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfwrite.o + make sfio/sfwrite.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfpurge.o + make sfio/sfpurge.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfraise.o + make sfio/sfraise.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfwalk.o + make sfio/sfwalk.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfgetm.o + make sfio/sfgetm.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfputm.o + make sfio/sfputm.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make sfresize.o + make sfio/sfresize.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfclrerr.o + make sfio/_sfclrerr.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfeof.o + make sfio/_sfeof.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sferror.o + make sfio/_sferror.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sffileno.o + make sfio/_sffileno.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfopen.o + make sfio/_sfopen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfstacked.o + make sfio/_sfstacked.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfvalue.o + make sfio/_sfvalue.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfgetc.o + make sfio/_sfgetc.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfgetl.o + make sfio/_sfgetl.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfgetl2.o + make sfio/_sfgetl2.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfgetu.o + make sfio/_sfgetu.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfgetu2.o + make sfio/_sfgetu2.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfdlen.o + make sfio/_sfdlen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfllen.o + make sfio/_sfllen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfslen.o + make sfio/_sfslen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfulen.o + make sfio/_sfulen.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfputc.o + make sfio/_sfputc.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfputd.o + make sfio/_sfputd.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfputl.o + make sfio/_sfputl.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfputm.o + make sfio/_sfputm.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make _sfputu.o + make sfio/_sfputu.c + prev sfio/sfhdr.h + done + exec - compile ${<} -Iport -Isfio + done + + make clearerr.o + make stdio/clearerr.c + make stdio/stdhdr.h implicit + prev std/stdio.h prev sfio/sfhdr.h - prev include/ast_windows.h - prev include/ast.h - prev include/sfio_t.h - done port/astdynamic.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -c port/astdynamic.c - done astdynamic.o generated - make astquery.o - make port/astquery.c - prev include/error.h - prev include/ast.h - done port/astquery.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/astquery.c - done astquery.o generated - make astwinsize.o - make port/astwinsize.c - prev jioctl.h implicit dontcare virtual - prev ast_tty.h - prev include/ast.h - done port/astwinsize.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/astwinsize.c - done astwinsize.o generated - make conftab.o - prev conftab.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c conftab.c - done conftab.o generated - make aststatic.o - make port/aststatic.c - prev include/ast.h - done port/aststatic.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c port/aststatic.c - done aststatic.o generated - make getopt.o - make comp/getopt.c - prev include/option.h - prev include/error.h - prev include/ast.h - done comp/getopt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getopt.c - done getopt.o generated - make getoptl.o - make comp/getoptl.c - prev comp/getopt.h - prev include/option.h + prev ast_standards.h + done + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fclose.o + make stdio/fclose.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fdopen.o + make stdio/fdopen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fflush.o + make stdio/fflush.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fgetc.o + make stdio/fgetc.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fgetpos.o + make stdio/fgetpos.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fgets.o + make stdio/fgets.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fopen.o + make stdio/fopen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fprintf.o + make stdio/fprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fpurge.o + make stdio/fpurge.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fputs.o + make stdio/fputs.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fread.o + make stdio/fread.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make freopen.o + make stdio/freopen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fscanf.o + make stdio/fscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fseek.o + make stdio/fseek.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fseeko.o + make stdio/fseeko.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fsetpos.o + make stdio/fsetpos.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make ftell.o + make stdio/ftell.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make ftello.o + make stdio/ftello.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fwrite.o + make stdio/fwrite.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make getw.o + make stdio/getw.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make pclose.o + make stdio/pclose.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make popen.o + make stdio/popen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make printf.o + make stdio/printf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make puts.o + make stdio/puts.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make putw.o + make stdio/putw.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make rewind.o + make stdio/rewind.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make scanf.o + make stdio/scanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make setbuf.o + make stdio/setbuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make setbuffer.o + make stdio/setbuffer.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make setlinebuf.o + make stdio/setlinebuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make setvbuf.o + make stdio/setvbuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make snprintf.o + make stdio/snprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make sprintf.o + make stdio/sprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make sscanf.o + make stdio/sscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make asprintf.o + make stdio/asprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vasprintf.o + make stdio/vasprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make tmpfile.o + make stdio/tmpfile.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make ungetc.o + make stdio/ungetc.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vfprintf.o + make stdio/vfprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vfscanf.o + make stdio/vfscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vprintf.o + make stdio/vprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vscanf.o + make stdio/vscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vsnprintf.o + make stdio/vsnprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vsprintf.o + make stdio/vsprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vsscanf.o + make stdio/vsscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _doprnt.o + make stdio/_doprnt.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _doscan.o + make stdio/_doscan.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _filbuf.o + make stdio/_filbuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _flsbuf.o + make stdio/_flsbuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdopen.o + make stdio/_stdopen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdprintf.o + make stdio/_stdprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdscanf.o + make stdio/_stdscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdsprnt.o + make stdio/_stdsprnt.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdvbuf.o + make stdio/_stdvbuf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdvsnprnt.o + make stdio/_stdvsnprnt.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdvsprnt.o + make stdio/_stdvsprnt.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make _stdvsscn.o + make stdio/_stdvsscn.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fgetwc.o + make stdio/fgetwc.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fwprintf.o + make stdio/fwprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make putwchar.o + make stdio/putwchar.c + prev ast_wchar.h + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vfwscanf.o + make stdio/vfwscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make wprintf.o + make stdio/wprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fgetws.o + make stdio/fgetws.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fwscanf.o + make stdio/fwscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make swprintf.o + make stdio/swprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vswprintf.o + make stdio/vswprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make wscanf.o + make stdio/wscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fputwc.o + make stdio/fputwc.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make getwc.o + make stdio/getwc.c + prev ast_wchar.h + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make swscanf.o + make stdio/swscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vswscanf.o + make stdio/vswscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fputws.o + make stdio/fputws.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make getwchar.o + make stdio/getwchar.c + prev ast_wchar.h + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make ungetwc.o + make stdio/ungetwc.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vwprintf.o + make stdio/vwprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fwide.o + make stdio/fwide.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make putwc.o + make stdio/putwc.c + prev ast_wchar.h + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vfwprintf.o + make stdio/vfwprintf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make vwscanf.o + make stdio/vwscanf.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make stdio_c99.o + make stdio/stdio_c99.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fcloseall.o + make stdio/fcloseall.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make fmemopen.o + make stdio/fmemopen.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make getdelim.o + make stdio/getdelim.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make getline.o + make stdio/getline.c + prev stdio/stdhdr.h + done + exec - compile ${<} -Iport -Isfio -Istdio + done + + make frexp.o + make comp/frexp.c + prev FEATURE/float + prev include/ast.h + done + exec - compile ${<} + done + + make frexpl.o + make comp/frexpl.c + prev FEATURE/float + prev include/ast.h + done + exec - compile ${<} + done + + make astcopy.o + make port/astcopy.c + prev include/ls.h + prev ast_mmap.h + prev include/ast.h + done + exec - compile ${<} + done + + make astconf.o + make port/astconf.c + make FEATURE/libpath implicit + prev features/libpath.sh + exec - invoke_iffe ${<} + done + prev conftab.h + prev include/ls.h + prev include/proc.h + prev include/regex.h + prev include/error.h + prev include/ast.h + prev misc/univlib.h + done + exec - compile ${<} -Imisc -DCONF_LIBSUFFIX=\""${mam_cc_SUFFIX_DYNAMIC-${mam_cc_SUFFIX_SHARED}}"\" -DCONF_LIBPREFIX=\""${mam_cc_PREFIX_DYNAMIC-${mam_cc_PREFIX_SHARED}}"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" + done + + make astdynamic.o + make port/astdynamic.c + prev sfio/sfhdr.h + prev include/ast_windows.h + prev include/ast.h + prev include/sfio_t.h + done + exec - compile ${<} -Iport -Isfio + done + + make astquery.o + make port/astquery.c + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make astwinsize.o + make port/astwinsize.c + prev ast_tty.h + prev include/ast.h + done + exec - compile ${<} + done + + make conftab.o + make conftab.c + prev conftab.h + prev FEATURE/param + prev FEATURE/common + prev FEATURE/standards + done + exec - compile ${<} + done + + make aststatic.o + make port/aststatic.c + prev include/ast.h + done + exec - compile ${<} + done + + make getopt.o + make comp/getopt.c + prev include/option.h + prev include/error.h + prev include/ast.h + done + exec - compile ${<} + done + + make getoptl.o + make comp/getoptl.c + prev comp/getopt.h + prev include/option.h + prev include/error.h + prev include/ast_getopt.h + prev include/ast.h + done + exec - compile ${<} + done + + make aso.o + make aso/aso.c + prev std/stdio.h + prev FEATURE/aso + make aso/asohdr.h implicit + prev include/aso.h + make FEATURE/asometh implicit + prev features/asometh + exec - invoke_iffe ${<} + done + make include/fnv.h implicit + prev ast_common.h + done prev include/error.h - prev include/ast_getopt.h prev include/ast.h - done comp/getoptl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c comp/getoptl.c - done getoptl.o generated - make aso.o - make aso/aso.c - prev std/stdio.h - prev FEATURE/aso - make aso/asohdr.h implicit - prev include/aso.h - make FEATURE/asometh implicit - prev features/asometh - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/asometh - done FEATURE/asometh generated - make include/fnv.h implicit - prev ast_common.h - done include/fnv.h - prev include/error.h - prev include/ast.h - done aso/asohdr.h - done aso/aso.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/aso.c - done aso.o generated - make asolock.o - make aso/asolock.c - prev aso/asohdr.h - done aso/asolock.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/asolock.c - done asolock.o generated - make asometh.o - make aso/asometh.c - prev aso/asohdr.h - done aso/asometh.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/asometh.c - done asometh.o generated - make asorelax.o - make aso/asorelax.c - prev tv.h - prev aso/asohdr.h - done aso/asorelax.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/asorelax.c - done asorelax.o generated - make aso-sem.o - make aso/aso-sem.c - prev aso/asohdr.h - done aso/aso-sem.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/aso-sem.c - done aso-sem.o generated - make aso-fcntl.o - make aso/aso-fcntl.c - prev aso/asohdr.h - done aso/aso-fcntl.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iaso -Icomp -Iinclude -Istd -c aso/aso-fcntl.c - done aso-fcntl.o generated - make vmbest.o - make vmalloc/vmbest.c - prev windows.h + done + done + exec - compile ${<} -Iaso + done + + make asolock.o + make aso/asolock.c + prev aso/asohdr.h + done + exec - compile ${<} -Iaso + done + + make asometh.o + make aso/asometh.c + prev aso/asohdr.h + done + exec - compile ${<} -Iaso + done + + make asorelax.o + make aso/asorelax.c + prev tv.h + prev aso/asohdr.h + done + exec - compile ${<} -Iaso + done + + make aso-sem.o + make aso/aso-sem.c + prev aso/asohdr.h + done + exec - compile ${<} -Iaso + done + + make aso-fcntl.o + make aso/aso-fcntl.c + prev aso/asohdr.h + done + exec - compile ${<} -Iaso + done + + make vmbest.o + make vmalloc/vmbest.c + prev include/ast_windows.h + make vmalloc/vmhdr.h implicit + prev include/vmalloc.h prev include/ast_windows.h - make vmalloc/vmhdr.h implicit - prev include/vmalloc.h - prev include/ast_windows.h - prev include/aso.h - prev FEATURE/vmalloc - prev ast_common.h - prev include/ast.h - done vmalloc/vmhdr.h dontcare - done vmalloc/vmbest.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmbest.c - done vmbest.o generated - make vmclear.o - make vmalloc/vmclear.c - prev vmalloc/vmhdr.h - done vmalloc/vmclear.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmclear.c - done vmclear.o generated - make vmclose.o - make vmalloc/vmclose.c - prev vmalloc/vmhdr.h - done vmalloc/vmclose.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmclose.c - done vmclose.o generated - make vmdcheap.o - make vmalloc/vmdcheap.c - prev vmalloc/vmhdr.h - done vmalloc/vmdcheap.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmdcheap.c - done vmdcheap.o generated - make vmdebug.o - make vmalloc/vmdebug.c - prev vmalloc/vmhdr.h - done vmalloc/vmdebug.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmdebug.c - done vmdebug.o generated - make vmdisc.o - make vmalloc/vmdisc.c - prev vmalloc/vmhdr.h - done vmalloc/vmdisc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmdisc.c - done vmdisc.o generated - make vmlast.o - make vmalloc/vmlast.c - prev vmalloc/vmhdr.h - done vmalloc/vmlast.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmlast.c - done vmlast.o generated - make vmopen.o - make vmalloc/vmopen.c - prev vmalloc/vmhdr.h - done vmalloc/vmopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmopen.c - done vmopen.o generated - make vmpool.o - make vmalloc/vmpool.c - prev vmalloc/vmhdr.h - done vmalloc/vmpool.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmpool.c - done vmpool.o generated - make vmprivate.o - make vmalloc/vmprivate.c - prev vmalloc/vmhdr.h - done vmalloc/vmprivate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmprivate.c - done vmprivate.o generated - make vmprofile.o - make vmalloc/vmprofile.c - prev vmalloc/vmhdr.h - done vmalloc/vmprofile.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmprofile.c - done vmprofile.o generated - make vmregion.o - make vmalloc/vmregion.c - prev vmalloc/vmhdr.h - done vmalloc/vmregion.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmregion.c - done vmregion.o generated - make vmsegment.o - make vmalloc/vmsegment.c - prev vmalloc/vmhdr.h - done vmalloc/vmsegment.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmsegment.c - done vmsegment.o generated - make vmset.o - make vmalloc/vmset.c - prev vmalloc/vmhdr.h - done vmalloc/vmset.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmset.c - done vmset.o generated - make vmstat.o - make vmalloc/vmstat.c - prev vmalloc/vmhdr.h - done vmalloc/vmstat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmstat.c - done vmstat.o generated - make vmstrdup.o - make vmalloc/vmstrdup.c - prev vmalloc/vmhdr.h - done vmalloc/vmstrdup.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmstrdup.c - done vmstrdup.o generated - make vmtrace.o - make vmalloc/vmtrace.c - prev vmalloc/vmhdr.h - done vmalloc/vmtrace.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmtrace.c - done vmtrace.o generated - make vmwalk.o - make vmalloc/vmwalk.c - prev vmalloc/vmhdr.h - done vmalloc/vmwalk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmwalk.c - done vmwalk.o generated - make vmmopen.o - make vmalloc/vmmopen.c - prev std/stdio.h - prev vmalloc/vmhdr.h + prev include/aso.h prev FEATURE/vmalloc - done vmalloc/vmmopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/vmmopen.c - done vmmopen.o generated - make malloc.o - make vmalloc/malloc.c - prev include/ast_windows.h - prev std/stdio.h - prev vmalloc/vmhdr.h - done vmalloc/malloc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Ivmalloc -Iinclude -Istd -c vmalloc/malloc.c - done malloc.o generated - make vmgetmem.o - make vmalloc/vmgetmem.c - prev include/vmalloc.h - done vmalloc/vmgetmem.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c vmalloc/vmgetmem.c - done vmgetmem.o generated - exec - ${AR} rc libast.a state.o opendir.o readdir.o rewinddir.o seekdir.o telldir.o getcwd.o fastfind.o hashalloc.o hashdump.o hashfree.o hashlast.o hashlook.o hashscan.o hashsize.o hashview.o hashwalk.o memhash.o memsum.o strhash.o strkey.o strsum.o stracmp.o strnacmp.o ccmap.o ccmapid.o ccnative.o chresc.o chrtoi.o - exec - ${AR} rc libast.a streval.o strexpr.o strmatch.o strcopy.o modei.o modex.o strmode.o strlcat.o strlcpy.o strlook.o strncopy.o strsearch.o strpsearch.o stresc.o stropt.o strtape.o strpcmp.o strnpcmp.o strvcmp.o strnvcmp.o tok.o tokline.o tokscan.o pathaccess.o pathcat.o pathcanon.o pathcheck.o pathpath.o pathexists.o pathfind.o pathicase.o pathkey.o pathprobe.o pathrepl.o pathnative.o pathposix.o pathtemp.o pathtmp.o pathstat.o pathgetlink.o pathsetlink.o pathbin.o pathshell.o pathcd.o pathprog.o ftwalk.o ftwflags.o fts.o astintercept.o conformance.o getenv.o setenviron.o optget.o optjoin.o optesc.o optctx.o strsort.o struniq.o magic.o mime.o mimetype.o signal.o sigflag.o systrace.o error.o errorf.o errormsg.o errorx.o localeconv.o setlocale.o translate.o catopen.o iconv.o lc.o lctab.o mc.o base64.o recfmt.o recstr.o reclen.o fmtrec.o fmtbase.o fmtbuf.o fmtclock.o fmtdev.o fmtelapsed.o fmterror.o fmtesc.o fmtfmt.o fmtfs.o fmtident.o fmtint.o fmtip4.o fmtip6.o fmtls.o fmtmatch.o fmtmode.o fmtnum.o fmtperm.o fmtre.o fmttime.o - exec - ${AR} rc libast.a fmtuid.o fmtgid.o fmtsignal.o fmtscale.o fmttmx.o fmttv.o fmtversion.o strelapsed.o strperm.o struid.o strgid.o strtoip4.o strtoip6.o stack.o stk.o swapget.o swapmem.o swapop.o swapput.o sigdata.o sigcrit.o sigunblock.o procopen.o procclose.o procrun.o procfree.o tmdate.o tmequiv.o tmfix.o tmfmt.o tmform.o tmgoff.o tminit.o tmleap.o tmlex.o tmlocale.o tmmake.o tmpoff.o tmscan.o tmsleep.o tmtime.o tmtype.o tmweek.o tmword.o tmzone.o tmxdate.o tmxduration.o tmxfmt.o tmxgettime.o tmxleap.o tmxmake.o tmxscan.o tmxsettime.o tmxsleep.o tmxtime.o tmxtouch.o tvcmp.o tvgettime.o tvsettime.o tvsleep.o tvtouch.o cmdarg.o vecargs.o vecfile.o vecfree.o vecload.o vecstring.o univdata.o touch.o mnt.o debug.o memccpy.o memchr.o memcmp.o memcpy.o memdup.o memmove.o memset.o mkdir.o mkfifo.o mknod.o rmdir.o remove.o rename.o link.o unlink.o strdup.o strchr.o strrchr.o strstr.o strtod.o strtold.o strtol.o strtoll.o strtoul.o strtoull.o strton.o strtonll.o strntod.o strntold.o strnton.o - exec - ${AR} rc libast.a strntonll.o strntol.o strntoll.o strntoul.o strntoull.o strcasecmp.o strncasecmp.o strerror.o mktemp.o tmpnam.o fsync.o execlp.o execve.o execvp.o execvpe.o spawnveg.o killpg.o getlogin.o putenv.o setenv.o unsetenv.o lstat.o statvfs.o eaccess.o gross.o omitted.o readlink.o symlink.o getpgrp.o setpgid.o setsid.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getgroups.o mount.o system.o iblocks.o modedata.o tmdata.o memfatal.o sfkeyprintf.o sfdcdio.o sfdcdos.o sfdcfilter.o sfdcseekable.o sfdcslow.o sfdcsubstr.o sfdctee.o sfdcunion.o sfdcmore.o sfdcprefix.o wc.o wc2utf8.o basename.o closelog.o dirname.o fmtmsglib.o fnmatch.o ftw.o getdate.o getsubopt.o glob.o nftw.o openlog.o re_comp.o resolvepath.o realpath.o regcmp.o regexp.o setlogmask.o strftime.o strptime.o swab.o syslog.o tempnam.o wordexp.o mktime.o regalloc.o regclass.o regcoll.o regcomp.o regcache.o regdecomp.o regerror.o regexec.o regfatal.o reginit.o - exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstat.o dtstrhash.o dttree.o dtuser.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o - exec - ${AR} rc libast.a _sfputu.o clearerr.o fclose.o fdopen.o fflush.o fgetc.o fgetpos.o fgets.o fopen.o fprintf.o fpurge.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o getw.o pclose.o popen.o printf.o putchar.o puts.o putw.o rewind.o scanf.o setbuf.o setbuffer.o setlinebuf.o setvbuf.o snprintf.o sprintf.o sscanf.o asprintf.o vasprintf.o tmpfile.o ungetc.o vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o _doprnt.o _doscan.o _filbuf.o _flsbuf.o _stdopen.o _stdprintf.o _stdscanf.o _stdsprnt.o _stdvbuf.o _stdvsnprnt.o _stdvsprnt.o _stdvsscn.o fgetwc.o fwprintf.o putwchar.o vfwscanf.o wprintf.o fgetws.o fwscanf.o swprintf.o vswprintf.o wscanf.o fputwc.o getwc.o swscanf.o vswscanf.o fputws.o getwchar.o ungetwc.o vwprintf.o fwide.o putwc.o vfwprintf.o vwscanf.o stdio_c99.o fcloseall.o fmemopen.o getdelim.o getline.o frexp.o frexpl.o astcopy.o - exec - ${AR} rc libast.a astconf.o astdynamic.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o - exec - (ranlib libast.a) >/dev/null 2>&1 || true - done libast.a generated - done ast virtual - prev libast.a - make ${INSTALLROOT}/lib - exec - if test ! -d ${INSTALLROOT}/lib - exec - then mkdir -p ${INSTALLROOT}/lib - exec - fi - done ${INSTALLROOT}/lib generated - make ${INSTALLROOT}/lib/libast.a archive - prev ${INSTALLROOT}/lib + prev ast_common.h + prev sig.h + prev include/ast.h + done + done + exec - compile ${<} -Ivmalloc + done + + make vmclear.o + make vmalloc/vmclear.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmclose.o + make vmalloc/vmclose.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmdcheap.o + make vmalloc/vmdcheap.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmdebug.o + make vmalloc/vmdebug.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmdisc.o + make vmalloc/vmdisc.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmlast.o + make vmalloc/vmlast.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmopen.o + make vmalloc/vmopen.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmpool.o + make vmalloc/vmpool.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmprivate.o + make vmalloc/vmprivate.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmprofile.o + make vmalloc/vmprofile.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmregion.o + make vmalloc/vmregion.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmsegment.o + make vmalloc/vmsegment.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmset.o + make vmalloc/vmset.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmstat.o + make vmalloc/vmstat.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmstrdup.o + make vmalloc/vmstrdup.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmtrace.o + make vmalloc/vmtrace.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmwalk.o + make vmalloc/vmwalk.c + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmmopen.o + make vmalloc/vmmopen.c + prev std/stdio.h + prev vmalloc/vmhdr.h + prev FEATURE/vmalloc + done + exec - compile ${<} -Ivmalloc + done + + make malloc.o + make vmalloc/malloc.c + prev include/ast_windows.h + prev std/stdio.h + prev vmalloc/vmhdr.h + done + exec - compile ${<} -Ivmalloc + done + + make vmgetmem.o + make vmalloc/vmgetmem.c + prev include/vmalloc.h + done + exec - compile ${<} + done + + note * + note * Link the library + note * + + exec - if test -f ${@} + exec - then ${AR} rc ${@} ${?} # add changed *.o + exec - else ${AR} rc ${@} ${^} # add all *.o + exec - fi || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + + note * save for dylink + setv _libast_object_files_ ${^} + done libast.a + + note * + note * Dynamically linked version, if supported + note * + + make ${INSTALLROOT}/dyn/lib/libast${mam_cc_SUFFIX_SHARED} dontcare prev libast.a - exec - ${STDCMP} 2>/dev/null -s libast.a ${INSTALLROOT}/lib/libast.a || { ${STDMV} ${INSTALLROOT}/lib/libast.a ${INSTALLROOT}/lib/libast.a.old 2>/dev/null || true; ${STDCP} libast.a ${INSTALLROOT}/lib/libast.a ;} - exec - (ranlib ${INSTALLROOT}/lib/libast.a) >/dev/null 2>&1 || true - done ${INSTALLROOT}/lib/libast.a generated - make ${INSTALLROOT}/man/man3 - exec - if test ! -d ${INSTALLROOT}/man/man3 - exec - then mkdir -p ${INSTALLROOT}/man/man3 - exec - fi - done ${INSTALLROOT}/man/man3 generated - make ${INSTALLROOT}/man/man3/LIBAST.3 - prev ${INSTALLROOT}/man/man3 - prev man/LIBAST.3 - exec - ${STDCMP} 2>/dev/null -s man/LIBAST.3 ${INSTALLROOT}/man/man3/LIBAST.3 || { ${STDMV} ${INSTALLROOT}/man/man3/LIBAST.3 ${INSTALLROOT}/man/man3/LIBAST.3.old 2>/dev/null || true; ${STDCP} man/LIBAST.3 ${INSTALLROOT}/man/man3/LIBAST.3 ;} - done ${INSTALLROOT}/man/man3/LIBAST.3 generated - make ${INSTALLROOT}/man/man3/aso.3 - prev man/aso.3 - exec - ${STDCMP} 2>/dev/null -s man/aso.3 ${INSTALLROOT}/man/man3/aso.3 || { ${STDMV} ${INSTALLROOT}/man/man3/aso.3 ${INSTALLROOT}/man/man3/aso.3.old 2>/dev/null || true; ${STDCP} man/aso.3 ${INSTALLROOT}/man/man3/aso.3 ;} - done ${INSTALLROOT}/man/man3/aso.3 generated - make ${INSTALLROOT}/man/man3/ast.3 - prev man/ast.3 - exec - ${STDCMP} 2>/dev/null -s man/ast.3 ${INSTALLROOT}/man/man3/ast.3 || { ${STDMV} ${INSTALLROOT}/man/man3/ast.3 ${INSTALLROOT}/man/man3/ast.3.old 2>/dev/null || true; ${STDCP} man/ast.3 ${INSTALLROOT}/man/man3/ast.3 ;} - done ${INSTALLROOT}/man/man3/ast.3 generated - make ${INSTALLROOT}/man/man3/cdt.3 - prev man/cdt.3 - exec - ${STDCMP} 2>/dev/null -s man/cdt.3 ${INSTALLROOT}/man/man3/cdt.3 || { ${STDMV} ${INSTALLROOT}/man/man3/cdt.3 ${INSTALLROOT}/man/man3/cdt.3.old 2>/dev/null || true; ${STDCP} man/cdt.3 ${INSTALLROOT}/man/man3/cdt.3 ;} - done ${INSTALLROOT}/man/man3/cdt.3 generated - make ${INSTALLROOT}/man/man3/chr.3 - prev man/chr.3 - exec - ${STDCMP} 2>/dev/null -s man/chr.3 ${INSTALLROOT}/man/man3/chr.3 || { ${STDMV} ${INSTALLROOT}/man/man3/chr.3 ${INSTALLROOT}/man/man3/chr.3.old 2>/dev/null || true; ${STDCP} man/chr.3 ${INSTALLROOT}/man/man3/chr.3 ;} - done ${INSTALLROOT}/man/man3/chr.3 generated - make ${INSTALLROOT}/man/man3/compat.3 - prev man/compat.3 - exec - ${STDCMP} 2>/dev/null -s man/compat.3 ${INSTALLROOT}/man/man3/compat.3 || { ${STDMV} ${INSTALLROOT}/man/man3/compat.3 ${INSTALLROOT}/man/man3/compat.3.old 2>/dev/null || true; ${STDCP} man/compat.3 ${INSTALLROOT}/man/man3/compat.3 ;} - done ${INSTALLROOT}/man/man3/compat.3 generated - make ${INSTALLROOT}/man/man3/error.3 - prev man/error.3 - exec - ${STDCMP} 2>/dev/null -s man/error.3 ${INSTALLROOT}/man/man3/error.3 || { ${STDMV} ${INSTALLROOT}/man/man3/error.3 ${INSTALLROOT}/man/man3/error.3.old 2>/dev/null || true; ${STDCP} man/error.3 ${INSTALLROOT}/man/man3/error.3 ;} - done ${INSTALLROOT}/man/man3/error.3 generated - make ${INSTALLROOT}/man/man3/find.3 - prev man/find.3 - exec - ${STDCMP} 2>/dev/null -s man/find.3 ${INSTALLROOT}/man/man3/find.3 || { ${STDMV} ${INSTALLROOT}/man/man3/find.3 ${INSTALLROOT}/man/man3/find.3.old 2>/dev/null || true; ${STDCP} man/find.3 ${INSTALLROOT}/man/man3/find.3 ;} - done ${INSTALLROOT}/man/man3/find.3 generated - make ${INSTALLROOT}/man/man3/fmt.3 - prev man/fmt.3 - exec - ${STDCMP} 2>/dev/null -s man/fmt.3 ${INSTALLROOT}/man/man3/fmt.3 || { ${STDMV} ${INSTALLROOT}/man/man3/fmt.3 ${INSTALLROOT}/man/man3/fmt.3.old 2>/dev/null || true; ${STDCP} man/fmt.3 ${INSTALLROOT}/man/man3/fmt.3 ;} - done ${INSTALLROOT}/man/man3/fmt.3 generated - make ${INSTALLROOT}/man/man3/fmtls.3 - prev man/fmtls.3 - exec - ${STDCMP} 2>/dev/null -s man/fmtls.3 ${INSTALLROOT}/man/man3/fmtls.3 || { ${STDMV} ${INSTALLROOT}/man/man3/fmtls.3 ${INSTALLROOT}/man/man3/fmtls.3.old 2>/dev/null || true; ${STDCP} man/fmtls.3 ${INSTALLROOT}/man/man3/fmtls.3 ;} - done ${INSTALLROOT}/man/man3/fmtls.3 generated - make ${INSTALLROOT}/man/man3/ftwalk.3 - prev man/ftwalk.3 - exec - ${STDCMP} 2>/dev/null -s man/ftwalk.3 ${INSTALLROOT}/man/man3/ftwalk.3 || { ${STDMV} ${INSTALLROOT}/man/man3/ftwalk.3 ${INSTALLROOT}/man/man3/ftwalk.3.old 2>/dev/null || true; ${STDCP} man/ftwalk.3 ${INSTALLROOT}/man/man3/ftwalk.3 ;} - done ${INSTALLROOT}/man/man3/ftwalk.3 generated - make ${INSTALLROOT}/man/man3/getcwd.3 - prev man/getcwd.3 - exec - ${STDCMP} 2>/dev/null -s man/getcwd.3 ${INSTALLROOT}/man/man3/getcwd.3 || { ${STDMV} ${INSTALLROOT}/man/man3/getcwd.3 ${INSTALLROOT}/man/man3/getcwd.3.old 2>/dev/null || true; ${STDCP} man/getcwd.3 ${INSTALLROOT}/man/man3/getcwd.3 ;} - done ${INSTALLROOT}/man/man3/getcwd.3 generated - make ${INSTALLROOT}/man/man3/hash.3 - prev man/hash.3 - exec - ${STDCMP} 2>/dev/null -s man/hash.3 ${INSTALLROOT}/man/man3/hash.3 || { ${STDMV} ${INSTALLROOT}/man/man3/hash.3 ${INSTALLROOT}/man/man3/hash.3.old 2>/dev/null || true; ${STDCP} man/hash.3 ${INSTALLROOT}/man/man3/hash.3 ;} - done ${INSTALLROOT}/man/man3/hash.3 generated - make ${INSTALLROOT}/man/man3/iblocks.3 - prev man/iblocks.3 - exec - ${STDCMP} 2>/dev/null -s man/iblocks.3 ${INSTALLROOT}/man/man3/iblocks.3 || { ${STDMV} ${INSTALLROOT}/man/man3/iblocks.3 ${INSTALLROOT}/man/man3/iblocks.3.old 2>/dev/null || true; ${STDCP} man/iblocks.3 ${INSTALLROOT}/man/man3/iblocks.3 ;} - done ${INSTALLROOT}/man/man3/iblocks.3 generated - make ${INSTALLROOT}/man/man3/int.3 - prev man/int.3 - exec - ${STDCMP} 2>/dev/null -s man/int.3 ${INSTALLROOT}/man/man3/int.3 || { ${STDMV} ${INSTALLROOT}/man/man3/int.3 ${INSTALLROOT}/man/man3/int.3.old 2>/dev/null || true; ${STDCP} man/int.3 ${INSTALLROOT}/man/man3/int.3 ;} - done ${INSTALLROOT}/man/man3/int.3 generated - make ${INSTALLROOT}/man/man3/ip6.3 - prev man/ip6.3 - exec - ${STDCMP} 2>/dev/null -s man/ip6.3 ${INSTALLROOT}/man/man3/ip6.3 || { ${STDMV} ${INSTALLROOT}/man/man3/ip6.3 ${INSTALLROOT}/man/man3/ip6.3.old 2>/dev/null || true; ${STDCP} man/ip6.3 ${INSTALLROOT}/man/man3/ip6.3 ;} - done ${INSTALLROOT}/man/man3/ip6.3 generated - make ${INSTALLROOT}/man/man3/magic.3 - prev man/magic.3 - exec - ${STDCMP} 2>/dev/null -s man/magic.3 ${INSTALLROOT}/man/man3/magic.3 || { ${STDMV} ${INSTALLROOT}/man/man3/magic.3 ${INSTALLROOT}/man/man3/magic.3.old 2>/dev/null || true; ${STDCP} man/magic.3 ${INSTALLROOT}/man/man3/magic.3 ;} - done ${INSTALLROOT}/man/man3/magic.3 generated - make ${INSTALLROOT}/man/man3/mem.3 - prev man/mem.3 - exec - ${STDCMP} 2>/dev/null -s man/mem.3 ${INSTALLROOT}/man/man3/mem.3 || { ${STDMV} ${INSTALLROOT}/man/man3/mem.3 ${INSTALLROOT}/man/man3/mem.3.old 2>/dev/null || true; ${STDCP} man/mem.3 ${INSTALLROOT}/man/man3/mem.3 ;} - done ${INSTALLROOT}/man/man3/mem.3 generated - make ${INSTALLROOT}/man/man3/mime.3 - prev man/mime.3 - exec - ${STDCMP} 2>/dev/null -s man/mime.3 ${INSTALLROOT}/man/man3/mime.3 || { ${STDMV} ${INSTALLROOT}/man/man3/mime.3 ${INSTALLROOT}/man/man3/mime.3.old 2>/dev/null || true; ${STDCP} man/mime.3 ${INSTALLROOT}/man/man3/mime.3 ;} - done ${INSTALLROOT}/man/man3/mime.3 generated - make ${INSTALLROOT}/man/man3/modecanon.3 - prev man/modecanon.3 - exec - ${STDCMP} 2>/dev/null -s man/modecanon.3 ${INSTALLROOT}/man/man3/modecanon.3 || { ${STDMV} ${INSTALLROOT}/man/man3/modecanon.3 ${INSTALLROOT}/man/man3/modecanon.3.old 2>/dev/null || true; ${STDCP} man/modecanon.3 ${INSTALLROOT}/man/man3/modecanon.3 ;} - done ${INSTALLROOT}/man/man3/modecanon.3 generated - make ${INSTALLROOT}/man/man3/optget.3 - prev man/optget.3 - exec - ${STDCMP} 2>/dev/null -s man/optget.3 ${INSTALLROOT}/man/man3/optget.3 || { ${STDMV} ${INSTALLROOT}/man/man3/optget.3 ${INSTALLROOT}/man/man3/optget.3.old 2>/dev/null || true; ${STDCP} man/optget.3 ${INSTALLROOT}/man/man3/optget.3 ;} - done ${INSTALLROOT}/man/man3/optget.3 generated - make ${INSTALLROOT}/man/man3/path.3 - prev man/path.3 - exec - ${STDCMP} 2>/dev/null -s man/path.3 ${INSTALLROOT}/man/man3/path.3 || { ${STDMV} ${INSTALLROOT}/man/man3/path.3 ${INSTALLROOT}/man/man3/path.3.old 2>/dev/null || true; ${STDCP} man/path.3 ${INSTALLROOT}/man/man3/path.3 ;} - done ${INSTALLROOT}/man/man3/path.3 generated - make ${INSTALLROOT}/man/man3/proc.3 - prev man/proc.3 - exec - ${STDCMP} 2>/dev/null -s man/proc.3 ${INSTALLROOT}/man/man3/proc.3 || { ${STDMV} ${INSTALLROOT}/man/man3/proc.3 ${INSTALLROOT}/man/man3/proc.3.old 2>/dev/null || true; ${STDCP} man/proc.3 ${INSTALLROOT}/man/man3/proc.3 ;} - done ${INSTALLROOT}/man/man3/proc.3 generated - make ${INSTALLROOT}/man/man3/re.3 - prev man/re.3 - exec - ${STDCMP} 2>/dev/null -s man/re.3 ${INSTALLROOT}/man/man3/re.3 || { ${STDMV} ${INSTALLROOT}/man/man3/re.3 ${INSTALLROOT}/man/man3/re.3.old 2>/dev/null || true; ${STDCP} man/re.3 ${INSTALLROOT}/man/man3/re.3 ;} - done ${INSTALLROOT}/man/man3/re.3 generated - make ${INSTALLROOT}/man/man3/regex.3 - prev man/regex.3 - exec - ${STDCMP} 2>/dev/null -s man/regex.3 ${INSTALLROOT}/man/man3/regex.3 || { ${STDMV} ${INSTALLROOT}/man/man3/regex.3 ${INSTALLROOT}/man/man3/regex.3.old 2>/dev/null || true; ${STDCP} man/regex.3 ${INSTALLROOT}/man/man3/regex.3 ;} - done ${INSTALLROOT}/man/man3/regex.3 generated - make ${INSTALLROOT}/man/man3/setenviron.3 - prev man/setenviron.3 - exec - ${STDCMP} 2>/dev/null -s man/setenviron.3 ${INSTALLROOT}/man/man3/setenviron.3 || { ${STDMV} ${INSTALLROOT}/man/man3/setenviron.3 ${INSTALLROOT}/man/man3/setenviron.3.old 2>/dev/null || true; ${STDCP} man/setenviron.3 ${INSTALLROOT}/man/man3/setenviron.3 ;} - done ${INSTALLROOT}/man/man3/setenviron.3 generated - make ${INSTALLROOT}/man/man3/sfio.3 - prev man/sfio.3 - exec - ${STDCMP} 2>/dev/null -s man/sfio.3 ${INSTALLROOT}/man/man3/sfio.3 || { ${STDMV} ${INSTALLROOT}/man/man3/sfio.3 ${INSTALLROOT}/man/man3/sfio.3.old 2>/dev/null || true; ${STDCP} man/sfio.3 ${INSTALLROOT}/man/man3/sfio.3 ;} - done ${INSTALLROOT}/man/man3/sfio.3 generated - make ${INSTALLROOT}/man/man3/sig.3 - prev man/sig.3 - exec - ${STDCMP} 2>/dev/null -s man/sig.3 ${INSTALLROOT}/man/man3/sig.3 || { ${STDMV} ${INSTALLROOT}/man/man3/sig.3 ${INSTALLROOT}/man/man3/sig.3.old 2>/dev/null || true; ${STDCP} man/sig.3 ${INSTALLROOT}/man/man3/sig.3 ;} - done ${INSTALLROOT}/man/man3/sig.3 generated - make ${INSTALLROOT}/man/man3/spawnveg.3 - prev man/spawnveg.3 - exec - ${STDCMP} 2>/dev/null -s man/spawnveg.3 ${INSTALLROOT}/man/man3/spawnveg.3 || { ${STDMV} ${INSTALLROOT}/man/man3/spawnveg.3 ${INSTALLROOT}/man/man3/spawnveg.3.old 2>/dev/null || true; ${STDCP} man/spawnveg.3 ${INSTALLROOT}/man/man3/spawnveg.3 ;} - done ${INSTALLROOT}/man/man3/spawnveg.3 generated - make ${INSTALLROOT}/man/man3/stk.3 - prev man/stk.3 - exec - ${STDCMP} 2>/dev/null -s man/stk.3 ${INSTALLROOT}/man/man3/stk.3 || { ${STDMV} ${INSTALLROOT}/man/man3/stk.3 ${INSTALLROOT}/man/man3/stk.3.old 2>/dev/null || true; ${STDCP} man/stk.3 ${INSTALLROOT}/man/man3/stk.3 ;} - done ${INSTALLROOT}/man/man3/stk.3 generated - make ${INSTALLROOT}/man/man3/strcopy.3 - prev man/strcopy.3 - exec - ${STDCMP} 2>/dev/null -s man/strcopy.3 ${INSTALLROOT}/man/man3/strcopy.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strcopy.3 ${INSTALLROOT}/man/man3/strcopy.3.old 2>/dev/null || true; ${STDCP} man/strcopy.3 ${INSTALLROOT}/man/man3/strcopy.3 ;} - done ${INSTALLROOT}/man/man3/strcopy.3 generated - make ${INSTALLROOT}/man/man3/strdup.3 - prev man/strdup.3 - exec - ${STDCMP} 2>/dev/null -s man/strdup.3 ${INSTALLROOT}/man/man3/strdup.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strdup.3 ${INSTALLROOT}/man/man3/strdup.3.old 2>/dev/null || true; ${STDCP} man/strdup.3 ${INSTALLROOT}/man/man3/strdup.3 ;} - done ${INSTALLROOT}/man/man3/strdup.3 generated - make ${INSTALLROOT}/man/man3/strelapsed.3 - prev man/strelapsed.3 - exec - ${STDCMP} 2>/dev/null -s man/strelapsed.3 ${INSTALLROOT}/man/man3/strelapsed.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strelapsed.3 ${INSTALLROOT}/man/man3/strelapsed.3.old 2>/dev/null || true; ${STDCP} man/strelapsed.3 ${INSTALLROOT}/man/man3/strelapsed.3 ;} - done ${INSTALLROOT}/man/man3/strelapsed.3 generated - make ${INSTALLROOT}/man/man3/strerror.3 - prev man/strerror.3 - exec - ${STDCMP} 2>/dev/null -s man/strerror.3 ${INSTALLROOT}/man/man3/strerror.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strerror.3 ${INSTALLROOT}/man/man3/strerror.3.old 2>/dev/null || true; ${STDCP} man/strerror.3 ${INSTALLROOT}/man/man3/strerror.3 ;} - done ${INSTALLROOT}/man/man3/strerror.3 generated - make ${INSTALLROOT}/man/man3/stresc.3 - prev man/stresc.3 - exec - ${STDCMP} 2>/dev/null -s man/stresc.3 ${INSTALLROOT}/man/man3/stresc.3 || { ${STDMV} ${INSTALLROOT}/man/man3/stresc.3 ${INSTALLROOT}/man/man3/stresc.3.old 2>/dev/null || true; ${STDCP} man/stresc.3 ${INSTALLROOT}/man/man3/stresc.3 ;} - done ${INSTALLROOT}/man/man3/stresc.3 generated - make ${INSTALLROOT}/man/man3/streval.3 - prev man/streval.3 - exec - ${STDCMP} 2>/dev/null -s man/streval.3 ${INSTALLROOT}/man/man3/streval.3 || { ${STDMV} ${INSTALLROOT}/man/man3/streval.3 ${INSTALLROOT}/man/man3/streval.3.old 2>/dev/null || true; ${STDCP} man/streval.3 ${INSTALLROOT}/man/man3/streval.3 ;} - done ${INSTALLROOT}/man/man3/streval.3 generated - make ${INSTALLROOT}/man/man3/strgid.3 - prev man/strgid.3 - exec - ${STDCMP} 2>/dev/null -s man/strgid.3 ${INSTALLROOT}/man/man3/strgid.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strgid.3 ${INSTALLROOT}/man/man3/strgid.3.old 2>/dev/null || true; ${STDCP} man/strgid.3 ${INSTALLROOT}/man/man3/strgid.3 ;} - done ${INSTALLROOT}/man/man3/strgid.3 generated - make ${INSTALLROOT}/man/man3/strmatch.3 - prev man/strmatch.3 - exec - ${STDCMP} 2>/dev/null -s man/strmatch.3 ${INSTALLROOT}/man/man3/strmatch.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strmatch.3 ${INSTALLROOT}/man/man3/strmatch.3.old 2>/dev/null || true; ${STDCP} man/strmatch.3 ${INSTALLROOT}/man/man3/strmatch.3 ;} - done ${INSTALLROOT}/man/man3/strmatch.3 generated - make ${INSTALLROOT}/man/man3/stropt.3 - prev man/stropt.3 - exec - ${STDCMP} 2>/dev/null -s man/stropt.3 ${INSTALLROOT}/man/man3/stropt.3 || { ${STDMV} ${INSTALLROOT}/man/man3/stropt.3 ${INSTALLROOT}/man/man3/stropt.3.old 2>/dev/null || true; ${STDCP} man/stropt.3 ${INSTALLROOT}/man/man3/stropt.3 ;} - done ${INSTALLROOT}/man/man3/stropt.3 generated - make ${INSTALLROOT}/man/man3/strperm.3 - prev man/strperm.3 - exec - ${STDCMP} 2>/dev/null -s man/strperm.3 ${INSTALLROOT}/man/man3/strperm.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strperm.3 ${INSTALLROOT}/man/man3/strperm.3.old 2>/dev/null || true; ${STDCP} man/strperm.3 ${INSTALLROOT}/man/man3/strperm.3 ;} - done ${INSTALLROOT}/man/man3/strperm.3 generated - make ${INSTALLROOT}/man/man3/strsignal.3 - prev man/strsignal.3 - exec - ${STDCMP} 2>/dev/null -s man/strsignal.3 ${INSTALLROOT}/man/man3/strsignal.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strsignal.3 ${INSTALLROOT}/man/man3/strsignal.3.old 2>/dev/null || true; ${STDCP} man/strsignal.3 ${INSTALLROOT}/man/man3/strsignal.3 ;} - done ${INSTALLROOT}/man/man3/strsignal.3 generated - make ${INSTALLROOT}/man/man3/strsort.3 - prev man/strsort.3 - exec - ${STDCMP} 2>/dev/null -s man/strsort.3 ${INSTALLROOT}/man/man3/strsort.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strsort.3 ${INSTALLROOT}/man/man3/strsort.3.old 2>/dev/null || true; ${STDCP} man/strsort.3 ${INSTALLROOT}/man/man3/strsort.3 ;} - done ${INSTALLROOT}/man/man3/strsort.3 generated - make ${INSTALLROOT}/man/man3/strtape.3 - prev man/strtape.3 - exec - ${STDCMP} 2>/dev/null -s man/strtape.3 ${INSTALLROOT}/man/man3/strtape.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strtape.3 ${INSTALLROOT}/man/man3/strtape.3.old 2>/dev/null || true; ${STDCP} man/strtape.3 ${INSTALLROOT}/man/man3/strtape.3 ;} - done ${INSTALLROOT}/man/man3/strtape.3 generated - make ${INSTALLROOT}/man/man3/strton.3 - prev man/strton.3 - exec - ${STDCMP} 2>/dev/null -s man/strton.3 ${INSTALLROOT}/man/man3/strton.3 || { ${STDMV} ${INSTALLROOT}/man/man3/strton.3 ${INSTALLROOT}/man/man3/strton.3.old 2>/dev/null || true; ${STDCP} man/strton.3 ${INSTALLROOT}/man/man3/strton.3 ;} - done ${INSTALLROOT}/man/man3/strton.3 generated - make ${INSTALLROOT}/man/man3/struid.3 - prev man/struid.3 - exec - ${STDCMP} 2>/dev/null -s man/struid.3 ${INSTALLROOT}/man/man3/struid.3 || { ${STDMV} ${INSTALLROOT}/man/man3/struid.3 ${INSTALLROOT}/man/man3/struid.3.old 2>/dev/null || true; ${STDCP} man/struid.3 ${INSTALLROOT}/man/man3/struid.3 ;} - done ${INSTALLROOT}/man/man3/struid.3 generated - make ${INSTALLROOT}/man/man3/swap.3 - prev man/swap.3 - exec - ${STDCMP} 2>/dev/null -s man/swap.3 ${INSTALLROOT}/man/man3/swap.3 || { ${STDMV} ${INSTALLROOT}/man/man3/swap.3 ${INSTALLROOT}/man/man3/swap.3.old 2>/dev/null || true; ${STDCP} man/swap.3 ${INSTALLROOT}/man/man3/swap.3 ;} - done ${INSTALLROOT}/man/man3/swap.3 generated - make ${INSTALLROOT}/man/man3/tab.3 - prev man/tab.3 - exec - ${STDCMP} 2>/dev/null -s man/tab.3 ${INSTALLROOT}/man/man3/tab.3 || { ${STDMV} ${INSTALLROOT}/man/man3/tab.3 ${INSTALLROOT}/man/man3/tab.3.old 2>/dev/null || true; ${STDCP} man/tab.3 ${INSTALLROOT}/man/man3/tab.3 ;} - done ${INSTALLROOT}/man/man3/tab.3 generated - make ${INSTALLROOT}/man/man3/tm.3 - prev man/tm.3 - exec - ${STDCMP} 2>/dev/null -s man/tm.3 ${INSTALLROOT}/man/man3/tm.3 || { ${STDMV} ${INSTALLROOT}/man/man3/tm.3 ${INSTALLROOT}/man/man3/tm.3.old 2>/dev/null || true; ${STDCP} man/tm.3 ${INSTALLROOT}/man/man3/tm.3 ;} - done ${INSTALLROOT}/man/man3/tm.3 generated - make ${INSTALLROOT}/man/man3/tmx.3 - prev man/tmx.3 - exec - ${STDCMP} 2>/dev/null -s man/tmx.3 ${INSTALLROOT}/man/man3/tmx.3 || { ${STDMV} ${INSTALLROOT}/man/man3/tmx.3 ${INSTALLROOT}/man/man3/tmx.3.old 2>/dev/null || true; ${STDCP} man/tmx.3 ${INSTALLROOT}/man/man3/tmx.3 ;} - done ${INSTALLROOT}/man/man3/tmx.3 generated - make ${INSTALLROOT}/man/man3/tok.3 - prev man/tok.3 - exec - ${STDCMP} 2>/dev/null -s man/tok.3 ${INSTALLROOT}/man/man3/tok.3 || { ${STDMV} ${INSTALLROOT}/man/man3/tok.3 ${INSTALLROOT}/man/man3/tok.3.old 2>/dev/null || true; ${STDCP} man/tok.3 ${INSTALLROOT}/man/man3/tok.3 ;} - done ${INSTALLROOT}/man/man3/tok.3 generated - make ${INSTALLROOT}/man/man3/touch.3 - prev man/touch.3 - exec - ${STDCMP} 2>/dev/null -s man/touch.3 ${INSTALLROOT}/man/man3/touch.3 || { ${STDMV} ${INSTALLROOT}/man/man3/touch.3 ${INSTALLROOT}/man/man3/touch.3.old 2>/dev/null || true; ${STDCP} man/touch.3 ${INSTALLROOT}/man/man3/touch.3 ;} - done ${INSTALLROOT}/man/man3/touch.3 generated - make ${INSTALLROOT}/man/man3/tv.3 - prev man/tv.3 - exec - ${STDCMP} 2>/dev/null -s man/tv.3 ${INSTALLROOT}/man/man3/tv.3 || { ${STDMV} ${INSTALLROOT}/man/man3/tv.3 ${INSTALLROOT}/man/man3/tv.3.old 2>/dev/null || true; ${STDCP} man/tv.3 ${INSTALLROOT}/man/man3/tv.3 ;} - done ${INSTALLROOT}/man/man3/tv.3 generated - make ${INSTALLROOT}/man/man3/vecargs.3 - prev man/vecargs.3 - exec - ${STDCMP} 2>/dev/null -s man/vecargs.3 ${INSTALLROOT}/man/man3/vecargs.3 || { ${STDMV} ${INSTALLROOT}/man/man3/vecargs.3 ${INSTALLROOT}/man/man3/vecargs.3.old 2>/dev/null || true; ${STDCP} man/vecargs.3 ${INSTALLROOT}/man/man3/vecargs.3 ;} - done ${INSTALLROOT}/man/man3/vecargs.3 generated - make ${INSTALLROOT}/man/man3/vmalloc.3 - prev man/vmalloc.3 - exec - ${STDCMP} 2>/dev/null -s man/vmalloc.3 ${INSTALLROOT}/man/man3/vmalloc.3 || { ${STDMV} ${INSTALLROOT}/man/man3/vmalloc.3 ${INSTALLROOT}/man/man3/vmalloc.3.old 2>/dev/null || true; ${STDCP} man/vmalloc.3 ${INSTALLROOT}/man/man3/vmalloc.3 ;} - done ${INSTALLROOT}/man/man3/vmalloc.3 generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + prev ast.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED}' + exec - dylink -m ast -v ${DYLIB_VERSION} -s ${mam_cc_SUFFIX_SHARED} $(sed 1d ast.req) ${_libast_object_files_} + done + + note * + note * pre-install libast in $INSTALLROOT + note * + + note * ensure preinstallation directories exist + loop DIR include/ast lib/lib lib/file man/man3 + make ${INSTALLROOT}/${DIR} + exec - mkdir -p ${@} + done + done + + note * the library and dependency information + make ${INSTALLROOT}/lib/libast.a + prev libast.a + exec - cp -f ${<} ${@} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done make ${INSTALLROOT}/lib/lib/ast - prev ${INSTALLROOT}/lib/lib prev ast.req - exec - ${STDCMP} 2>/dev/null -s ast.req ${INSTALLROOT}/lib/lib/ast || { ${STDMV} ${INSTALLROOT}/lib/lib/ast ${INSTALLROOT}/lib/lib/ast.old 2>/dev/null || true; ${STDCP} ast.req ${INSTALLROOT}/lib/lib/ast ;} - done ${INSTALLROOT}/lib/lib/ast generated - make ${INSTALLROOT}/include/ast - exec - if test ! -d ${INSTALLROOT}/include/ast - exec - then mkdir -p ${INSTALLROOT}/include/ast - exec - fi - done ${INSTALLROOT}/include/ast generated - make ${INSTALLROOT}/include/ast/ast_common.h - prev ${INSTALLROOT}/include/ast - prev ast_common.h - exec - if ! ${STDCMP} -s ast_common.h ${INSTALLROOT}/include/ast/ast_common.h - exec - then ${STDCP} ast_common.h ${INSTALLROOT}/include/ast/ast_common.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_common.h generated - make ${INSTALLROOT}/include/ast/ast.h - prev include/ast.h - exec - if ! ${STDCMP} -s include/ast.h ${INSTALLROOT}/include/ast/ast.h - exec - then ${STDCP} include/ast.h ${INSTALLROOT}/include/ast/ast.h - exec - fi - done ${INSTALLROOT}/include/ast/ast.h generated - make ${INSTALLROOT}/include/ast/ast_dir.h - prev include/ast_dir.h - exec - if ! ${STDCMP} -s include/ast_dir.h ${INSTALLROOT}/include/ast/ast_dir.h - exec - then ${STDCP} include/ast_dir.h ${INSTALLROOT}/include/ast/ast_dir.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_dir.h generated - make ${INSTALLROOT}/include/ast/ast_getopt.h - prev include/ast_getopt.h - exec - if ! ${STDCMP} -s include/ast_getopt.h ${INSTALLROOT}/include/ast/ast_getopt.h - exec - then ${STDCP} include/ast_getopt.h ${INSTALLROOT}/include/ast/ast_getopt.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_getopt.h generated - make ${INSTALLROOT}/include/ast/ast_std.h - prev include/ast_std.h - exec - if ! ${STDCMP} -s include/ast_std.h ${INSTALLROOT}/include/ast/ast_std.h - exec - then ${STDCP} include/ast_std.h ${INSTALLROOT}/include/ast/ast_std.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_std.h generated - make ${INSTALLROOT}/include/ast/ast_namval.h - prev ast_namval.h - exec - if ! ${STDCMP} -s ast_namval.h ${INSTALLROOT}/include/ast/ast_namval.h - exec - then ${STDCP} ast_namval.h ${INSTALLROOT}/include/ast/ast_namval.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_namval.h generated - make ${INSTALLROOT}/include/ast/ast_windows.h - prev include/ast_windows.h - exec - if ! ${STDCMP} -s include/ast_windows.h ${INSTALLROOT}/include/ast/ast_windows.h - exec - then ${STDCP} include/ast_windows.h ${INSTALLROOT}/include/ast/ast_windows.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_windows.h generated - make ${INSTALLROOT}/include/ast/ccode.h - prev include/ccode.h - exec - if ! ${STDCMP} -s include/ccode.h ${INSTALLROOT}/include/ast/ccode.h - exec - then ${STDCP} include/ccode.h ${INSTALLROOT}/include/ast/ccode.h - exec - fi - done ${INSTALLROOT}/include/ast/ccode.h generated - make ${INSTALLROOT}/include/ast/cdt.h - prev include/cdt.h - exec - if ! ${STDCMP} -s include/cdt.h ${INSTALLROOT}/include/ast/cdt.h - exec - then ${STDCP} include/cdt.h ${INSTALLROOT}/include/ast/cdt.h - exec - fi - done ${INSTALLROOT}/include/ast/cdt.h generated - make ${INSTALLROOT}/include/ast/cdtlib.h - prev cdt/cdtlib.h - exec - if ! ${STDCMP} -s cdt/cdtlib.h ${INSTALLROOT}/include/ast/cdtlib.h - exec - then ${STDCP} cdt/cdtlib.h ${INSTALLROOT}/include/ast/cdtlib.h - exec - fi - done ${INSTALLROOT}/include/ast/cdtlib.h generated - make ${INSTALLROOT}/include/ast/cmdarg.h - prev include/cmdarg.h - exec - if ! ${STDCMP} -s include/cmdarg.h ${INSTALLROOT}/include/ast/cmdarg.h - exec - then ${STDCP} include/cmdarg.h ${INSTALLROOT}/include/ast/cmdarg.h - exec - fi - done ${INSTALLROOT}/include/ast/cmdarg.h generated - make ${INSTALLROOT}/include/ast/debug.h - prev include/debug.h - exec - if ! ${STDCMP} -s include/debug.h ${INSTALLROOT}/include/ast/debug.h - exec - then ${STDCP} include/debug.h ${INSTALLROOT}/include/ast/debug.h - exec - fi - done ${INSTALLROOT}/include/ast/debug.h generated - make ${INSTALLROOT}/include/ast/dt.h - prev include/dt.h - exec - if ! ${STDCMP} -s include/dt.h ${INSTALLROOT}/include/ast/dt.h - exec - then ${STDCP} include/dt.h ${INSTALLROOT}/include/ast/dt.h - exec - fi - done ${INSTALLROOT}/include/ast/dt.h generated - make ${INSTALLROOT}/include/ast/error.h - prev include/error.h - exec - if ! ${STDCMP} -s include/error.h ${INSTALLROOT}/include/ast/error.h - exec - then ${STDCP} include/error.h ${INSTALLROOT}/include/ast/error.h - exec - fi - done ${INSTALLROOT}/include/ast/error.h generated - make ${INSTALLROOT}/include/ast/find.h - prev include/find.h - exec - if ! ${STDCMP} -s include/find.h ${INSTALLROOT}/include/ast/find.h - exec - then ${STDCP} include/find.h ${INSTALLROOT}/include/ast/find.h - exec - fi - done ${INSTALLROOT}/include/ast/find.h generated - make ${INSTALLROOT}/include/ast/ftw.h - prev comp/ftw.h - exec - if ! ${STDCMP} -s comp/ftw.h ${INSTALLROOT}/include/ast/ftw.h - exec - then ${STDCP} comp/ftw.h ${INSTALLROOT}/include/ast/ftw.h - exec - fi - done ${INSTALLROOT}/include/ast/ftw.h generated - make ${INSTALLROOT}/include/ast/ftwalk.h - prev include/ftwalk.h - exec - if ! ${STDCMP} -s include/ftwalk.h ${INSTALLROOT}/include/ast/ftwalk.h - exec - then ${STDCP} include/ftwalk.h ${INSTALLROOT}/include/ast/ftwalk.h - exec - fi - done ${INSTALLROOT}/include/ast/ftwalk.h generated - make ${INSTALLROOT}/include/ast/fts.h - prev include/fts.h - exec - if ! ${STDCMP} -s include/fts.h ${INSTALLROOT}/include/ast/fts.h - exec - then ${STDCP} include/fts.h ${INSTALLROOT}/include/ast/fts.h - exec - fi - done ${INSTALLROOT}/include/ast/fts.h generated - make ${INSTALLROOT}/include/ast/getopt.h - prev comp/getopt.h - exec - if ! ${STDCMP} -s comp/getopt.h ${INSTALLROOT}/include/ast/getopt.h - exec - then ${STDCP} comp/getopt.h ${INSTALLROOT}/include/ast/getopt.h - exec - fi - done ${INSTALLROOT}/include/ast/getopt.h generated - make ${INSTALLROOT}/include/ast/glob.h - prev include/glob.h - exec - if ! ${STDCMP} -s include/glob.h ${INSTALLROOT}/include/ast/glob.h - exec - then ${STDCP} include/glob.h ${INSTALLROOT}/include/ast/glob.h - exec - fi - done ${INSTALLROOT}/include/ast/glob.h generated - make ${INSTALLROOT}/include/ast/hash.h - prev include/hash.h - exec - if ! ${STDCMP} -s include/hash.h ${INSTALLROOT}/include/ast/hash.h - exec - then ${STDCP} include/hash.h ${INSTALLROOT}/include/ast/hash.h - exec - fi - done ${INSTALLROOT}/include/ast/hash.h generated - make ${INSTALLROOT}/include/ast/hashkey.h - prev include/hashkey.h - exec - if ! ${STDCMP} -s include/hashkey.h ${INSTALLROOT}/include/ast/hashkey.h - exec - then ${STDCP} include/hashkey.h ${INSTALLROOT}/include/ast/hashkey.h - exec - fi - done ${INSTALLROOT}/include/ast/hashkey.h generated - make ${INSTALLROOT}/include/ast/hashpart.h - prev include/hashpart.h - exec - if ! ${STDCMP} -s include/hashpart.h ${INSTALLROOT}/include/ast/hashpart.h - exec - then ${STDCP} include/hashpart.h ${INSTALLROOT}/include/ast/hashpart.h - exec - fi - done ${INSTALLROOT}/include/ast/hashpart.h generated - make ${INSTALLROOT}/include/ast/ip6.h - prev include/ip6.h - exec - if ! ${STDCMP} -s include/ip6.h ${INSTALLROOT}/include/ast/ip6.h - exec - then ${STDCP} include/ip6.h ${INSTALLROOT}/include/ast/ip6.h - exec - fi - done ${INSTALLROOT}/include/ast/ip6.h generated - make ${INSTALLROOT}/include/ast/lc.h - prev lc.h - exec - if ! ${STDCMP} -s lc.h ${INSTALLROOT}/include/ast/lc.h - exec - then ${STDCP} lc.h ${INSTALLROOT}/include/ast/lc.h - exec - fi - done ${INSTALLROOT}/include/ast/lc.h generated - make ${INSTALLROOT}/include/ast/ls.h - prev include/ls.h - exec - if ! ${STDCMP} -s include/ls.h ${INSTALLROOT}/include/ast/ls.h - exec - then ${STDCP} include/ls.h ${INSTALLROOT}/include/ast/ls.h - exec - fi - done ${INSTALLROOT}/include/ast/ls.h generated - make ${INSTALLROOT}/include/ast/magic.h - prev include/magic.h - exec - if ! ${STDCMP} -s include/magic.h ${INSTALLROOT}/include/ast/magic.h - exec - then ${STDCP} include/magic.h ${INSTALLROOT}/include/ast/magic.h - exec - fi - done ${INSTALLROOT}/include/ast/magic.h generated - make ${INSTALLROOT}/include/ast/mc.h - prev include/mc.h - exec - if ! ${STDCMP} -s include/mc.h ${INSTALLROOT}/include/ast/mc.h - exec - then ${STDCP} include/mc.h ${INSTALLROOT}/include/ast/mc.h - exec - fi - done ${INSTALLROOT}/include/ast/mc.h generated - make ${INSTALLROOT}/include/ast/mime.h - prev include/mime.h - exec - if ! ${STDCMP} -s include/mime.h ${INSTALLROOT}/include/ast/mime.h - exec - then ${STDCP} include/mime.h ${INSTALLROOT}/include/ast/mime.h - exec - fi - done ${INSTALLROOT}/include/ast/mime.h generated - make ${INSTALLROOT}/include/ast/mnt.h - prev include/mnt.h - exec - if ! ${STDCMP} -s include/mnt.h ${INSTALLROOT}/include/ast/mnt.h - exec - then ${STDCP} include/mnt.h ${INSTALLROOT}/include/ast/mnt.h - exec - fi - done ${INSTALLROOT}/include/ast/mnt.h generated - make ${INSTALLROOT}/include/ast/modecanon.h - prev include/modecanon.h - exec - if ! ${STDCMP} -s include/modecanon.h ${INSTALLROOT}/include/ast/modecanon.h - exec - then ${STDCP} include/modecanon.h ${INSTALLROOT}/include/ast/modecanon.h - exec - fi - done ${INSTALLROOT}/include/ast/modecanon.h generated - make ${INSTALLROOT}/include/ast/modex.h - prev include/modex.h - exec - if ! ${STDCMP} -s include/modex.h ${INSTALLROOT}/include/ast/modex.h - exec - then ${STDCP} include/modex.h ${INSTALLROOT}/include/ast/modex.h - exec - fi - done ${INSTALLROOT}/include/ast/modex.h generated - make ${INSTALLROOT}/include/ast/namval.h - prev include/namval.h - exec - if ! ${STDCMP} -s include/namval.h ${INSTALLROOT}/include/ast/namval.h - exec - then ${STDCP} include/namval.h ${INSTALLROOT}/include/ast/namval.h - exec - fi - done ${INSTALLROOT}/include/ast/namval.h generated - make ${INSTALLROOT}/include/ast/option.h - prev include/option.h - exec - if ! ${STDCMP} -s include/option.h ${INSTALLROOT}/include/ast/option.h - exec - then ${STDCP} include/option.h ${INSTALLROOT}/include/ast/option.h - exec - fi - done ${INSTALLROOT}/include/ast/option.h generated - make ${INSTALLROOT}/include/ast/proc.h - prev include/proc.h - exec - if ! ${STDCMP} -s include/proc.h ${INSTALLROOT}/include/ast/proc.h - exec - then ${STDCP} include/proc.h ${INSTALLROOT}/include/ast/proc.h - exec - fi - done ${INSTALLROOT}/include/ast/proc.h generated - make ${INSTALLROOT}/include/ast/re_comp.h - prev comp/re_comp.h - exec - if ! ${STDCMP} -s comp/re_comp.h ${INSTALLROOT}/include/ast/re_comp.h - exec - then ${STDCP} comp/re_comp.h ${INSTALLROOT}/include/ast/re_comp.h - exec - fi - done ${INSTALLROOT}/include/ast/re_comp.h generated - make ${INSTALLROOT}/include/ast/recfmt.h - prev include/recfmt.h - exec - if ! ${STDCMP} -s include/recfmt.h ${INSTALLROOT}/include/ast/recfmt.h - exec - then ${STDCP} include/recfmt.h ${INSTALLROOT}/include/ast/recfmt.h - exec - fi - done ${INSTALLROOT}/include/ast/recfmt.h generated - make ${INSTALLROOT}/include/ast/regex.h - prev include/regex.h - exec - if ! ${STDCMP} -s include/regex.h ${INSTALLROOT}/include/ast/regex.h - exec - then ${STDCP} include/regex.h ${INSTALLROOT}/include/ast/regex.h - exec - fi - done ${INSTALLROOT}/include/ast/regex.h generated - make ${INSTALLROOT}/include/ast/regexp.h - prev comp/regexp.h - exec - if ! ${STDCMP} -s comp/regexp.h ${INSTALLROOT}/include/ast/regexp.h - exec - then ${STDCP} comp/regexp.h ${INSTALLROOT}/include/ast/regexp.h - exec - fi - done ${INSTALLROOT}/include/ast/regexp.h generated - make ${INSTALLROOT}/include/ast/sfio.h - prev include/sfio.h - exec - if ! ${STDCMP} -s include/sfio.h ${INSTALLROOT}/include/ast/sfio.h - exec - then ${STDCP} include/sfio.h ${INSTALLROOT}/include/ast/sfio.h - exec - fi - done ${INSTALLROOT}/include/ast/sfio.h generated - make ${INSTALLROOT}/include/ast/sfio_s.h - prev include/sfio_s.h - exec - if ! ${STDCMP} -s include/sfio_s.h ${INSTALLROOT}/include/ast/sfio_s.h - exec - then ${STDCP} include/sfio_s.h ${INSTALLROOT}/include/ast/sfio_s.h - exec - fi - done ${INSTALLROOT}/include/ast/sfio_s.h generated - make ${INSTALLROOT}/include/ast/sfio_t.h - prev include/sfio_t.h - exec - if ! ${STDCMP} -s include/sfio_t.h ${INSTALLROOT}/include/ast/sfio_t.h - exec - then ${STDCP} include/sfio_t.h ${INSTALLROOT}/include/ast/sfio_t.h - exec - fi - done ${INSTALLROOT}/include/ast/sfio_t.h generated - make ${INSTALLROOT}/include/ast/sfdisc.h - prev include/sfdisc.h - exec - if ! ${STDCMP} -s include/sfdisc.h ${INSTALLROOT}/include/ast/sfdisc.h - exec - then ${STDCP} include/sfdisc.h ${INSTALLROOT}/include/ast/sfdisc.h - exec - fi - done ${INSTALLROOT}/include/ast/sfdisc.h generated - make ${INSTALLROOT}/include/ast/shcmd.h - prev include/shcmd.h - exec - if ! ${STDCMP} -s include/shcmd.h ${INSTALLROOT}/include/ast/shcmd.h - exec - then ${STDCP} include/shcmd.h ${INSTALLROOT}/include/ast/shcmd.h - exec - fi - done ${INSTALLROOT}/include/ast/shcmd.h generated - make ${INSTALLROOT}/include/ast/stack.h - prev include/stack.h - exec - if ! ${STDCMP} -s include/stack.h ${INSTALLROOT}/include/ast/stack.h - exec - then ${STDCP} include/stack.h ${INSTALLROOT}/include/ast/stack.h - exec - fi - done ${INSTALLROOT}/include/ast/stack.h generated - make ${INSTALLROOT}/include/ast/stk.h - prev include/stk.h - exec - if ! ${STDCMP} -s include/stk.h ${INSTALLROOT}/include/ast/stk.h - exec - then ${STDCP} include/stk.h ${INSTALLROOT}/include/ast/stk.h - exec - fi - done ${INSTALLROOT}/include/ast/stk.h generated - make ${INSTALLROOT}/include/ast/swap.h - prev include/swap.h - exec - if ! ${STDCMP} -s include/swap.h ${INSTALLROOT}/include/ast/swap.h - exec - then ${STDCP} include/swap.h ${INSTALLROOT}/include/ast/swap.h - exec - fi - done ${INSTALLROOT}/include/ast/swap.h generated - make ${INSTALLROOT}/include/ast/tar.h - prev include/tar.h - exec - if ! ${STDCMP} -s include/tar.h ${INSTALLROOT}/include/ast/tar.h - exec - then ${STDCP} include/tar.h ${INSTALLROOT}/include/ast/tar.h - exec - fi - done ${INSTALLROOT}/include/ast/tar.h generated - make ${INSTALLROOT}/include/ast/times.h - prev include/times.h - exec - if ! ${STDCMP} -s include/times.h ${INSTALLROOT}/include/ast/times.h - exec - then ${STDCP} include/times.h ${INSTALLROOT}/include/ast/times.h - exec - fi - done ${INSTALLROOT}/include/ast/times.h generated - make ${INSTALLROOT}/include/ast/tm.h - prev include/tm.h - exec - if ! ${STDCMP} -s include/tm.h ${INSTALLROOT}/include/ast/tm.h - exec - then ${STDCP} include/tm.h ${INSTALLROOT}/include/ast/tm.h - exec - fi - done ${INSTALLROOT}/include/ast/tm.h generated - make ${INSTALLROOT}/include/ast/tok.h - prev include/tok.h - exec - if ! ${STDCMP} -s include/tok.h ${INSTALLROOT}/include/ast/tok.h - exec - then ${STDCP} include/tok.h ${INSTALLROOT}/include/ast/tok.h - exec - fi - done ${INSTALLROOT}/include/ast/tok.h generated - make ${INSTALLROOT}/include/ast/usage.h - prev include/usage.h - exec - if ! ${STDCMP} -s include/usage.h ${INSTALLROOT}/include/ast/usage.h - exec - then ${STDCP} include/usage.h ${INSTALLROOT}/include/ast/usage.h - exec - fi - done ${INSTALLROOT}/include/ast/usage.h generated - make ${INSTALLROOT}/include/ast/vdb.h - prev include/vdb.h - exec - if ! ${STDCMP} -s include/vdb.h ${INSTALLROOT}/include/ast/vdb.h - exec - then ${STDCP} include/vdb.h ${INSTALLROOT}/include/ast/vdb.h - exec - fi - done ${INSTALLROOT}/include/ast/vdb.h generated - make ${INSTALLROOT}/include/ast/vecargs.h - prev include/vecargs.h - exec - if ! ${STDCMP} -s include/vecargs.h ${INSTALLROOT}/include/ast/vecargs.h - exec - then ${STDCP} include/vecargs.h ${INSTALLROOT}/include/ast/vecargs.h - exec - fi - done ${INSTALLROOT}/include/ast/vecargs.h generated - make ${INSTALLROOT}/include/ast/vmalloc.h - prev include/vmalloc.h - exec - if ! ${STDCMP} -s include/vmalloc.h ${INSTALLROOT}/include/ast/vmalloc.h - exec - then ${STDCP} include/vmalloc.h ${INSTALLROOT}/include/ast/vmalloc.h - exec - fi - done ${INSTALLROOT}/include/ast/vmalloc.h generated - make ${INSTALLROOT}/include/ast/wait.h - prev include/wait.h - exec - if ! ${STDCMP} -s include/wait.h ${INSTALLROOT}/include/ast/wait.h - exec - then ${STDCP} include/wait.h ${INSTALLROOT}/include/ast/wait.h - exec - fi - done ${INSTALLROOT}/include/ast/wait.h generated - make ${INSTALLROOT}/include/ast/wordexp.h - prev comp/wordexp.h - exec - if ! ${STDCMP} -s comp/wordexp.h ${INSTALLROOT}/include/ast/wordexp.h - exec - then ${STDCP} comp/wordexp.h ${INSTALLROOT}/include/ast/wordexp.h - exec - fi - done ${INSTALLROOT}/include/ast/wordexp.h generated - make ${INSTALLROOT}/include/ast/bytesex.h - prev std/bytesex.h - exec - if ! ${STDCMP} -s std/bytesex.h ${INSTALLROOT}/include/ast/bytesex.h - exec - then ${STDCP} std/bytesex.h ${INSTALLROOT}/include/ast/bytesex.h - exec - fi - done ${INSTALLROOT}/include/ast/bytesex.h generated - make ${INSTALLROOT}/include/ast/endian.h - prev std/endian.h - exec - if ! ${STDCMP} -s std/endian.h ${INSTALLROOT}/include/ast/endian.h - exec - then ${STDCP} std/endian.h ${INSTALLROOT}/include/ast/endian.h - exec - fi - done ${INSTALLROOT}/include/ast/endian.h generated - make ${INSTALLROOT}/include/ast/fnmatch.h - prev comp/fnmatch.h - exec - if ! ${STDCMP} -s comp/fnmatch.h ${INSTALLROOT}/include/ast/fnmatch.h - exec - then ${STDCP} comp/fnmatch.h ${INSTALLROOT}/include/ast/fnmatch.h - exec - fi - done ${INSTALLROOT}/include/ast/fnmatch.h generated - make ${INSTALLROOT}/include/ast/magicid.h - make include/magicid.h - prev ast_common.h - done include/magicid.h - exec - if ! ${STDCMP} -s include/magicid.h ${INSTALLROOT}/include/ast/magicid.h - exec - then ${STDCP} include/magicid.h ${INSTALLROOT}/include/ast/magicid.h - exec - fi - done ${INSTALLROOT}/include/ast/magicid.h generated - make ${INSTALLROOT}/include/ast/fnv.h - prev include/fnv.h - exec - if ! ${STDCMP} -s include/fnv.h ${INSTALLROOT}/include/ast/fnv.h - exec - then ${STDCP} include/fnv.h ${INSTALLROOT}/include/ast/fnv.h - exec - fi - done ${INSTALLROOT}/include/ast/fnv.h generated - make ${INSTALLROOT}/include/ast/aso.h - prev include/aso.h - exec - if ! ${STDCMP} -s include/aso.h ${INSTALLROOT}/include/ast/aso.h - exec - then ${STDCP} include/aso.h ${INSTALLROOT}/include/ast/aso.h - exec - fi - done ${INSTALLROOT}/include/ast/aso.h generated - make ${INSTALLROOT}/include/ast/dirent.h - prev std/dirent.h - exec - if ! ${STDCMP} -s std/dirent.h ${INSTALLROOT}/include/ast/dirent.h - exec - then ${STDCP} std/dirent.h ${INSTALLROOT}/include/ast/dirent.h - exec - fi - done ${INSTALLROOT}/include/ast/dirent.h generated - make ${INSTALLROOT}/include/ast/iconv.h - prev std/iconv.h - exec - if ! ${STDCMP} -s std/iconv.h ${INSTALLROOT}/include/ast/iconv.h - exec - then ${STDCP} std/iconv.h ${INSTALLROOT}/include/ast/iconv.h - exec - fi - done ${INSTALLROOT}/include/ast/iconv.h generated - make ${INSTALLROOT}/include/ast/nl_types.h - prev std/nl_types.h - exec - if ! ${STDCMP} -s std/nl_types.h ${INSTALLROOT}/include/ast/nl_types.h - exec - then ${STDCP} std/nl_types.h ${INSTALLROOT}/include/ast/nl_types.h - exec - fi - done ${INSTALLROOT}/include/ast/nl_types.h generated - make ${INSTALLROOT}/include/ast/stdio.h - prev std/stdio.h - exec - if ! ${STDCMP} -s std/stdio.h ${INSTALLROOT}/include/ast/stdio.h - exec - then ${STDCP} std/stdio.h ${INSTALLROOT}/include/ast/stdio.h - exec - fi - done ${INSTALLROOT}/include/ast/stdio.h generated - make ${INSTALLROOT}/include/ast/wchar.h - prev std/wchar.h - exec - if ! ${STDCMP} -s std/wchar.h ${INSTALLROOT}/include/ast/wchar.h - exec - then ${STDCP} std/wchar.h ${INSTALLROOT}/include/ast/wchar.h - exec - fi - done ${INSTALLROOT}/include/ast/wchar.h generated - make ${INSTALLROOT}/include/ast/wctype.h - prev std/wctype.h - exec - if ! ${STDCMP} -s std/wctype.h ${INSTALLROOT}/include/ast/wctype.h - exec - then ${STDCP} std/wctype.h ${INSTALLROOT}/include/ast/wctype.h - exec - fi - done ${INSTALLROOT}/include/ast/wctype.h generated - make ${INSTALLROOT}/include/ast/align.h - prev align.h - exec - if ! ${STDCMP} -s align.h ${INSTALLROOT}/include/ast/align.h - exec - then ${STDCP} align.h ${INSTALLROOT}/include/ast/align.h - exec - fi - done ${INSTALLROOT}/include/ast/align.h generated - make ${INSTALLROOT}/include/ast/sig.h - prev sig.h - exec - if ! ${STDCMP} -s sig.h ${INSTALLROOT}/include/ast/sig.h - exec - then ${STDCP} sig.h ${INSTALLROOT}/include/ast/sig.h - exec - fi - done ${INSTALLROOT}/include/ast/sig.h generated - make ${INSTALLROOT}/include/ast/tmx.h - prev tmx.h - exec - if ! ${STDCMP} -s tmx.h ${INSTALLROOT}/include/ast/tmx.h - exec - then ${STDCP} tmx.h ${INSTALLROOT}/include/ast/tmx.h - exec - fi - done ${INSTALLROOT}/include/ast/tmx.h generated - make ${INSTALLROOT}/include/ast/tv.h - prev tv.h - exec - if ! ${STDCMP} -s tv.h ${INSTALLROOT}/include/ast/tv.h - exec - then ${STDCP} tv.h ${INSTALLROOT}/include/ast/tv.h - exec - fi - done ${INSTALLROOT}/include/ast/tv.h generated - make ${INSTALLROOT}/include/ast/ast_api.h - prev ast_api.h - exec - if ! ${STDCMP} -s ast_api.h ${INSTALLROOT}/include/ast/ast_api.h - exec - then ${STDCP} ast_api.h ${INSTALLROOT}/include/ast/ast_api.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_api.h generated - make ${INSTALLROOT}/include/ast/ast_botch.h - prev ast_botch.h - exec - if ! ${STDCMP} -s ast_botch.h ${INSTALLROOT}/include/ast/ast_botch.h - exec - then ${STDCP} ast_botch.h ${INSTALLROOT}/include/ast/ast_botch.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_botch.h generated - make ${INSTALLROOT}/include/ast/ast_ccode.h - prev ast_ccode.h - exec - if ! ${STDCMP} -s ast_ccode.h ${INSTALLROOT}/include/ast/ast_ccode.h - exec - then ${STDCP} ast_ccode.h ${INSTALLROOT}/include/ast/ast_ccode.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_ccode.h generated - make ${INSTALLROOT}/include/ast/ast_fcntl.h - prev ast_fcntl.h - exec - if ! ${STDCMP} -s ast_fcntl.h ${INSTALLROOT}/include/ast/ast_fcntl.h - exec - then ${STDCP} ast_fcntl.h ${INSTALLROOT}/include/ast/ast_fcntl.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_fcntl.h generated - make ${INSTALLROOT}/include/ast/ast_float.h - make ast_float.h - prev FEATURE/float - exec - ${STDCMP} -s FEATURE/float ast_float.h || { ${STDRM} -f ast_float.h; ${STDCP} FEATURE/float ast_float.h; } - prev ast_common.h - done ast_float.h generated - exec - if ! ${STDCMP} -s ast_float.h ${INSTALLROOT}/include/ast/ast_float.h - exec - then ${STDCP} ast_float.h ${INSTALLROOT}/include/ast/ast_float.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_float.h generated - make ${INSTALLROOT}/include/ast/ast_fs.h - prev ast_fs.h - exec - if ! ${STDCMP} -s ast_fs.h ${INSTALLROOT}/include/ast/ast_fs.h - exec - then ${STDCP} ast_fs.h ${INSTALLROOT}/include/ast/ast_fs.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_fs.h generated - make ${INSTALLROOT}/include/ast/ast_lib.h - prev ast_lib.h - exec - if ! ${STDCMP} -s ast_lib.h ${INSTALLROOT}/include/ast/ast_lib.h - exec - then ${STDCP} ast_lib.h ${INSTALLROOT}/include/ast/ast_lib.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_lib.h generated - make ${INSTALLROOT}/include/ast/ast_map.h - prev ast_map.h - exec - if ! ${STDCMP} -s ast_map.h ${INSTALLROOT}/include/ast/ast_map.h - exec - then ${STDCP} ast_map.h ${INSTALLROOT}/include/ast/ast_map.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_map.h generated - make ${INSTALLROOT}/include/ast/ast_mmap.h - prev ast_mmap.h - exec - if ! ${STDCMP} -s ast_mmap.h ${INSTALLROOT}/include/ast/ast_mmap.h - exec - then ${STDCP} ast_mmap.h ${INSTALLROOT}/include/ast/ast_mmap.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_mmap.h generated - make ${INSTALLROOT}/include/ast/ast_mode.h - prev ast_mode.h - exec - if ! ${STDCMP} -s ast_mode.h ${INSTALLROOT}/include/ast/ast_mode.h - exec - then ${STDCP} ast_mode.h ${INSTALLROOT}/include/ast/ast_mode.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_mode.h generated - make ${INSTALLROOT}/include/ast/ast_ndbm.h - make ast_ndbm.h - make FEATURE/ndbm - prev features/ndbm - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/ndbm - prev std/stdio.h - done FEATURE/ndbm generated - exec - ${STDCMP} -s FEATURE/ndbm ast_ndbm.h || { ${STDRM} -f ast_ndbm.h; ${STDCP} FEATURE/ndbm ast_ndbm.h; } - done ast_ndbm.h generated - exec - if ! ${STDCMP} -s ast_ndbm.h ${INSTALLROOT}/include/ast/ast_ndbm.h - exec - then ${STDCP} ast_ndbm.h ${INSTALLROOT}/include/ast/ast_ndbm.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_ndbm.h generated - make ${INSTALLROOT}/include/ast/ast_param.h - prev ast_param.h - exec - if ! ${STDCMP} -s ast_param.h ${INSTALLROOT}/include/ast/ast_param.h - exec - then ${STDCP} ast_param.h ${INSTALLROOT}/include/ast/ast_param.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_param.h generated - make ${INSTALLROOT}/include/ast/ast_sys.h - prev ast_sys.h - exec - if ! ${STDCMP} -s ast_sys.h ${INSTALLROOT}/include/ast/ast_sys.h - exec - then ${STDCP} ast_sys.h ${INSTALLROOT}/include/ast/ast_sys.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_sys.h generated - make ${INSTALLROOT}/include/ast/ast_time.h - prev ast_time.h - exec - if ! ${STDCMP} -s ast_time.h ${INSTALLROOT}/include/ast/ast_time.h - exec - then ${STDCP} ast_time.h ${INSTALLROOT}/include/ast/ast_time.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_time.h generated - make ${INSTALLROOT}/include/ast/ast_tty.h - prev ast_tty.h - exec - if ! ${STDCMP} -s ast_tty.h ${INSTALLROOT}/include/ast/ast_tty.h - exec - then ${STDCP} ast_tty.h ${INSTALLROOT}/include/ast/ast_tty.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_tty.h generated - make ${INSTALLROOT}/include/ast/ast_wait.h - prev ast_wait.h - exec - if ! ${STDCMP} -s ast_wait.h ${INSTALLROOT}/include/ast/ast_wait.h - exec - then ${STDCP} ast_wait.h ${INSTALLROOT}/include/ast/ast_wait.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_wait.h generated - make ${INSTALLROOT}/include/ast/ast_limits.h - prev ast_limits.h - exec - if ! ${STDCMP} -s ast_limits.h ${INSTALLROOT}/include/ast/ast_limits.h - exec - then ${STDCP} ast_limits.h ${INSTALLROOT}/include/ast/ast_limits.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_limits.h generated - make ${INSTALLROOT}/include/ast/ast_standards.h - prev ast_standards.h - exec - if ! ${STDCMP} -s ast_standards.h ${INSTALLROOT}/include/ast/ast_standards.h - exec - then ${STDCP} ast_standards.h ${INSTALLROOT}/include/ast/ast_standards.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_standards.h generated - make ${INSTALLROOT}/include/ast/ast_sizeof.h - make ast_sizeof.h - make FEATURE/sizeof - prev features/sizeof - exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/sizeof - done FEATURE/sizeof generated - exec - ${STDCMP} -s FEATURE/sizeof ast_sizeof.h || { ${STDRM} -f ast_sizeof.h; ${STDCP} FEATURE/sizeof ast_sizeof.h; } - done ast_sizeof.h generated - exec - if ! ${STDCMP} -s ast_sizeof.h ${INSTALLROOT}/include/ast/ast_sizeof.h - exec - then ${STDCP} ast_sizeof.h ${INSTALLROOT}/include/ast/ast_sizeof.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_sizeof.h generated - make ${INSTALLROOT}/include/ast/ast_dirent.h - prev ast_dirent.h - exec - if ! ${STDCMP} -s ast_dirent.h ${INSTALLROOT}/include/ast/ast_dirent.h - exec - then ${STDCP} ast_dirent.h ${INSTALLROOT}/include/ast/ast_dirent.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_dirent.h generated - make ${INSTALLROOT}/include/ast/ast_iconv.h - prev ast_iconv.h - exec - if ! ${STDCMP} -s ast_iconv.h ${INSTALLROOT}/include/ast/ast_iconv.h - exec - then ${STDCP} ast_iconv.h ${INSTALLROOT}/include/ast/ast_iconv.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_iconv.h generated - make ${INSTALLROOT}/include/ast/ast_nl_types.h - prev ast_nl_types.h - exec - if ! ${STDCMP} -s ast_nl_types.h ${INSTALLROOT}/include/ast/ast_nl_types.h - exec - then ${STDCP} ast_nl_types.h ${INSTALLROOT}/include/ast/ast_nl_types.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_nl_types.h generated - make ${INSTALLROOT}/include/ast/ast_stdio.h - prev ast_stdio.h - exec - if ! ${STDCMP} -s ast_stdio.h ${INSTALLROOT}/include/ast/ast_stdio.h - exec - then ${STDCP} ast_stdio.h ${INSTALLROOT}/include/ast/ast_stdio.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_stdio.h generated - make ${INSTALLROOT}/include/ast/ast_wchar.h - prev ast_wchar.h - exec - if ! ${STDCMP} -s ast_wchar.h ${INSTALLROOT}/include/ast/ast_wchar.h - exec - then ${STDCP} ast_wchar.h ${INSTALLROOT}/include/ast/ast_wchar.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_wchar.h generated - make ${INSTALLROOT}/include/ast/ast_wctype.h - prev ast_wctype.h - exec - if ! ${STDCMP} -s ast_wctype.h ${INSTALLROOT}/include/ast/ast_wctype.h - exec - then ${STDCP} ast_wctype.h ${INSTALLROOT}/include/ast/ast_wctype.h - exec - fi - done ${INSTALLROOT}/include/ast/ast_wctype.h generated - make ${INSTALLROOT}/lib/file - exec - if test ! -d ${INSTALLROOT}/lib/file - exec - then mkdir -p ${INSTALLROOT}/lib/file - exec - fi - done ${INSTALLROOT}/lib/file generated + exec - cp -f ${<} ${@} + done + + note * section 3 manual pages + loop SECT3MAN LIBAST aso ast cdt chr compat error find fmt fmtls ftwalk getcwd hash iblocks int ip6 magic mem mime modecanon optget path proc re regex setenviron sfio sig spawnveg stk strcopy strdup strelapsed strerror stresc streval strgid strmatch stropt strperm strsignal strsort strtape strton struid swap tab tm tmx tok touch tv vmalloc + make ${INSTALLROOT}/man/man3/${SECT3MAN}.3 + prev man/${SECT3MAN}.3 + exec - cp -f ${<} ${@} + done + done + + note * #include headers + note * ...generated headers + loop HDR releaseflags ast_standards ast_common ast_lib ast_sys lc align sig tmx tv ast_api ast_botch ast_ccode ast_fcntl ast_float ast_fs ast_map ast_mmap ast_mode ast_ndbm ast_param ast_time ast_tty ast_wait ast_limits ast_sizeof ast_dirent ast_iconv ast_nl_types ast_stdio ast_wchar ast_wctype + make ${INSTALLROOT}/include/ast/${HDR}.h + prev ${HDR}.h + exec - cp -f ${<} ${@} + done + done + note * ...main AST headers + loop HDR ast ast_dir ast_getopt ast_std ast_windows ccode cdt cmdarg debug dt error find ftwalk fts glob hash hashkey hashpart ip6 ls magic mc mime mnt modecanon modex namval option proc recfmt regex sfio sfio_s sfio_t sfdisc shcmd stk stak swap tar times tm tok usage vdb vmalloc wait magicid fnv aso + make ${INSTALLROOT}/include/ast/${HDR}.h + prev include/${HDR}.h + exec - cp -f ${<} ${@} + done + done + note * ...comp(atibility) + loop HDR ftw getopt re_comp regexp wordexp fnmatch + make ${INSTALLROOT}/include/ast/${HDR}.h + prev comp/${HDR}.h + exec - cp -f ${<} ${@} + done + done + note * ...std + loop HDR bytesex endian dirent iconv nl_types stdio wchar wctype + make ${INSTALLROOT}/include/ast/${HDR}.h + prev std/${HDR}.h + exec - cp -f ${<} ${@} + done + done + + note * misc stuff make ${INSTALLROOT}/lib/file/magic - prev ${INSTALLROOT}/lib/file prev misc/magic.tab - exec - ${STDCMP} 2>/dev/null -s misc/magic.tab ${INSTALLROOT}/lib/file/magic || { ${STDMV} ${INSTALLROOT}/lib/file/magic ${INSTALLROOT}/lib/file/magic.old 2>/dev/null || true; ${STDCP} misc/magic.tab ${INSTALLROOT}/lib/file/magic ;} - done ${INSTALLROOT}/lib/file/magic generated - prev comp/fmtmsg.h - prev ast_lib.h - exec - case ${mam_cc_HOSTTYPE} in - exec - win32.*) - exec - if ! ${STDCMP} -s comp/fmtmsg.h ${INSTALLROOT}/include/ast/fmtmsg.h - exec - then ${STDCP} comp/fmtmsg.h ${INSTALLROOT}/include/ast/fmtmsg.h - exec - fi - exec - ;; - exec - *) grep -q 'define *_hldirb_fmtmsg' ast_lib.h || { - exec - if ! ${STDCMP} -s comp/fmtmsg.h ${INSTALLROOT}/include/ast/fmtmsg.h - exec - then ${STDCP} comp/fmtmsg.h ${INSTALLROOT}/include/ast/fmtmsg.h - exec - fi - exec - } - exec - ;; - exec - esac - prev comp/libgen.h - prev ast_lib.h - exec - case ${mam_cc_HOSTTYPE} in - exec - win32.*) - exec - if ! ${STDCMP} -s comp/libgen.h ${INSTALLROOT}/include/ast/libgen.h - exec - then ${STDCP} comp/libgen.h ${INSTALLROOT}/include/ast/libgen.h - exec - fi - exec - ;; - exec - *) grep -q 'define *_hldirb_libgen' ast_lib.h || { - exec - if ! ${STDCMP} -s comp/libgen.h ${INSTALLROOT}/include/ast/libgen.h - exec - then ${STDCP} comp/libgen.h ${INSTALLROOT}/include/ast/libgen.h - exec - fi - exec - } - exec - ;; - exec - esac - prev comp/syslog.h - prev ast_lib.h - exec - case ${mam_cc_HOSTTYPE} in - exec - win32.*) - exec - if ! ${STDCMP} -s comp/syslog.h ${INSTALLROOT}/include/ast/syslog.h - exec - then ${STDCP} comp/syslog.h ${INSTALLROOT}/include/ast/syslog.h - exec - fi - exec - ;; - exec - *) grep -q 'define *_hldirb_syslog' ast_lib.h || { - exec - if ! ${STDCMP} -s comp/syslog.h ${INSTALLROOT}/include/ast/syslog.h - exec - then ${STDCP} comp/syslog.h ${INSTALLROOT}/include/ast/syslog.h - exec - fi - exec - } - exec - ;; - exec - esac - exec - - exec - if ! ${STDCMP} -s releaseflags.h ${INSTALLROOT}/include/ast/releaseflags.h - exec - then ${STDCP} releaseflags.h ${INSTALLROOT}/include/ast/releaseflags.h - exec - fi -done install virtual -make test -done test dontcare virtual + exec - cp -f ${<} ${@} + done + + make ${INSTALLROOT}/lib/package/gen/.asthdr_tstamp + prev ast_lib.h + prev comp/fmtmsg.h + prev comp/libgen.h + note * install our own versions of these if iffe hasn't detected these in the system + exec - CCt=' ' # one tab + exec - for src in comp/fmtmsg.h comp/libgen.h + exec - do hdr=$(basename "$src" .h) + exec - grep -q "define $CCt $CCt*_hldirb_$hdr" ast_lib.h && continue + exec - dst=${INSTALLROOT}/include/ast/$hdr.h + exec - if ! cmp -s "$src" "$dst" + exec - then cp -f "$src" "$dst" || exit + exec - fi + exec - done + exec - touch ${@} + done + + note * + note * mamake was previously built by package.sh without libast; + note * now rebuild it with libast, so we get 'mamake --man', etc. + note * + + make mamake + make mamake.o + make ${PACKAGEROOT}/src/cmd/INIT/mamake.c + prev ${INSTALLROOT}/include/ast/error.h + prev ${INSTALLROOT}/include/ast/ast.h + done + exec - compile ${<} -D_PACKAGE_ast + done + bind -last + exec - ${CC} ${CCLDFLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS} -o ${@} ${<} ${mam_libast} || exit + note * + note * We purposely do not have a make target of ${INSTALLROOT}/bin/mamake here; + note * this helps to ensure that the package.sh-built version gets overwritten. + note * + note * macOS throws code signature error if 'cp' overwrites Mach-O binary; must remove first + exec - (set +f; exec rm -rf ${INSTALLROOT}/bin/${@} ${INSTALLROOT}/bin/${@}.*) + exec - cp ${@} ${INSTALLROOT}/bin/${@} + done +done install + +make test dontcare virtual + make test.mamake virtual + prev ${PACKAGEROOT}/src/cmd/INIT/mamake.tst + exec - : testing the libast rebuild of mamake at $PWD/mamake : + exec - regress --verbose ${<} mamake + done +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/RELEASE -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/RELEASE
Changed
@@ -766,7 +766,7 @@ vmalloc/vmbest.c: set /dev/zero mmap fd FD_CLOEXEC features/mmap: fix ancient read() vs. mmap() time arithmetic typo vmalloc/malloc.c: _AST_std_malloc==1 to force standard malloc -03-06-09 comp/omitted.c: add _imp__FUNCTION sybols for __CYGWIN__ static link +03-06-09 comp/omitted.c: add _imp__FUNCTION symbols for __CYGWIN__ static link vmalloc/vmbest.c: handle systems with sbrk() but no brk() 03-06-04 port/astconf.c: drop non-standard diagnostics 03-06-03 comp/conf.sh: rework symbol collision logic
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/aso/aso.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/aso/aso.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -16,6 +16,7 @@ * Martijn Dekker <martijn@inlv.org> * * Johnothan King <johnothanking@protonmail.com> * * Cy Schubert <cy@FreeBSD.org> * +* hyousatsu <118750527+hyousatsu@users.noreply.github.com> * * * ***********************************************************************/ @@ -827,9 +828,9 @@ { ssize_t k; -#if defined(_aso_cas64) +#if defined(_aso_casptr) if (!state.lockf) - return _aso_cas64((void**)p, o, n); + return _aso_casptr((void**)p, o, n); #endif k = lock(state.data, 0, p); if (*(void* volatile*)p == o)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/cdt/dtlist.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/cdt/dtlist.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -170,8 +170,7 @@ goto do_insert; } else if(type&(DT_INSERT|DT_INSTALL|DT_APPEND|DT_ATTACH)) - { - if(!(r = _dtmake(dt, obj, type)) ) + { if(!(r = _dtmake(dt, obj, type)) ) DTRETURN(obj, NULL); dt->data->size += 1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/cdt/dtopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/cdt/dtopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,7 +17,6 @@ * * ***********************************************************************/ #include "dthdr.h" -static char* Version = "\n@(#)$Id: cdt (AT&T Labs - Research) 2011-11-11 $\0\n"; /* Make a new dictionary **
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/cdt/dttree.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/cdt/dttree.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -638,10 +638,6 @@ Dtmethod_t *Dtoset = &_Dtoset; Dtmethod_t *Dtobag = &_Dtobag; -/* backward compatibility */ -#undef Dttree -Dtmethod_t *Dttree = &_Dtoset; - #ifdef NoF NoF(dttree) #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/conf.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/conf.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1985-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -249,9 +249,6 @@ esac ;; *) values=$values$sp$1 - case $1 in - $sym) echo "$1" >> $tmp.v ;; - esac ;; esac done @@ -334,14 +331,7 @@ CONF_getconf_a= IFS=':'; set -f for d in \ - /run/current-system/sw/bin \ - /usr/xpg7/bin \ - /usr/xpg6/bin \ - /usr/xpg4/bin \ - /usr/bin \ - /bin \ - /usr/sbin \ - /sbin \ + $DEFPATH \ $PATH do case $d in /*) ;; @@ -799,8 +789,6 @@ done > $tmp.q sort -u < $tmp.q > $tmp.t mv $tmp.t $tmp.q -sort -u < $tmp.v > $tmp.t -mv $tmp.t $tmp.v case $debug in -d4) exit ;; esac @@ -862,7 +850,6 @@ 1) echo "$command: check macros/enums as static initializers" >&2 ;; esac defined $tmp.q -defined $tmp.v case $debug in -d5) exit ;; esac @@ -873,10 +860,6 @@ while read line do eval CONF_const_${line}=1 done -exec < $tmp.v -while read line -do eval CONF_const_${line}=1 -done # mark the string literal values @@ -1061,13 +1044,8 @@ conf_limit=0 case $flags in *Ll*) d= - case ${conf_name} in - LONG_MAX|SSIZE_MAX) - x= - ;; - *) eval x='$'CONF_const_${conf_name} - ;; - esac + # always probe, even if a CONF_const_${conf_name} variable exists + x= case $x in '') for s in ${values} do case $s in
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/conf.tab -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/conf.tab
Changed
@@ -1,9 +1,9 @@ # # posix { getconf limits } macro table # -# @(#)conf.tab (AT&T Research) 2010-06-28 +# @(#)conf.tab (ksh 93u+m) 2024-07-01 # -# name standard section call flags header ... value ... +# name standard call section flags header ... value ... # # name: sans prefix # standard: AST, C, POSIX, SVID, XOPEN, <vendor> { SCO, SGI, SUN, ... } @@ -97,7 +97,7 @@ EQUIV_CLASS_MAX C QQ 1 L EXEC_INTERPRETER_LENGTH C QQ 1 L EXPR_NEST_MAX POSIX SC 2 LMN 32 -FCHR_MAX SVID SC 1 LMU LONG_MAX 2147483647 +FCHR_MAX SVID SC 1 LMU SSIZE_MAX 2147483647 FILESIZEBITS POSIX PC 1 LMU (8*sizeof(off_t)) 32 FILE_LOCKING POSIX SC 1 FU FORT_DEV POSIX SC 2 CFUW @@ -339,47 +339,14 @@ PAGE_SIZE POSIX SC 1 MU _AST_PAGESIZE PASS_MAX SVID SC 1 CDLMU 8 PATH AST CS 1 MU sh{ - CONF_path= - case $CONF_getconf in - '') ;; - *) CONF_path=`"$CONF_getconf" PATH` ;; - esac - case $CONF_path in - '' | !/* | *:!/* | *: ) - CONF_path=/bin:/usr/bin:/sbin:/usr/sbin ;; + # DEFPATH should have been exported from package(1) + echo "\\"$DEFPATH\\"" +} +PATH_LEADING_SLASHES AST CS 1 M sh{ + # HOSTTYPE should have been exported from package(1) + case $HOSTTYPE in + cygwin.*) echo "\\"1\\"" ;; # support UNC paths (with two leading slashes) esac - # Fix for NixOS. Not all POSIX standard utilities come with the default system, - # e.g. 'bc', 'file', 'vi'. The command that NixOS recommends to get missing - # utilities, e.g. 'nix-env -iA nixos.bc', installs them in a default profile - # directory that is not in $(getconf PATH). So add this path to the standard path. - # See: https://github.com/NixOS/nixpkgs/issues/65512 - if test -e /etc/NIXOS && - nix_profile_dir=/nix/var/nix/profiles/default/bin && - test -d "$nix_profile_dir" - then case ":$CONF_path:" in - *:"$nix_profile_dir":* ) - # nothing to do - ;; - * ) # insert the default profile directory as the second entry - CONF_path=` - set -f - IFS=: - set $CONF_path - one=$1 - shift - echo "$one:$nix_profile_dir${1+:}$*" - ` ;; - esac - fi - # Fix for AIX. At least as of version 7.1, the system default 'find', 'diff -u' and 'patch' utilities - # are broken and/or non-compliant in ways that make them incompatible with POSIX 2018. However, GNU - # utilities are commonly installed in /opt/freeware/bin, and under standard names (no g- prefix). - if test -d /opt/freeware/bin - then case `uname` in - AIX ) CONF_path="/opt/freeware/bin:$CONF_path" ;; - esac - fi - echo "\\"$CONF_path\\"" } PATH_MAX POSIX PC 1 CDLMUX MAXPATHLEN 1024 PBS POSIX SC 2 FUW @@ -473,7 +440,7 @@ SEM_NSEMS_MAX POSIX SC 1 LMU 256 SEM_VALUE_MAX POSIX SC 1 LMU 32767 SF_BUFSIZE AST XX 1 MUX sh{ - sed -e '/ *# *define *SF_BUFSIZE /!d' -e 's/^^0-9*//' -e 's/^0-9*$//' $PACKAGEROOT/src/lib/libast/include/sfio.h + sed -e '/ *# *define *SFIO_BUFSIZE /!d' -e 's/^^0-9*//' -e 's/^0-9*$//' $PACKAGEROOT/src/lib/libast/include/sfio.h } SH AST CS 1 MU sh{ ifs=$IFS
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/errno.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/errno.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * *
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/iconv.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/iconv.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -987,7 +987,7 @@ { if (cc->to.fun) { - if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SF_BUFSIZE, 0))) + if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SFIO_BUFSIZE, 0))) { errno = ENOMEM; return -1; @@ -1021,7 +1021,7 @@ { if (!(m = cc->from.map)) return (*cc->to.fun)(cc->cvt, fb, fn, tb, tn); - if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SF_BUFSIZE, 0))) + if (!cc->buf && !(cc->buf = oldof(0, char, cc->size = SFIO_BUFSIZE, 0))) { errno = ENOMEM; return -1; @@ -1094,7 +1094,7 @@ ok = 1; while (ok && *fn > 0) { - if (!(tb = (char*)sfreserve(op, -(tn + 1), SF_WRITE|SF_LOCKR)) || !(tn = sfvalue(op))) + if (!(tb = (char*)sfreserve(op, -(tn + 1), SFIO_WRITE|SFIO_LOCKR)) || !(tn = sfvalue(op))) { if (!r) r = -1; @@ -1197,14 +1197,14 @@ fn = n; do { - if (n != SF_UNBOUND) + if (n != SFIO_UNBOUND) n = -((ssize_t)(n & (((size_t)(~0))>>1))); - if ((!(fb = (char*)sfreserve(ip, n, locked = SF_LOCKR)) || !(fo = sfvalue(ip))) && + if ((!(fb = (char*)sfreserve(ip, n, locked = SFIO_LOCKR)) || !(fo = sfvalue(ip))) && (!(fb = (char*)sfreserve(ip, n, locked = 0)) || !(fo = sfvalue(ip)))) break; fs = fb; fn = fo; - if (!(tb = (char*)sfreserve(op, SF_UNBOUND, SF_WRITE|SF_LOCKR))) + if (!(tb = (char*)sfreserve(op, SFIO_UNBOUND, SFIO_WRITE|SFIO_LOCKR))) { if (!r) r = -1; @@ -1257,7 +1257,7 @@ else for (i = fn; --i >= (fs - fb);) sfungetc(ip, fbi); - if (n != SF_UNBOUND) + if (n != SFIO_UNBOUND) { if (n <= (fs - fb)) break;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/omitted.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/omitted.c
Changed
@@ -1081,7 +1081,7 @@ * own BSD-like macros */ -#if !_lib_bzero +#if !_lib_bzero && !defined(bzero) void bzero(void* b, size_t n)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/setlocale.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/setlocale.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -314,7 +314,7 @@ { for (q = s + 2; q < r; q++) if (t < e) - *t++ = debug_order*q; + *t++ = debug_order*((unsigned char*)q); while (w++ < DX) if (t < e) *t++ = 1; @@ -329,9 +329,9 @@ if (t) { if (t < e) - *t++ = debug_orders0; + *t++ = debug_order((unsigned char*)s)0; if (t < e) - *t++ = debug_orders1; + *t++ = debug_order((unsigned char*)s)1; if (t < e) *t++ = 1; if (t < e) @@ -346,11 +346,11 @@ if (t) { if (t < e) - *t++ = debug_orders0; + *t++ = debug_order((unsigned char*)s)0; if (t < e) - *t++ = debug_orders1; + *t++ = debug_order((unsigned char*)s)1; if (t < e) - *t++ = debug_orders2; + *t++ = debug_order((unsigned char*)s)2; if (t < e) *t++ = 1; } @@ -361,7 +361,7 @@ if (t) { if (t < e) - *t++ = debug_orders0; + *t++ = debug_order((unsigned char*)s)0; if (t < e) *t++ = 1; if (t < e) @@ -2253,7 +2253,7 @@ } /* - * this table is indexed by AST_LC_A-Z* + * The order of this table must correspond to the numbers of the #defines in ast_std.h */ Lc_category_t lc_categories = @@ -2269,7 +2269,6 @@ { "LC_ADDRESS", LC_ADDRESS, AST_LC_ADDRESS, 0 }, { "LC_NAME", LC_NAME, AST_LC_NAME, 0 }, { "LC_TELEPHONE", LC_TELEPHONE, AST_LC_TELEPHONE, 0 }, -{ "LC_XLITERATE", LC_XLITERATE, AST_LC_XLITERATE, 0 }, { "LC_MEASUREMENT", LC_MEASUREMENT, AST_LC_MEASUREMENT, 0 }, { "LC_PAPER", LC_PAPER, AST_LC_PAPER, 0 }, }; @@ -2684,7 +2683,6 @@ if (!initialized) { char* u; - char tmp256; /* * initialize from the environment
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/spawnveg.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/spawnveg.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -205,13 +205,8 @@ pgid = getpid(); if (setpgid(0, pgid) < 0 && errno == EPERM) setpgid(pgid, 0); -#if _lib_tcgetpgrp if (m) tcsetpgrp(2, pgid); -#elif defined(TIOCSPGRP) - if (m) - ioctl(2, TIOCSPGRP, &pgid); -#endif /* _lib_tcgetpgrp */ } execve(path, argv, envv); if (err0 != -1)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strptime.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/strptime.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -59,7 +59,7 @@ t = tmscan(s, &e, format, &f, &t, 0); if (e == (char*)s || *f) return NULL; - tmxtm(&tm, tmxclock(&t), NULL, 0); + tmxtm(&tm, tmxsns(t,0), NULL, 0); ts->tm_sec = tm.tm_sec; ts->tm_min = tm.tm_min; ts->tm_hour = tm.tm_hour;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strtold.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/strtold.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -37,8 +37,17 @@ #endif #include <ast_lib.h> + +#if __ANDROID_API__ +#define _STDLIB_H 1 +#endif + #include <ast_sys.h> +#if __ANDROID_API__ +#undef _STDLIB_H +#endif + #if _ast_fltmax_double #undef strtold #endif @@ -47,4 +56,9 @@ #include <ast.h> +/* on macOS arm64, double == long double, causing a false-positive "incompatible library declaration" warning on clang */ +#if _ast_fltmax_double && __clang__ +#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" +#endif + #include "sfstrtof.h"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strtoll.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/strtoll.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,7 +17,6 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ -#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" /* * strtoll() implementation */ @@ -36,4 +35,9 @@ #define S2I_number intmax_t #define S2I_unumber uintmax_t +/* on macOS arm64, long == long long, causing a false-positive "incompatible library declaration" warning on clang */ +#if _ast_intmax_long && __clang__ +#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" +#endif + #include "strtoi.h"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/comp/strtoull.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/comp/strtoull.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,7 +17,6 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ -#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" /* * strtoull() implementation */ @@ -37,4 +36,9 @@ #define S2I_unumber uintmax_t #define S2I_unsigned 1 +/* on macOS arm64, long == long long, causing a false-positive "incompatible library declaration" warning on clang */ +#if _ast_intmax_long && __clang__ +#pragma clang diagnostic ignored "-Wincompatible-library-redeclaration" +#endif + #include "strtoi.h"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcdio.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcdio.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -63,7 +63,7 @@ if((io = rw) > di->dio.d_maxiosz ) io = di->dio.d_maxiosz; - if(type == SF_READ) + if(type == SFIO_READ) rv = read(f->file,buf,io); else rv = write(f->file,buf,io); @@ -84,7 +84,7 @@ } if((rw = n-done) > 0 && - (rv = type == SF_READ ? read(f->file,buf,rw) : write(f->file,buf,rw)) > 0 ) + (rv = type == SFIO_READ ? read(f->file,buf,rw) : write(f->file,buf,rw)) > 0 ) done += rv; return done ? done : rv; @@ -92,19 +92,19 @@ static ssize_t dioread(Sfio_t* f, void* buf, size_t n, Sfdisc_t* disc) { - return diordwr(f, buf, n, (Direct_t*)disc, SF_READ); + return diordwr(f, buf, n, (Direct_t*)disc, SFIO_READ); } static ssize_t diowrite(Sfio_t* f, const void* buf, size_t n, Sfdisc_t* disc) { - return diordwr(f, buf, n, (Direct_t*)disc, SF_WRITE); + return diordwr(f, buf, n, (Direct_t*)disc, SFIO_WRITE); } static int dioexcept(Sfio_t* f, int type, void* data, Sfdisc_t* disc) { Direct_t* di = (Direct_t*)disc; - if(type == SF_FINAL || type == SF_DPOP) + if(type == SFIO_FINAL || type == SFIO_DPOP) { if(di->cntl&FDIRECT) { di->cntl &= ~FDIRECT; @@ -128,7 +128,7 @@ void* buf; Direct_t* di; - if(f->extent < 0 || (f->flags&SF_STRING)) + if(f->extent < 0 || (f->flags&SFIO_STRING)) return -1; if((cntl = fcntl(f->file,F_GETFL,0)) < 0) @@ -160,7 +160,7 @@ sfsetbuf(f,buf,bufsize); if(sfsetbuf(f,buf,0) == buf) - sfset(f,SF_MALLOC,1); + sfset(f,SFIO_MALLOC,1); else { free(buf); free(di);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcdos.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcdos.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -327,7 +327,7 @@ static int dos_except(Sfio_t *iop, int type, void *arg, Sfdisc_t *disc) { Dosdisc_t *dp = (Dosdisc_t*)disc; - if(type==SF_DPOP || type==SF_FINAL) + if(type==SFIO_DPOP || type==SFIO_FINAL) { if(dp->bsize>0) free(dp->buff); @@ -343,7 +343,7 @@ Dosdisc_t *dos; /* this is a readonly discipline */ - if(sfset(f,0,0)&SF_WRITE) + if(sfset(f,0,0)&SFIO_WRITE) return -1; if(!(dos = (Dosdisc_t*)malloc(sizeof(Dosdisc_t))) )
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcfilter.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcfilter.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -52,18 +52,18 @@ } else { /* eof, close write end of pipes */ - sfset(fi->filter,SF_READ,0); + sfset(fi->filter,SFIO_READ,0); close(sffileno(fi->filter)); - sfset(fi->filter,SF_READ,1); + sfset(fi->filter,SFIO_READ,1); fi->next = fi->endb = NULL; } } if(fi->next && (w = fi->endb - fi->next) > 0 ) { /* see if pipe is ready for write */ - sfset(fi->filter, SF_READ, 0); + sfset(fi->filter, SFIO_READ, 0); r = sfpoll(&fi->filter, 1, 1); - sfset(fi->filter, SF_READ, 1); + sfset(fi->filter, SFIO_READ, 1); if(r == 1) /* non-blocking write */ { errno = 0; @@ -75,9 +75,9 @@ } /* see if pipe is ready for read */ - sfset(fi->filter, SF_WRITE, 0); + sfset(fi->filter, SFIO_WRITE, 0); w = sfpoll(&fi->filter, 1, fi->next ? 1 : -1); - sfset(fi->filter, SF_WRITE, 1); + sfset(fi->filter, SFIO_WRITE, 1); if(!fi->next || w == 1) /* non-blocking read */ { errno = 0; @@ -109,7 +109,7 @@ /* on close, remove the discipline */ static int filterexcept(Sfio_t* f, int type, void* data, Sfdisc_t* disc) { - if(type == SF_FINAL || type == SF_DPOP) + if(type == SFIO_FINAL || type == SFIO_DPOP) { sfclose(((Filter_t*)disc)->filter); free(disc); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcmore.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcmore.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -232,22 +232,22 @@ { More_t* more = (More_t*)dp; - if (type == SF_FINAL || type == SF_DPOP) + if (type == SFIO_FINAL || type == SFIO_DPOP) { if (f = more->input) { more->input = 0; - sfdisc(f, SF_POPDISC); + sfdisc(f, SFIO_POPDISC); } else if (f = more->error) { more->error = 0; - sfdisc(f, SF_POPDISC); + sfdisc(f, SFIO_POPDISC); } else free(dp); } - else if (type == SF_SYNC) + else if (type == SFIO_SYNC) { more->match = 0; more->row = 1; @@ -272,7 +272,7 @@ * this is a writeonly discipline for interactive io */ - if (!(sfset(f, 0, 0) & SF_WRITE) || !isatty(sffileno(sfstdin)) || !isatty(sffileno(sfstdout))) + if (!(sfset(f, 0, 0) & SFIO_WRITE) || !isatty(sffileno(sfstdin)) || !isatty(sffileno(sfstdout))) return -1; if (!prompt) prompt = "\0337m More\033m"; @@ -307,13 +307,13 @@ { if (sfdisc(sfstdin, &more->disc) != &more->disc) { - sfdisc(f, SF_POPDISC); + sfdisc(f, SFIO_POPDISC); return -1; } more->input = sfstdin; if (sfdisc(sfstderr, &more->disc) != &more->disc) { - sfdisc(f, SF_POPDISC); + sfdisc(f, SFIO_POPDISC); return -1; } more->error = sfstdin;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcprefix.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcprefix.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -81,7 +81,7 @@ static int pfxexcept(Sfio_t* f, int type, void* data, Sfdisc_t* dp) { - if (type == SF_FINAL || type == SF_DPOP) + if (type == SFIO_FINAL || type == SFIO_DPOP) free(dp); return 0; } @@ -100,7 +100,7 @@ * this is a writeonly discipline */ - if (!prefix || !(n = strlen(prefix)) || !(sfset(f, 0, 0) & SF_WRITE)) + if (!prefix || !(n = strlen(prefix)) || !(sfset(f, 0, 0) & SFIO_WRITE)) return -1; if (!(pfx = (Prefix_t*)malloc(sizeof(Prefix_t) + n))) return -1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcseekable.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcseekable.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -89,7 +89,7 @@ { Seek_t* sk; Sfio_t* sf; - char bufSF_BUFSIZE; + char bufSFIO_BUFSIZE; ssize_t r, w; sk = (Seek_t*)disc; @@ -147,8 +147,8 @@ switch (type) { - case SF_FINAL: - case SF_DPOP: + case SFIO_FINAL: + case SFIO_DPOP: sfclose(sk->shadow); free(disc); break; @@ -178,7 +178,7 @@ sk->disc.writef = skwrite; sk->disc.seekf = skseek; sk->disc.exceptf = skexcept; - sk->shadow = sftmp(SF_BUFSIZE); + sk->shadow = sftmp(SFIO_BUFSIZE); sk->discard = 0; sk->extent = 0; sk->eof = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcslow.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcslow.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,12 +33,12 @@ switch (type) { - case SF_FINAL: - case SF_DPOP: + case SFIO_FINAL: + case SFIO_DPOP: free(disc); break; - case SF_READ: - case SF_WRITE: + case SFIO_READ: + case SFIO_WRITE: if (errno == EINTR) return -1; break; @@ -63,7 +63,7 @@ { free(disc); return -1; } - sfset(f,SF_IOINTR,1); + sfset(f,SFIO_IOINTR,1); return 0; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcsubstr.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcsubstr.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -57,7 +57,7 @@ if(sfsk(f,here,SEEK_SET,disc) != here) io = 0; else - { if(type == SF_WRITE) + { if(type == SFIO_WRITE) io = sfwr(f,buf,n,disc); else io = sfrd(f,buf,n,disc); if(io > 0) @@ -72,12 +72,12 @@ static ssize_t streamwrite(Sfio_t* f, const void* buf, size_t n, Sfdisc_t* disc) { - return streamio(f,(void*)buf,n,disc,SF_WRITE); + return streamio(f,(void*)buf,n,disc,SFIO_WRITE); } static ssize_t streamread(Sfio_t* f, void* buf, size_t n, Sfdisc_t* disc) { - return streamio(f,buf,n,disc,SF_READ); + return streamio(f,buf,n,disc,SFIO_READ); } static Sfoff_t streamseek(Sfio_t* f, Sfoff_t pos, int type, Sfdisc_t* disc) @@ -119,7 +119,7 @@ static int streamexcept(Sfio_t* f, int type, void* data, Sfdisc_t* disc) { - if(type == SF_FINAL || type == SF_DPOP) + if(type == SFIO_FINAL || type == SFIO_DPOP) free(disc); return 0; } @@ -139,7 +139,7 @@ else sfseek(parent,here,SEEK_SET); sfpurge(parent); - if (!(sp = f) && !(sp = sfnew(NULL, NULL, (size_t)SF_UNBOUND, dup(sffileno(parent)), parent->flags))) + if (!(sp = f) && !(sp = sfnew(NULL, NULL, (size_t)SFIO_UNBOUND, dup(sffileno(parent)), parent->flags))) return NULL; if(!(su = (Subfile_t*)malloc(sizeof(Subfile_t))))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdctee.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdctee.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -51,7 +51,7 @@ /* on close, remove the discipline */ static int teeexcept(Sfio_t* f, int type, void* data, Sfdisc_t* disc) { - if(type == SF_FINAL || type == SF_DPOP) + if(type == SFIO_FINAL || type == SFIO_DPOP) free(disc); return 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/disc/sfdcunion.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/disc/sfdcunion.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -125,7 +125,7 @@ /* on close, remove the discipline */ static int unexcept(Sfio_t* f, int type, void* data, Sfdisc_t* disc) { - if(type == SF_FINAL || type == SF_DPOP) + if(type == SFIO_FINAL || type == SFIO_DPOP) free(disc); return 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/api -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/api
Changed
@@ -1,6 +1,6 @@ iff AST_API -ver ast 20230909 +ver ast 20240303 api ast 20120528 regexec regnexec regrexec regsubexec
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/aso -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/aso
Changed
@@ -24,9 +24,9 @@ #define _aso_inc64(p) __sync_fetch_and_add(p,1) #define _aso_dec64(p) __sync_fetch_and_sub(p,1) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,o,n)) #endif } elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{ @@ -48,7 +48,7 @@ #define _aso_cas32(p,o,n) __sync_val_compare_and_swap(p,o,n) #define _aso_inc32(p) __sync_fetch_and_add(p,1) #define _aso_dec32(p) __sync_fetch_and_sub(p,1) - #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,o,n)) } elif aso note{ <atomic.h> atomic_cas_64 }end link{ #include "FEATURE/common" @@ -74,9 +74,9 @@ #define _aso_inc64(p) (atomic_add_64_nv(p,1)-1) #define _aso_dec64(p) (atomic_add_64_nv(p,-1)+1) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)atomic_cas_64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,o,n)) #endif } elif aso note{ <atomic.h> atomic_cas_32 }end link{ @@ -98,7 +98,7 @@ #define _aso_cas32(p,o,n) atomic_cas_32(p,o,n) #define _aso_inc32(p) (atomic_add_32_nv(p,1)-1) #define _aso_dec32(p) (atomic_add_32_nv(p,-1)+1) - #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,o,n)) } elif aso -latomic note{ <atomic.h> atomic_cas_64 with -latomic }end link{ #include "FEATURE/common" @@ -125,9 +125,9 @@ #define _aso_inc64(p) (atomic_add_64_nv(p,1)-1) #define _aso_dec64(p) (atomic_add_64_nv(p,-1)+1) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)atomic_cas_64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,o,n)) #endif } elif aso note{ <atomic.h> atomic_cas_32 with -latomic }end link{ @@ -150,7 +150,7 @@ #define _aso_cas32(p,o,n) atomic_cas_32(p,o,n) #define _aso_inc32(p) (atomic_add_32_nv(p,1)-1) #define _aso_dec32(p) (atomic_add_32_nv(p,-1)+1) - #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,o,n)) } elif aso note{ <atomic.h> cas64 }end link{ #include "FEATURE/common" @@ -176,9 +176,9 @@ #define _aso_inc64(p) (atomic_add_64_nv(p,1)-1) #define _aso_dec64(p) (atomic_add_64_nv(p,-1)+1) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) #endif } elif aso note{ <atomic.h> just cas64 }end link{ @@ -199,9 +199,9 @@ #define _aso_cas32(p,o,n) cas32(p,o,n) #define _aso_cas64(p,o,n) cas64(p,o,n) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) #endif } elif aso note{ <atomic.h> cas32 }end link{ @@ -223,7 +223,7 @@ #define _aso_cas32(p,o,n) cas32(p,o,n) #define _aso_inc32(p) (atomic_add_32_nv(p,1)-1) #define _aso_dec32(p) (atomic_add_32_nv(p,-1)+1) - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) } elif aso note{ <atomic.h> just cas32 }end link{ #include "FEATURE/common" @@ -240,7 +240,7 @@ #define _aso_cas8(p,o,n) cas8(p,o,n) #define _aso_cas16(p,o,n) cas16(p,o,n) #define _aso_cas32(p,o,n) cas32(p,o,n) - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) } elif aso note{ winix Interlocked }end link{ #include <windows.h> @@ -261,7 +261,7 @@ #define _aso_cas64(p,o,n) InterlockedCompareExchange64((LONGLONG volatile*)p,n,o) #define _aso_inc64(p) (InterlockedIncrement64((LONGLONG volatile*)p)-1) #define _aso_dec64(p) (InterlockedDecrement64((LONGLONG volatile*)p)+1) - #define _aso_casptr(p,o,n) ((void*)InterlockedCompareExchange64((LONGLONG volatile*)p,(LONGLONG)n,(LONGLONG)o)) + #define _aso_casptr(p,o,n) ((void*)InterlockedCompareExchange64((LONGLONG volatile*)p,n,o)) #else #if _BLD_posix #include "dl.h" @@ -345,7 +345,7 @@ return _aso_InterlockedDecrement64(p); } #endif - #define _aso_casptr(p,o,n) ((void*)InterlockedCompareExchange((LONG volatile*)p,(LONG)n,(LONG)o)) + #define _aso_casptr(p,o,n) ((void*)InterlockedCompareExchange((LONG volatile*)p,n,o)) #endif } elif aso note{ AIX fetch and add }end link{ @@ -361,9 +361,9 @@ #define _aso_decint(p) fetch_and_add((atomic_p)p,-1) #define _aso_casint(p,o,n) (compare_and_swap((atomic_p)p,(int*)&o,(int)n) ? o : *p) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) (compare_and_swaplp((atomic_l)p,(long*)&o,(long)n) ? o : *(void**)p) + #define _aso_casptr(p,o,n) (compare_and_swaplp((atomic_l)p,(long*)&o,n) ? o : *(void**)p) #else - #define _aso_casptr(p,o,n) (compare_and_swap((atomic_p)p,(int*)&o,(int)n) ? o : *(void**)p) + #define _aso_casptr(p,o,n) (compare_and_swap((atomic_p)p,(int*)&o,n) ? o : *(void**)p) #endif } elif aso note{ MIPS compare and swap }end link{ @@ -374,7 +374,7 @@ } }end && { #define _aso_cas32(p,o,n) (__compare_and_swap(p,o,n) ? o : *p) - #define _aso_casptr(p,o,n) (__compare_and_swap((long*)p,(long)o,(long)n) ? o : *(void**)p) + #define _aso_casptr(p,o,n) (__compare_and_swap((long*)p,o,n) ? o : *(void**)p) } elif aso note{ i386|i386-64 asm compare and swap }end link{ #include "FEATURE/common" @@ -457,9 +457,9 @@ #define _aso_cas32(p,o,n) cas32(p,o,n) #if _ast_sizeof_pointer == 8 #define _aso_cas64(p,o,n) cas64(p,o,n) - #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) #endif } elif aso note{ ia64 asm compare and swap }end link{ @@ -527,9 +527,9 @@ #define _aso_cas32(p,o,n) cas32(p,o,n) #define _aso_cas64(p,o,n) cas64(p,o,n) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) #endif } elif aso note{ ppc asm compare and swap }end link{ @@ -625,9 +625,9 @@ #define _aso_cas32(p,o,n) cas32(p,o,n) #define _aso_cas64(p,o,n) cas64(p,o,n) #if _ast_sizeof_pointer == 8 - #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,(uint64_t)o,(uint64_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas64((uint64_t*)p,o,n)) #else - #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,(uint32_t)o,(uint32_t)n)) + #define _aso_casptr(p,o,n) ((void*)cas32((uint32_t*)p,o,n)) #endif } endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/common -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/common
Changed
@@ -4,8 +4,6 @@ typ long.double,size_t,ssize_t typ __va_list stdio.h -mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h - std noreturn note{ noreturn ok }end compile{ #include <stdlib.h> #include <stdnoreturn.h> @@ -14,11 +12,16 @@ }end cat{ + #if __clang__ + #pragma clang diagnostic ignored "-Wmissing-braces" #pragma clang diagnostic ignored "-Wparentheses" #pragma clang diagnostic ignored "-Wstring-plus-int" #pragma clang diagnostic ignored "-Wunused-value" - #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) + #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) + #pragma GCC diagnostic ignored "-Wmissing-braces" + #pragma GCC diagnostic ignored "-Wparentheses" #pragma GCC diagnostic ignored "-Wunused-result" + #pragma GCC diagnostic ignored "-Wunused-value" #endif /* AST backward compatibility macros */ @@ -254,7 +257,7 @@ "pointer", sizeof(void*), COND * 4, "float", sizeof(float), 0, "double", sizeof(double), 0, - #ifdef _typ_long_double + #if _typ_long_double "long_double", sizeof(long double), 0, #endif }; @@ -305,7 +308,7 @@ { "float", sizeof(float), "double", sizeof(double), - #ifdef _typ_long_double + #if _typ_long_double "long double", sizeof(long double), #endif }; @@ -316,7 +319,7 @@ int t; int m = 1; - #ifdef _typ_long_double + #if _typ_long_double long double p; char buf64;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/lib -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/lib
Changed
@@ -3,8 +3,8 @@ cmd universe hdr dirent,direntry,filio,fmtmsg,fnmatch,jioctl,libgen,limits -hdr locale,ndir,nl_types,process,spawn,syslog,utime -hdr linux/fs,linux/msdos_fs,sys/ioctl +hdr locale,ndir,nl_types,process,spawn,utime +hdr linux/fs,linux/msdos_fs hdr wctype hdr wchar note{ <wchar.h> and isw*() really work }end execute{ #include <wchar.h> @@ -23,22 +23,22 @@ lib BSDsetpgrp lib _cleanup -lib atexit,bcopy,bzero,catclose,catgets,catopen,confstr,dirread,dup2 +lib bcopy,bzero,confstr,dirread,dup2 lib execlp,execve,execvp,execvpe lib fchmod,fcntl,fmtmsg,fnmatch,fork,fsync lib getconf,getdents,getdirentries,getdtablesize,getdate lib getgroups,gethostname,getlogin,getpagesize,getrlimit,getuniverse lib getopt,getsubopt,getopt_long,getopt_long_only -lib glob,index,iswblank,iswctype,killpg,link,localeconv,madvise +lib glob,iswblank,iswctype,killpg,link,localeconv,madvise lib mbtowc,mbrtowc,memalign,memchr,memcpy,memdup,memmove,memset lib mkdir,mkfifo,mktemp,mktime -lib mount,onexit,opendir,pathconf -lib readlink,remove,rename,rewinddir,rindex,rmdir,setlocale +lib mount,opendir,pathconf +lib readlink,remove,rename,rewinddir,rmdir,setlocale lib setpgid,setpgrp,setpgrp2,setreuid,setsid,setuid,sigaction lib sigprocmask,sigsetmask,sigunblock,sigvec,socketpair lib spawn,spawnve -lib strchr,strcoll,strdup,strerror,strcasecmp,strncasecmp,strrchr,strstr -lib strmode,strxfrm,strftime,swab,symlink,sysconf,sysinfo,syslog +lib strcoll,strdup,strerror,strcasecmp,strncasecmp,strlcat,strlcpy +lib strmode,strxfrm,strftime,swab,symlink,sysconf,sysinfo lib telldir,tmpnam,tzset,universe,unlink,utime,wctype lib ftruncate,truncate @@ -52,7 +52,7 @@ mem inheritance.pgroup spawn.h mem tm.tm_zone time.h -sys dir,filio,jioctl,localedef,ptem,resource +sys dir,filio,ioctl,jioctl,localedef,ptem,resource sys socket,stream,systeminfo,universe tst tst_errno note{ errno can be assigned }end link{
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/limits.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/limits.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,6 +17,11 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ +#if __clang__ +#pragma clang diagnostic ignored "-Wunused-variable" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif /* * Glenn Fowler * AT&T Research
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/map.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/map.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -31,6 +31,7 @@ #include "FEATURE/vmalloc" #include "FEATURE/eaccess" #include "FEATURE/api" +#include <sig.h> #if _opt_map_libc && !defined(_map_libc) #define _map_libc 1 @@ -134,6 +135,11 @@ printf("#define glob _ast_glob\n"); printf("#undef globfree\n"); printf("#define globfree _ast_globfree\n"); +#if _map_libc || (!_std_signal && (_lib_sigaction && defined(SA_NOCLDSTOP) || _lib_sigvec && defined(SV_INTERRUPT))) + /* use the libast signal() function (aka sigaction) when applicable */ + printf("#undef signal\n"); + printf("#define signal _ast_signal\n"); +#endif #if _map_libc printf("#undef memdup\n"); printf("#define memdup _ast_memdup\n"); @@ -225,9 +231,8 @@ printf("#define re_comp _ast_re_comp\n"); printf("#undef re_exec\n"); printf("#define re_exec _ast_re_exec\n"); - printf("#undef realpath\n"); - printf("#define realpath _ast_realpath\n"); - printf("extern char* realpath(const char*, char*);\n"); +#endif + /* Override the native regex library in favor of libast's regex functions */ printf("#undef regaddclass\n"); printf("#define regaddclass _ast_regaddclass\n"); printf("#undef regalloc\n"); @@ -280,6 +285,7 @@ printf("#define regsubflags _ast_regsubflags\n"); printf("#undef regsubfree\n"); printf("#define regsubfree _ast_regsubfree\n"); +#if _map_libc printf("#undef remove\n"); printf("#define remove _ast_remove\n"); printf("extern int remove(const char*);\n"); @@ -293,8 +299,6 @@ printf("#define setenviron _ast_setenviron\n"); printf("#undef sigcritical\n"); printf("#define sigcritical _ast_sigcritical\n"); - printf("#undef signal\n"); - printf("#define signal _ast_signal\n"); printf("#undef sigunblock\n"); printf("#define sigunblock _ast_sigunblock\n"); printf("#undef stracmp\n");
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/nl_types -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/nl_types
Changed
@@ -57,4 +57,7 @@ printf("\n"); return 0; } +}end fail{ + echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2 + exit 1 }end
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/sfio -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/sfio
Changed
@@ -4,8 +4,6 @@ lib qfrexp,qldexp key signed -typ struct.sf_hdtr sys/socket.h - tst - note{ number of bits in pointer }end output{ #include <stdio.h> int
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/sig.sh -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/sig.sh
Changed
@@ -2,7 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1985-2011 AT&T Intellectual Property # -# Copyright (c) 2020-2023 Contributors to ksh 93u+m # +# Copyright (c) 2020-2024 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 2.0 # # # @@ -105,4 +105,5 @@ extern int sigflag(int, int, int); #endif extern int sigcritical(int); -extern int sigunblock(int);' +extern int sigunblock(int); +extern Sig_handler_t _ast_signal(int, Sig_handler_t);'
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/signal.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/signal.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,7 +17,13 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ +#if __clang__ #pragma clang diagnostic ignored "-Wparentheses" +#pragma clang diagnostic ignored "-Wmissing-braces" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wparentheses" +#pragma GCC diagnostic ignored "-Wmissing-braces" +#endif /* * Glenn Fowler * AT&T Research @@ -308,6 +314,7 @@ k = j; mapindexj = i; } + n = 1; #ifdef SIGRTMIN i = SIGRTMIN; #ifdef SIGRTMAX @@ -322,7 +329,6 @@ if (j > k) k = j; mapindexi = RANGE_MIN | RANGE_RT; - n = 1; while (++i < j) mapindexi = RANGE_RT | n++; mapindexj = RANGE_MAX | RANGE_RT | n;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/standards -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/standards
Changed
@@ -148,7 +148,7 @@ #define NULL 0 #endif /* __SUNPRO_C */ } -elif tst note{ GNU (glibc) or Cygwin }end compile{ +elif tst note{ GNU (glibc), Cygwin, or Android }end compile{ /* * On GNU (GNU's Not UNIX) and Cygwin, _GNU_SOURCE is the "everything and the kitchen sink" macro * (see feature_test_macros(7)), but on GNU we also need to define _FILE_OFFSET_BITS to get large @@ -163,8 +163,8 @@ #include <features.h> #include <sys/types.h> #include <wchar.h> - #if !__GLIBC__ && !__CYGWIN__ - #error not GNU or Cygwin + #if !__GLIBC__ && !__CYGWIN__ && !__ANDROID_API__ + #error not GNU, Cygwin, or Android #endif int _do_these_compile_ = _POSIX_PATH_MAX & _SC_PAGESIZE; #if _typ_u_long
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/stdio -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/stdio
Changed
@@ -29,7 +29,7 @@ #if defined(_AST_H) || defined(_SFIO_H) - #define BUFSIZ SF_BUFSIZE + #define BUFSIZ SFIO_BUFSIZE #else @@ -53,8 +53,8 @@ #define _sf_(f) ((struct _sfio_s*)(f)) - #define _SF_EOF 0000200 - #define _SF_ERROR 0000400 + #define _SFIO_EOF 0000200 + #define _SFIO_ERROR 0000400 #endif @@ -343,8 +343,8 @@ extern FILE _Sfstdout; extern FILE _Sfstderr; - #define feof(f) (_sf_(f)->_flags&_SF_EOF) - #define ferror(f) (_sf_(f)->_flags&_SF_ERROR) + #define feof(f) (_sf_(f)->_flags&_SFIO_EOF) + #define ferror(f) (_sf_(f)->_flags&_SFIO_ERROR) #define fileno(f) (_sf_(f)->_file) #define fputc(c,f) (_sf_(f)->_next>=_sf_(f)->_endw?_sfflsbuf(_sf_(f),(int)((unsigned char)(c))):(int)(*_sf_(f)->_next++=(unsigned char)(c))) #define getc(f) (_sf_(f)->_next>=_sf_(f)->_endr?_sffilbuf(_sf_(f),0):(int)(*_sf_(f)->_next++))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/sys -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/sys
Changed
@@ -118,7 +118,6 @@ extern abs int (int) extern access int (const char*, int) extern alarm unsigned (unsigned) -extern atexit int (void(*)(void)) extern atof double (const char*) extern atoi int (const char*) extern atol long (const char*) @@ -191,27 +190,17 @@ extern setsid pid_t (void) extern setuid int (uid_t) extern sleep unsigned (unsigned int) -extern spawnveg pid_t (const char*, char* const, char* const, pid_t, int) extern srand void (unsigned int) extern strcasecmp int (const char*, const char*) -extern strcat char* (char*, const char*) -extern strchr char* (const char*, int) -extern strcmp int (const char*, const char*) extern strcoll int (const char*, const char*) -extern strcpy char* (char*, const char*) extern strcspn size_t (const char*, const char*) extern strdup char* (const char*) extern strlcat size_t (char*, const char*, size_t) extern strlcpy size_t (char*, const char*, size_t) extern strlen size_t (const char*) extern strncasecmp int (const char*, const char*, size_t) -extern strncat char* (char*, const char*, size_t) -extern strncmp int (const char*, const char*, size_t) -extern strncpy char* (char*, const char*, size_t) extern strpbrk char* (const char*, const char*) -extern strrchr char* (const char*, int) extern strspn size_t (const char*, const char*) -extern strstr char* (const char*, const char*) extern strtok char* (char*, const char*) extern strxfrm size_t (char*, const char*, size_t) extern swab void (const void*, void*, ssize_t) @@ -227,5 +216,6 @@ extern wctomb int (char*, wchar_t) extern write ssize_t (int, const void*, size_t) +print extern pid_t spawnveg(const char*, char* const, char* const, pid_t, int); print #undef extern print #include <stdarg.h>
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/tty -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/tty
Changed
@@ -1,113 +1,43 @@ -hdr termios,termio,sgtty,sys/ioctl -sys termios,termio,ioctl,bsdtty,nttyio,ttyio -lib tcgetattr,tcgetpgrp termios.h +hdr termios fail{ + echo "$0: POSIX termios.h is required" >&2 + exit 1 +}end +lib tcgetattr termios.h fail{ + echo "$0: POSIX tcgetattr(3) is required" >&2 + exit 1 +}end +lib tcgetpgrp unistd.h fail{ + echo "$0: POSIX tcgetpgrp(3) is required" >&2 + exit 1 +}end mac _POSIX_VDISABLE termios.h mem termios.c_line termios.h cat{ -#ifdef _hdr_termios -# if _mac__POSIX_VDISABLE -# undef _POSIX_VDISABLE -# endif -# include <termios.h> -#else -# if defined(_sys_termios) && defined(_lib_tcgetattr) -# include <sys/termios.h> -# define _hdr_termios 1 -# else -# undef _sys_termios -# endif /* _sys_termios */ -#endif /* _hdr_termios */ - -#ifdef _hdr_termios -# undef _hdr_sgtty -# undef tcgetattr -# undef tcsetattr -# undef tcgetpgrp -# undef tcsetpgrp -# undef cfgetospeed -# ifndef TCSANOW -# define TCSANOW TCSETS -# define TCSADRAIN TCSETSW -# define TCSAFLUSH TCSETSF -# endif /* TCSANOW */ - /* The following corrects bugs in some implementations */ -# if defined(TCSADFLUSH) && !defined(TCSAFLUSH) -# define TCSAFLUSH TCSADFLUSH -# endif /* TCSADFLUSH */ -# ifndef _lib_tcgetattr -# undef tcgetattr -# define tcgetattr(fd,tty) ioctl(fd, TCGETS, tty) -# undef tcsetattr -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) -# undef cfgetospeed -# define cfgetospeed(tp) ((tp)->c_cflag & CBAUD) -# endif /* _lib_tcgetattr */ -# undef TIOCGETC -#else -# define cfgetospeed(tp) ((tp)->c_cflag & CBAUD) -# define cfgetispeed(tp) ((tp)->c_cflag & CBAUD) -# define cfsetispeed(tp,val) ((tp)->c_cflag &=~ CBAUD,(tp)->c_cflag|=(val)) -# define cfsetospeed(tp,val) ((tp)->c_cflag &=~ CBAUD,(tp)->c_cflag|=(val)) -# ifdef _hdr_termio -# include <termio.h> -# else -# ifdef _sys_termio -# include <sys/termio.h> -# define _hdr_termio 1 -# endif /* _sys_termio */ -# endif /* _hdr_termio */ -# ifdef _hdr_termio -# define termios termio -# undef TIOCGETC -# define tcgetattr(fd,tty) ioctl(fd, TCGETA, tty) -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) - -# ifdef _sys_bsdtty -# include <sys/bsdtty.h> -# endif /* _sys_bsdtty */ -# else -# ifdef _hdr_sgtty -# include <sgtty.h> -# ifndef LPENDIN -# ifdef _sys_nttyio -# include <sys/nttyio.h> -# endif /* _sys_nttyio */ -# endif /* LPENDIN */ -# define termios sgttyb -# ifdef TIOCSETN -# undef TCSETAW -# endif /* TIOCSETN */ -# ifdef TIOCGETP -# define tcgetattr(fd,tty) ioctl(fd, TIOCGETP, tty) -# define tcsetattr(fd,action,tty) ioctl(fd, action, tty) -# else -# define tcgetattr(fd,tty) gtty(fd, tty) -# define tcsetattr(fd,action,tty) stty(fd, tty) -# endif /* TIOCGETP */ -# else -# ifdef _sys_ttyio -# include <sys/ttyio.h> -# endif -# endif /* _hdr_sgtty */ -# endif /* hdr_termio */ - -# ifndef TCSANOW -# ifdef TCSETAW -# define TCSANOW TCSETA -# define TCSAFLUSH TCSETAF -# else -# ifdef TIOCSETN -# define TCSANOW TIOCSETN -# define TCSADRAIN TIOCSETN -# define TCSAFLUSH TIOCSETP -# endif /* TIOCSETN */ -# endif /* TCSETAW */ -# endif /* TCSANOW */ -#endif /* _hdr_termios */ - -#if _hdr_sys_ioctl +#if _mac__POSIX_VDISABLE +# undef _POSIX_VDISABLE +#endif +#include <termios.h> +#include <ast_lib.h> + +#undef tcgetattr +#undef tcsetattr +#undef tcgetpgrp +#undef tcsetpgrp +#undef cfgetospeed +#ifndef TCSANOW +# define TCSANOW TCSETS +# define TCSADRAIN TCSETSW +# define TCSAFLUSH TCSETSF +#endif /* TCSANOW */ +/* The following corrects bugs in some implementations */ +#if defined(TCSADFLUSH) && !defined(TCSAFLUSH) +# define TCSAFLUSH TCSADFLUSH +#endif /* TCSADFLUSH */ +#undef TIOCGETC + +#if _sys_ioctl # include <sys/ioctl.h> #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/vmalloc -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/vmalloc
Changed
@@ -8,8 +8,8 @@ ref -D_def_map_ast=1 -lib atexit,getpagesize,mallopt,memalign,mstats -lib onexit,pvalloc,strdup,valloc,vmalloc +lib getpagesize,mallopt,memalign,mstats +lib pvalloc,strdup,valloc,vmalloc lib _malloc,__malloc,__libc_malloc hdr alloca,malloc,stat,stdlib,unistd,sys/shm mem mstats.bytes_total malloc.h
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/features/wchar -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/features/wchar
Changed
@@ -56,6 +56,22 @@ endif endif +tst iswpunct_broken note{ is iswpunct(3) broken }end execute{ + /* on Android 14.0, it is: it does not recognise some of the ASCII characters. ispunct(3) is fine */ + #include <ctype.h> + #include <wctype.h> + int main(void) + { + char c = { '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', + '<', '=', '>', '?', '@', '', '\\', '', '^', '_', '`', '{', '|', '}', '~', '\0' }; + int i; + for (i = 0; ci; i++) + if (ispunct(ci) && !iswpunct(ci)) + return 0; + return 1; + } +}end + run{ cat <<! #ifndef WEOF
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/hash/hashalloc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/hash/hashalloc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,8 +23,6 @@ * hash table library */ -static const char id_hash = "\n@(#)$Id: hash (AT&T Research) 1996-08-11 $\0\n"; - #include "hashlib.h" #include "FEATURE/hack"
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/hash/hashfree.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/hash/hashfree.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,16 +35,16 @@ Hash_table_t* hashfree(Hash_table_t* tab) { - Hash_bucket_t** sp; - Hash_bucket_t* b; - Hash_bucket_t* p; + Hash_bucket_t** sp; + Hash_bucket_t* b; + Hash_bucket_t* p; Hash_bucket_t** sx; Hash_root_t* rp; Hash_table_t* tp; Hash_free_f freevalue; Hash_free_f freebucket; Hash_region_f region; - void* handle; + void* handle = NULL; if (!tab) return NULL; if (tab->table)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/hash/hashlook.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/hash/hashlook.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -191,7 +191,7 @@ if (name) { if (tab->root->local->region) (*tab->root->local->region)(tab->root->local->handle, (char*)name, 0, 0); - else free((char*)name); + else free((void*)name); } } } @@ -233,7 +233,7 @@ { b->hash &= ~HASH_FREENAME; if (tab->root->local->region) (*tab->root->local->region)(tab->root->local->handle, (char*)name, 0, 0); - else free((char*)name); + else free((void*)name); } tab->buckets--; tab->tablen = b->next;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/ast.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/ast.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -45,7 +45,7 @@ #endif /* - * workaround botched headers that assume <stdio.h> + * work around botched headers that assume <stdio.h> */ #ifndef FILE @@ -97,14 +97,9 @@ #define EXIT_NOTFOUND 127 /* command not found */ #define EXIT_NOEXEC 126 /* other exec error */ -#define EXIT_CODE(x) ((x) & EXIT_QUIT) -#define EXIT_CORE(x) (EXIT_CODE(x) | 256 | 128) +#define EXIT_CODE(x) ((x) & 255) #define EXIT_TERM(x) (EXIT_CODE(x) | 256) -#define EXIT_STATUS(x) (((x) & 63) ? (x) : EXIT_CODE((x) >> 8)) -#define EXITED_CORE(x) (((x) & (256 | 128)) == (256 | 128) || ((x) & (128 | 64)) == (128 | 64)) -#define EXITED_TERM(x) ((x) & (256 | 128)) - /* * astconflist() flags */ @@ -213,7 +208,7 @@ #define mbcoll() ( ast.mb_xfrm != 0 ) #define mbwide() ( mbmax() > 1 ) -#define mb2wc(w,p,n) ( (*ast.mb_towc)(&w, (char*)p, n) ) +#define mb2wc(w,p,n) ( (*ast.mb_towc)(&w, (char*)(p), n) ) #define mbchar(p) mbnchar(p, mbmax()) #define mbnchar(p,n) ( mbwide() ? ( (ast.tmp_int = (*ast.mb_towc)(&ast.tmp_wchar, (char*)(p), n)) > 0 ? \ ( (p+=ast.tmp_int),ast.tmp_wchar) : (p+=ast.mb_sync+1,ast.tmp_int) ) : (*(unsigned char*)(p++)) ) @@ -258,8 +253,8 @@ #define roundof(x,y) (((x)+(y)-1)&~((y)-1)) #define ssizeof(x) ((int)sizeof(x)) -#define streq(a,b) (*(a)==*(b)&&!strcmp(a,b)) -#define strneq(a,b,n) (*(a)==*(b)&&!strncmp(a,b,n)) +#define streq(a,b) (!strcmp(a,b)) +#define strneq(a,b,n) (!strncmp(a,b,n)) #define strsignal(s) fmtsignal(s) #define NiL NULL /* for backward compatibility */ @@ -323,7 +318,6 @@ extern int chrtoi(const char*); extern char* conformance(const char*, size_t); extern int eaccess(const char*, int); -extern char* fmtbase(intmax_t, int, int); extern char* fmtbuf(size_t); extern char* fmtclock(Sfulong_t); extern char* fmtelapsed(unsigned long, int);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/ast_std.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/ast_std.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -152,6 +152,9 @@ /* * maintain this order when adding categories + * AST_LC_COUNT is the number of categories + * The numbering must be consecutive and correspond to the order of lc_categories in comp/setlocale.c + * The initializers in port/lc.c must also be kept in sync with this */ #define AST_LC_ALL 0 @@ -165,10 +168,9 @@ #define AST_LC_ADDRESS 8 #define AST_LC_NAME 9 #define AST_LC_TELEPHONE 10 -#define AST_LC_XLITERATE 11 -#define AST_LC_MEASUREMENT 12 -#define AST_LC_PAPER 13 -#define AST_LC_COUNT 14 +#define AST_LC_MEASUREMENT 11 +#define AST_LC_PAPER 12 +#define AST_LC_COUNT 13 /* number of preceding AST_LC_* defines */ #define AST_LC_LANG 255 #define AST_LC_internal 1 @@ -212,9 +214,6 @@ #ifndef LC_TELEPHONE #define LC_TELEPHONE (-AST_LC_TELEPHONE) #endif -#ifndef LC_XLITERATE -#define LC_XLITERATE (-AST_LC_XLITERATE) -#endif #ifndef LC_MEASUREMENT #define LC_MEASUREMENT (-AST_LC_MEASUREMENT) #endif @@ -295,14 +294,6 @@ extern int rename(const char*, const char*); #endif -#if !defined(strchr) && !defined(_lib_strchr) && defined(_lib_index) -#define strchr(s,c) index(s,c) -#endif - -#if !defined(strrchr) && !defined(_lib_strrchr) && defined(_lib_rindex) -#define strrchr(s,c) rindex(s,c) -#endif - /* and now introducing prototypes botched by the standard(s) */ #undef getpgrp
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/ast_windows.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/ast_windows.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,8 +29,6 @@ #ifndef _AST_WINDOWS_H #define _AST_WINDOWS_H 1 -#undef SF_ERROR /* clash in <oaidl.h> */ - /* * For some reason, DECLSPEC_NORETURN breaks when compiling with * -std=c99. C11 does not have this problem, so for C99 and below
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/proc.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/proc.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -64,8 +64,8 @@ #define PROC_fd_ctty 0xc -#define PROC_op1(o,a) (((o)<<(2*PROC_ARG_BIT))|((a)&((PROC_ARG_NULL<<PROC_ARG_BIT)|PROC_ARG_NULL))) -#define PROC_op2(o,a,b) (((o)<<(2*PROC_ARG_BIT))|(((b)&PROC_ARG_NULL)<<PROC_ARG_BIT)|((a)&PROC_ARG_NULL)) +#define PROC_op1(o,a) (((long)(o)<<(2*PROC_ARG_BIT))|((long)(a)&((PROC_ARG_NULL<<PROC_ARG_BIT)|PROC_ARG_NULL))) +#define PROC_op2(o,a,b) (((long)(o)<<(2*PROC_ARG_BIT))|(((long)(b)&PROC_ARG_NULL)<<PROC_ARG_BIT)|((long)(a)&PROC_ARG_NULL)) #define PROC_FD_CLOSE(p,f) PROC_op2(PROC_fd_dup|(f),p,PROC_ARG_NULL) #define PROC_FD_CTTY(f) PROC_op1(PROC_fd_ctty,f)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/sfio.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/sfio.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -21,7 +21,7 @@ #ifndef _SFIO_H #define _SFIO_H 1 -#define SFIO_VERSION 20230517L +#define SFIO_VERSION 20240303L /* Public header file for the sfio library ** @@ -119,69 +119,58 @@ #endif /* bits for various types of files */ -#define SF_READ 0000001 /* open for reading */ -#define SF_WRITE 0000002 /* open for writing */ -#define SF_STRING 0000004 /* a string stream */ -#define SF_APPENDWR 0000010 /* file is in append mode only */ -#define SF_MALLOC 0000020 /* buffer is malloc'd */ -#define SF_LINE 0000040 /* line buffering */ -#define SF_SHARE 0000100 /* stream with shared file descriptor */ -#define SF_EOF 0000200 /* eof was detected */ -#define SF_ERROR 0000400 /* an error happened */ -#define SF_STATIC 0001000 /* a stream that cannot be freed */ -#define SF_IOCHECK 0002000 /* call exceptf before doing IO */ -#define SF_PUBLIC 0004000 /* SF_SHARE and follow physical seek */ -#define SF_WHOLE 0020000 /* preserve wholeness of sfwrite/sfputr */ -#define SF_IOINTR 0040000 /* return on interrupts */ -#define SF_WCWIDTH 0100000 /* wcwidth display stream */ +#define SFIO_READ 0000001 /* open for reading */ +#define SFIO_WRITE 0000002 /* open for writing */ +#define SFIO_STRING 0000004 /* a string stream */ +#define SFIO_APPENDWR 0000010 /* file is in append mode only */ +#define SFIO_MALLOC 0000020 /* buffer is malloc'd */ +#define SFIO_LINE 0000040 /* line buffering */ +#define SFIO_SHARE 0000100 /* stream with shared file descriptor */ +#define SFIO_EOF 0000200 /* eof was detected */ +#define SFIO_ERROR 0000400 /* an error happened */ +#define SFIO_STATIC 0001000 /* a stream that cannot be freed */ +#define SFIO_IOCHECK 0002000 /* call exceptf before doing IO */ +#define SFIO_PUBLIC 0004000 /* SFIO_SHARE and follow physical seek */ +#define SFIO_WHOLE 0020000 /* preserve wholeness of sfwrite/sfputr */ +#define SFIO_IOINTR 0040000 /* return on interrupts */ +#define SFIO_WCWIDTH 0100000 /* wcwidth display stream */ #define SFIO_FLAGS 0177177 /* PUBLIC FLAGS PASSABLE TO SFNEW() */ -#ifdef _typ_struct_sf_hdtr -#define _SF_HIDESFFLAGS 1 -#endif -#define SF_SETS 0177163 /* flags passable to sfset() */ +#define SFIO_SETS 0177163 /* flags passable to sfset() */ -#ifndef _SF_NO_OBSOLETE -#define SF_BUFCONST 0400000 /* unused flag - for compatibility only */ +#ifndef _SFIO_NO_OBSOLETE +#define SFIO_BUFCONST 0400000 /* unused flag - for compatibility only */ #endif /* for sfgetr/sfreserve to hold a record */ -#define SF_LOCKR 0000010 /* lock record, stop access to stream */ -#define SF_LASTR 0000020 /* get the last incomplete record */ - -/* exception events: SF_NEW(0), SF_READ(1), SF_WRITE(2) and the below */ -#define SF_SEEK 3 /* seek error */ -#define SF_CLOSING 4 /* when stream is about to be closed */ -#define SF_DPUSH 5 /* when discipline is being pushed */ -#define SF_DPOP 6 /* when discipline is being popped */ -#define SF_DPOLL 7 /* see if stream is ready for I/O */ -#define SF_DBUFFER 8 /* buffer not empty during push or pop */ -#define SF_SYNC 9 /* announcing start/end synchronization */ -#define SF_PURGE 10 /* a sfpurge() call was issued */ -#define SF_FINAL 11 /* closing is done except stream free */ -#define SF_READY 12 /* a polled stream is ready */ -#define SF_LOCKED 13 /* stream is in a locked state */ -#define SF_ATEXIT 14 /* process is exiting */ -#define SF_EVENT 100 /* start of user-defined events */ +#define SFIO_LOCKR 0000010 /* lock record, stop access to stream */ +#define SFIO_LASTR 0000020 /* get the last incomplete record */ + +/* exception events: SFIO_NEW(0), SFIO_READ(1), SFIO_WRITE(2) and the below */ +#define SFIO_SEEK 3 /* seek error */ +#define SFIO_CLOSING 4 /* when stream is about to be closed */ +#define SFIO_DPUSH 5 /* when discipline is being pushed */ +#define SFIO_DPOP 6 /* when discipline is being popped */ +#define SFIO_DPOLL 7 /* see if stream is ready for I/O */ +#define SFIO_DBUFFER 8 /* buffer not empty during push or pop */ +#define SFIO_SYNC 9 /* announcing start/end synchronization */ +#define SFIO_PURGE 10 /* a sfpurge() call was issued */ +#define SFIO_FINAL 11 /* closing is done except stream free */ +#define SFIO_READY 12 /* a polled stream is ready */ +#define SFIO_LOCKED 13 /* stream is in a locked state */ +#define SFIO_ATEXIT 14 /* process is exiting */ +#define SFIO_EVENT 100 /* start of user-defined events */ /* for stack and disciplines */ -#define SF_POPSTACK NULL /* pop the stream stack */ -#define SF_POPDISC NULL /* pop the discipline stack */ +#define SFIO_POPSTACK NULL /* pop the stream stack */ +#define SFIO_POPDISC NULL /* pop the discipline stack */ /* 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_BUFSIZE 8192 /* default buffer size */ -#define SF_UNBOUND (-1) /* unbounded buffer size */ +#define SFIO_NEW 0 /* new stream */ +#define SFIO_SETFD (-1) /* about to set the file descriptor */ -/* namespace incursion workarounds -- migrate to the new names */ -#if !_mac_SF_APPEND -#define SF_APPEND SF_APPENDWR /* BSDI sys/stat.h */ -#endif -#if !_mac_SF_CLOSE -#define SF_CLOSE SF_CLOSING /* AIX sys/socket.h */ -#endif +#define SFIO_BUFSIZE 8192 /* default buffer size */ +#define SFIO_UNBOUND (-1) /* unbounded buffer size */ extern ssize_t _Sfi; extern ssize_t _Sfmaxr; @@ -284,41 +273,41 @@ extern ssize_t sfmaxr(ssize_t, int); /* coding long integers in a portable and compact fashion */ -#define SF_SBITS 6 -#define SF_UBITS 7 -#define SF_BBITS 8 -#define SF_SIGN (1 << SF_SBITS) -#define SF_MORE (1 << SF_UBITS) -#define SF_BYTE (1 << SF_BBITS) -#define SF_U1 SF_MORE -#define SF_U2 (SF_U1*SF_U1) -#define SF_U3 (SF_U2*SF_U1) -#define SF_U4 (SF_U3*SF_U1) - -#define _SF_(f) ((Sfio_t*)(f)) - -#define __sf_putd(f,v) (_sfputd(_SF_(f),(Sfdouble_t)(v))) -#define __sf_putl(f,v) (_sfputl(_SF_(f),(Sflong_t)(v))) -#define __sf_putu(f,v) (_sfputu(_SF_(f),(Sfulong_t)(v))) -#define __sf_putm(f,v,m) (_sfputm(_SF_(f),(Sfulong_t)(v),(Sfulong_t)(m))) - -#define __sf_putc(f,c) (_SF_(f)->_next >= _SF_(f)->_endw ? \ - _sfflsbuf(_SF_(f),(int)((unsigned char)(c))) : \ - (int)(*_SF_(f)->_next++ = (unsigned char)(c)) ) -#define __sf_getc(f) (_SF_(f)->_next >= _SF_(f)->_endr ? _sffilbuf(_SF_(f),0) : \ - (int)(*_SF_(f)->_next++) ) +#define SFIO_SBITS 6 +#define SFIO_UBITS 7 +#define SFIO_BBITS 8 +#define SFIO_SIGN (1 << SFIO_SBITS) +#define SFIO_MORE (1 << SFIO_UBITS) +#define SFIO_BYTE (1 << SFIO_BBITS) +#define SFIO_U1 SFIO_MORE +#define SFIO_U2 (SFIO_U1*SFIO_U1) +#define SFIO_U3 (SFIO_U2*SFIO_U1) +#define SFIO_U4 (SFIO_U3*SFIO_U1) + +#define _SFIO_(f) ((Sfio_t*)(f)) + +#define __sf_putd(f,v) (_sfputd(_SFIO_(f),(Sfdouble_t)(v))) +#define __sf_putl(f,v) (_sfputl(_SFIO_(f),(Sflong_t)(v))) +#define __sf_putu(f,v) (_sfputu(_SFIO_(f),(Sfulong_t)(v))) +#define __sf_putm(f,v,m) (_sfputm(_SFIO_(f),(Sfulong_t)(v),(Sfulong_t)(m))) + +#define __sf_putc(f,c) (_SFIO_(f)->_next >= _SFIO_(f)->_endw ? \ + _sfflsbuf(_SFIO_(f),(int)((unsigned char)(c))) : \ + (int)(*_SFIO_(f)->_next++ = (unsigned char)(c)) ) +#define __sf_getc(f) (_SFIO_(f)->_next >= _SFIO_(f)->_endr ? _sffilbuf(_SFIO_(f),0) : \ + (int)(*_SFIO_(f)->_next++) ) #define __sf_dlen(v) (_sfdlen((Sfdouble_t)(v)) ) #define __sf_llen(v) (_sfllen((Sflong_t)(v)) ) -#define __sf_ulen(v) ((Sfulong_t)(v) < SF_U1 ? 1 : (Sfulong_t)(v) < SF_U2 ? 2 : \ - (Sfulong_t)(v) < SF_U3 ? 3 : (Sfulong_t)(v) < SF_U4 ? 4 : 5) - -#define __sf_fileno(f) (_SF_(f)->_file) -#define __sf_eof(f) (_SF_(f)->_flags&SF_EOF) -#define __sf_error(f) (_SF_(f)->_flags&SF_ERROR) -#define __sf_clrerr(f) (_SF_(f)->_flags &= ~(SF_ERROR|SF_EOF)) -#define __sf_stacked(f) (_SF_(f)->_push != NULL) -#define __sf_value(f) (_SF_(f)->_val) +#define __sf_ulen(v) ((Sfulong_t)(v) < SFIO_U1 ? 1 : (Sfulong_t)(v) < SFIO_U2 ? 2 : \ + (Sfulong_t)(v) < SFIO_U3 ? 3 : (Sfulong_t)(v) < SFIO_U4 ? 4 : 5) + +#define __sf_fileno(f) (_SFIO_(f)->_file) +#define __sf_eof(f) (_SFIO_(f)->_flags&SFIO_EOF) +#define __sf_error(f) (_SFIO_(f)->_flags&SFIO_ERROR) +#define __sf_clrerr(f) (_SFIO_(f)->_flags &= ~(SFIO_ERROR|SFIO_EOF)) +#define __sf_stacked(f) (_SFIO_(f)->_push != NULL) +#define __sf_value(f) (_SFIO_(f)->_val) #define __sf_slen() (_Sfi) #define __sf_maxr(n,s) ((s)?((_Sfi=_Sfmaxr),(_Sfmaxr=(n)),_Sfi):_Sfmaxr) @@ -374,7 +363,7 @@ #ifndef _SFSTR_H /* GSF's string manipulation stuff */ #define _SFSTR_H 1 -#define sfstropen() sfnew(0, 0, -1, -1, SF_READ|SF_WRITE|SF_STRING) +#define sfstropen() sfnew(0, 0, -1, -1, SFIO_READ|SFIO_WRITE|SFIO_STRING) #define sfstrclose(f) sfclose(f) #define sfstrseek(f,p,m) \ @@ -401,19 +390,14 @@ ) #define sfstrrsrv(f,n) \ - (sfreserve((f),(n),SF_WRITE|SF_LOCKR), sfwrite((f),(f)->_next,0), \ + (sfreserve((f),(n),SFIO_WRITE|SFIO_LOCKR), sfwrite((f),(f)->_next,0), \ ((f)->_next+(n) <= (f)->_data+(f)->_size ? (char*)(f)->_next : (char*)0) \ ) #define sfstrbuf(f,b,n,m) \ - (sfsetbuf((f),(b),(n)), ((f)->_flags |= (m) ? SF_MALLOC : 0), \ + (sfsetbuf((f),(b),(n)), ((f)->_flags |= (m) ? SFIO_MALLOC : 0), \ ((f)->_data == (unsigned char*)(b) ? 0 : -1) \ ) #endif /* _SFSTR_H */ - -#ifdef _SF_HIDESFFLAGS -#undef SFIO_FLAGS -#define SFIO_FLAGS 0177177 /* PUBLIC FLAGS PASSABLE TO SFNEW() */ -#endif #endif /* _SFIO_H */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/sfio_t.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/sfio_t.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -56,14 +56,14 @@ #include "sfio.h" /* mode bit to indicate that the structure hasn't been initialized */ -#define SF_INIT 0000004 -#define SF_DCDOWN 00010000 +#define SFIO_INIT 0000004 +#define SFIO_DCDOWN 00010000 /* shorthand for common stream types */ -#define SF_RDWR (SF_READ|SF_WRITE) -#define SF_RDSTR (SF_READ|SF_STRING) -#define SF_WRSTR (SF_WRITE|SF_STRING) -#define SF_RDWRSTR (SF_RDWR|SF_STRING) +#define SFIO_RDWR (SFIO_READ|SFIO_WRITE) +#define SFIO_RDSTR (SFIO_READ|SFIO_STRING) +#define SFIO_WRSTR (SFIO_WRITE|SFIO_STRING) +#define SFIO_RDWRSTR (SFIO_RDWR|SFIO_STRING) /* for static initialization of an Sfio_t structure */ #define SFNEW(data,size,file,type,disc) \ @@ -82,7 +82,7 @@ 0, /* ngetr */ \ {0}, /* tiny */ \ 0, /* bits */ \ - (unsigned int)(((type)&(SF_RDWR))|SF_INIT), /* mode */ \ + (unsigned int)(((type)&(SFIO_RDWR))|SFIO_INIT), /* mode */ \ (struct _sfdisc_s*)(disc), /* disc */ \ NULL, /* pool */ \ NULL, /* rsrv */ \ @@ -122,9 +122,9 @@ ) /* expose next stream inside discipline function; state saved in int f */ -#define SFDCNEXT(sp,f) (((f)=(sp)->bits&SF_DCDOWN),(sp)->bits|=SF_DCDOWN) +#define SFDCNEXT(sp,f) (((f)=(sp)->bits&SFIO_DCDOWN),(sp)->bits|=SFIO_DCDOWN) /* restore SFDCNEXT() state from int f */ -#define SFDCPREV(sp,f) ((f)?(0):((sp)->bits&=~SF_DCDOWN)) +#define SFDCPREV(sp,f) ((f)?(0):((sp)->bits&=~SFIO_DCDOWN)) #endif /* _SFIO_T_H */
View file
_service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/stak.h
Added
@@ -0,0 +1,51 @@ +/*********************************************************************** +* * +* This software is part of the ast package * +* Copyright (c) 1985-2011 AT&T Intellectual Property * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * +* and is licensed under the * +* Eclipse Public License, Version 2.0 * +* * +* A copy of the License is available at * +* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html * +* (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) * +* * +* Glenn Fowler <gsf@research.att.com> * +* David Korn <dgk@research.att.com> * +* Phong Vo <kpv@research.att.com> * +* Martijn Dekker <martijn@inlv.org> * +* * +***********************************************************************/ +/* + * David Korn + * AT&T Research + * + * Obsolete interface definitions for a stack-like storage library. + * These now simply map onto the current stk(3) functions as below. + */ + +#ifndef _STAK_H +#define _STAK_H + +#include <stk.h> + +#define Stak_t Sfio_t +#define staksp stkstd +#define STAK_SMALL STK_SMALL + +#define stakptr(n) stkptr(stkstd,n) +#define staktell() stktell(stkstd) +#define stakputc(c) sfputc(stkstd,(c)) +#define stakwrite(b,n) sfwrite(stkstd,(b),(n)) +#define stakputs(s) (sfputr(stkstd,(s),0),--stkstd->_next) +#define stakseek(n) stkseek(stkstd,n) +#define stakcreate(n) stkopen(n) +#define stakinstall(s,f) stkinstall(s,f) +#define stakdelete(s) stkclose(s) +#define staklink(s) stklink(s) +#define stakalloc(n) stkalloc(stkstd,n) +#define stakcopy(s) stkcopy(stkstd,s) +#define stakset(c,n) stkset(stkstd,c,n) +#define stakfreeze(n) stkfreeze(stkstd,n) + +#endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/include/stk.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/include/stk.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,25 +35,27 @@ #define Stk_t Sfio_t -#define STK_SMALL 1 /* small stkopen stack */ +/* option bits for stkopen() */ +#define STK_SMALL 1 /* allocate small stack frames */ #define STK_NULL 2 /* return NULL on overflow */ #define stkptr(sp,n) ((char*)((sp)->_data)+(n)) #define stktop(sp) ((char*)(sp)->_next) #define stktell(sp) ((sp)->_next-(sp)->_data) -#define stkseek(sp,n) ((n)==0?(char*)((sp)->_next=(sp)->_data):_stkseek(sp,n)) +#define stkseek(sp,n) ((n)==0?(void*)((sp)->_next=(sp)->_data):_stkseek(sp,n)) extern Sfio_t _Stk_data; extern Stk_t* stkopen(int); -extern Stk_t* stkinstall(Stk_t*, char*(*)(size_t)); +extern Stk_t* stkinstall(Stk_t*, char*(*)(size_t)); /* deprecated */ +extern void stkoverflow(Stk_t*, void*(*)(size_t)); extern int stkclose(Stk_t*); extern unsigned int stklink(Stk_t*); -extern char* stkalloc(Stk_t*, size_t); +extern void* stkalloc(Stk_t*, size_t); extern char* stkcopy(Stk_t*, const char*); -extern char* stkset(Stk_t*, char*, size_t); -extern char* _stkseek(Stk_t*, ssize_t); -extern char* stkfreeze(Stk_t*, size_t); +extern void* stkset(Stk_t*, void*, size_t); +extern void* _stkseek(Stk_t*, ssize_t); +extern void* stkfreeze(Stk_t*, size_t); extern int stkon(Stk_t*, char*); #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/compat.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/compat.3
Changed
@@ -43,7 +43,6 @@ .EX #include <ast.h> -int atexit(void(*)(void)); char* confstr(int); int dup2(int, int); long fpathconf(int, int);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/fmt.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/fmt.3
Changed
@@ -44,7 +44,7 @@ #include <ast.h> #include <ls.h> -char* fmtbase(long \fInumber\fP, int \fIbase\fP, int \fIprefix\fP); +char* fmtint(intmax_t \fInumber\fP, int \fIunsign\fP); char* fmtdev(struct stat* \fIst\fP); char* fmtelapsed(unsigned long \fIcount\fP, int \fIpersec\fP) char* fmterror(int \fIerrno\fP); @@ -73,19 +73,14 @@ There is nothing spectacular about this collection other than that it provides a single place where the exact format is spelled out. .PP -.L fmtbase -formats a base -.I base -representation for +.L fmtint +is a performance-optimized function for formatting a base-10 integer .IR number . If -.I "prefix != 0" -then the base prefix is included in the formatted string. -If -.I "number == 0" -or -.I "base == 0" -then the output is signed base 10. +.I "unsign != 0" +then the +.IR number +is treated as unsigned. .PP .L fmtdev returns the device handle name specified by the
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/setenviron.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/setenviron.3
Changed
@@ -73,7 +73,3 @@ as the first environment variable name. .SH "SEE ALSO" env(1), exec(2) -.SH BUGS -POSIX will eventually settle on an interface. -It has already picked a few of the names we did in .2 drafts. -This is about the third name change for ours.
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/sfio.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/sfio.3
Changed
@@ -1,5 +1,5 @@ .fp 5 CW -.TH SFIO 3 "12 February 2022" +.TH SFIO 3 "2 March 2024" .SH NAME \fBsfio\fR \- safe/fast string/file input/output .SH SYNOPSIS @@ -51,18 +51,18 @@ .Ss "BIT FLAGS" .nf .ft 5 -SF_STRING -SF_READ -SF_WRITE -SF_APPENDWR (SF_APPEND) -SF_LINE -SF_SHARE -SF_PUBLIC -SF_MALLOC -SF_STATIC -SF_IOCHECK -SF_WHOLE -SF_IOINTR +SFIO_STRING +SFIO_READ +SFIO_WRITE +SFIO_APPENDWR +SFIO_LINE +SFIO_SHARE +SFIO_PUBLIC +SFIO_MALLOC +SFIO_STATIC +SFIO_IOCHECK +SFIO_WHOLE +SFIO_IOINTR .ft 1 .fi .Ss "OPENING/CLOSING STREAMS" @@ -166,22 +166,22 @@ ssize_t sfwr(Sfio_t* f, const void* buf, size_t n, Sfdisc_t* disc); Sfoff_t sfsk(Sfio_t* f, Sfoff_t offset, int type, Sfdisc_t* disc); -SF_NEW -SF_READ -SF_WRITE -SF_SEEK -SF_CLOSING (SF_CLOSE) -SF_DPUSH -SF_DPOP -SF_DPOLL -SF_DBUFFER -SF_SYNC -SF_PURGE -SF_FINAL -SF_READY -SF_LOCKED -SF_ATEXIT -SF_EVENT +SFIO_NEW +SFIO_READ +SFIO_WRITE +SFIO_SEEK +SFIO_CLOSING +SFIO_DPUSH +SFIO_DPOP +SFIO_DPOLL +SFIO_DBUFFER +SFIO_SYNC +SFIO_PURGE +SFIO_FINAL +SFIO_READY +SFIO_LOCKED +SFIO_ATEXIT +SFIO_EVENT .ft 1 .fi .Ss "STREAM CONTROL" @@ -335,46 +335,46 @@ They are set either at stream initialization or by calling \f3sfset()\fP. Following are the flags: .Tp -\f3SF_STRING\fP: +\f3SFIO_STRING\fP: The stream is memory-based. .Tp -\f3SF_READ\fP, \f3SF_WRITE\fP, \f3SF_APPENDWR\fP (\f3SF_APPEND\fP): -Flags \f3SF_READ\fP and \f3SF_WRITE\fP indicate readability and writability. -Flag \f3SF_APPENDWR\fP asserts that the stream is a file opened in append mode +\f3SFIO_READ\fP, \f3SFIO_WRITE\fP, \f3SFIO_APPENDWR\fP: +Flags \f3SFIO_READ\fP and \f3SFIO_WRITE\fP indicate readability and writability. +Flag \f3SFIO_APPENDWR\fP asserts that the stream is a file opened in append mode (see \f3open(2)\fP and \f3fcntl(2)\fP) so that data is always output at the end of file. On systems without direct support for append mode, Sfio uses \f3lseek(2)\fP or its discipline replacement to approximate this behavior. .Tp -\f3SF_LINE\fP: +\f3SFIO_LINE\fP: The stream is line-oriented. -For a \f3SF_WRITE\fP stream, +For a \f3SFIO_WRITE\fP stream, this means that buffered data is flushed whenever a new-line character, \f3\en\fP, is output. -For a \f3SF_READ\fP stream, \f3SF_LINE\fP is only +For a \f3SFIO_READ\fP stream, \f3SFIO_LINE\fP is only significant during calls to functions in the \f3sfscanf()\fP family. -\f3SF_LINE\fP is set on initialization of +\f3SFIO_LINE\fP is set on initialization of any stream representing a terminal device. .Tp -\f3SF_SHARE\fP, \f3SF_PUBLIC\fP: -Flag \f3SF_SHARE\fP means that the underlying file descriptor +\f3SFIO_SHARE\fP, \f3SFIO_PUBLIC\fP: +Flag \f3SFIO_SHARE\fP means that the underlying file descriptor is shared by independent entities (for example, multiple processes). -For a seekable file stream, \f3SF_SHARE\fP means that +For a seekable file stream, \f3SFIO_SHARE\fP means that the logical stream and the physical file positions will be made the same before a system call to perform physical I/O. There are different possibilities. -If \f3SF_PUBLIC\fP is not set, +If \f3SFIO_PUBLIC\fP is not set, the physical file position is made equal to the logical stream position. -If \f3SF_PUBLIC\fP is set, there are two cases. +If \f3SFIO_PUBLIC\fP is set, there are two cases. If the physical file position has changed from its last known position, the logical stream position is made equal to the new physical file position. Finally, if the physical file location remains the same as its last known position, the physical file position is made the same as the logical stream position. For an unseekable stream (e.g., pipes or terminal devices), if possible, -\f3SF_SHARE\fP means that +\f3SFIO_SHARE\fP means that the block and record I/O operations (\f3sfread()\fP, \f3sfwrite()\fP, \f3sfmove()\fP, \f3sfgetr()\fP, \f3sfputr()\fP, \f3sfreserve()\fP, \f3sfscanf()\fP and \f3sfvprintf()\fP) will ensure: @@ -383,37 +383,37 @@ Note, however, that (2) is not always possible without proper OS facilities such as \f3recv(2)\fP or \f3streamio(4)\fP. -A standard stream that is seekable will be initialized with \f3SF_SHARE|SF_PUBLIC\fP. +A standard stream that is seekable will be initialized with \f3SFIO_SHARE|SFIO_PUBLIC\fP. .Tp -\f3SF_MALLOC\fP: +\f3SFIO_MALLOC\fP: The stream buffer was obtained via \f3malloc(3)\fP and can be reallocated or freed. .Tp -\f3SF_STATIC\fP: +\f3SFIO_STATIC\fP: The stream structure should not be freed when closed (\f3sfclose()\fP). This flag is used by an applications that allocate their own stream structures. Such applications must use the header file \f3sfio_t.h\fP instead of \f3sfio.h\fP. .Tp -\f3SF_IOCHECK\fP: +\f3SFIO_IOCHECK\fP: If the stream has a discipline exception handler, exceptions will be raised in \f3sfsync()\fP, \f3sfpurge()\fP or before a system call \f3read(2)\fP or \f3write(2)\fP (see \f3sfdisc()\fP). .Tp -\f3SF_WHOLE\fP: +\f3SFIO_WHOLE\fP: This flag guarantees that data written in any single \f3sfwrite()\fP or \f3sfputr()\fP call will always be output as a whole to the output device. This is useful in certain applications (e.g., networking) where a complex object must be output without being split in different system calls. Note that the respective stream still buffers data as much as the buffer can accommodate. .Tp -\f3SF_IOINTR\fP: +\f3SFIO_IOINTR\fP: This flag indicates that I/O system calls should not be resumed after being interrupted by signals. It is useful for aborting I/O operations on such interruptions. Note, however, that certain operating systems (e.g., BSD Unix systems) may automatically resume interrupted system calls outside the scope of the library. On such systems, -\f3SF_IOINTR\fP will be ineffective. +\f3SFIO_IOINTR\fP will be ineffective. .Ss "OPENING/CLOSING STREAMS" .Ss " Sfio_t* sfnew(Sfio_t* f, void* buf, size_t size, int fd, int flags)" This function creates or renews a stream. @@ -422,10 +422,10 @@ \f3f\fP: If \f3f\fP is \f3NULL\fP, a new stream is created. Otherwise, \f3f\fP is reused. -In this case, if \f3flags\fP does not have \f3SF_EOF\fP, +In this case, if \f3flags\fP does not have \f3SFIO_EOF\fP, \f3f\fP shall be closed via \f3sfclose()\fP before being reused. During a stream renewal, buffer, pool and discipline stack are preserved. -Note that, except for \f3SF_STATIC\fP streams, +Note that, except for \f3SFIO_STATIC\fP streams, renewing a stream already closed will result in undefined behavior. .Tp \f3buf\fP, \f3size\fP: @@ -433,14 +433,14 @@ See \f3sfsetbuf()\fP for more details. .Tp \f3fd\fP: -If \f3SF_STRING\fP is specified in \f3flags\fP, this is ignored. +If \f3SFIO_STRING\fP is specified in \f3flags\fP, this is ignored. Otherwise, \f3fd\fP is a file descriptor (e.g., from \f3open(2)\fP) to use for raw data I/O. Note that Sfio supports unseekable file descriptors opened for both read and write, e.g., sockets. .Tp \f3flags\fP: -This is composed from \f3SF_EOF\fP and +This is composed from \f3SFIO_EOF\fP and bit values defined in the \fBBIT FLAGS\fP section. .Ss " Sfio_t* sfopen(Sfio_t* f, const char* string, const char* mode)" @@ -452,7 +452,7 @@ This somewhat unusual usage of \f3sfopen()\fP is good for resetting certain predefined modes in standard streams including \fItext/binary\fP and \fIappend\fP that are inherited from some parent process. -Note also that \f3SF_READ\fP and \f3SF_WRITE\fP can only be reset if the stream +Note also that \f3SFIO_READ\fP and \f3SFIO_WRITE\fP can only be reset if the stream is not yet initialized. \f3sfopen()\fP is normally used to create a new stream or renew a stream. @@ -515,7 +515,7 @@ if there are no shell meta-characters in \f3cmd\fP. .Ss " Sfio_t* sfstropen(void)" Shorthand that opens a new string buffer for reading and writing; -same as \f3sfnew(NULL,NULL,-1,-1,SF_READ|SF_WRITE|SF_STRING)\fP. +same as \f3sfnew(NULL,NULL,-1,-1,SFIO_READ|SFIO_WRITE|SFIO_STRING)\fP. See also .BR sfstruse() . .Ss " Sfio_t* sftmp(size_t size)" @@ -523,7 +523,7 @@ It returns the new stream or \f3NULL\fP on error. A stream created by \f3sftmp()\fP can be completely or partially memory-resident. -If \f3size\fP is \f3SF_UNBOUND\fP, the stream is a pure string stream. +If \f3size\fP is \f3SFIO_UNBOUND\fP, the stream is a pure string stream. If \f3size\fP is zero, the stream is a pure file stream. Otherwise, the stream is first created as a string stream but when its buffer grows larger than \f3size\fP or on any attempt to change disciplines, @@ -538,7 +538,7 @@ If neither of \f3TMPPATH\fP and \f3TMPDIR\fP are defined, \f3/tmp\fP is used. .Ss " int sfclose(Sfio_t* f)" This function closes the stream \f3f\fP and frees its resources. -\f3SF_STATIC\fP should be used if the stream space is to be preserved. +\f3SFIO_STATIC\fP should be used if the stream space is to be preserved. If \f3f\fP is the base of a stream stack (see \f3sfstack()\fP), all streams on the stack are closed. If \f3f\fP is a \f3sfpopen\fP-stream, @@ -546,15 +546,15 @@ and returns its exit status. \f3sfclose()\fP returns \f3-1\fP for failure and \f30\fP for success. -\f3SF_READ|SF_SHARE\fP and \f3SF_WRITE\fP streams +\f3SFIO_READ|SFIO_SHARE\fP and \f3SFIO_WRITE\fP streams are synchronized before closing (see \f3sfsync()\fP). If \f3f\fP has disciplines, their exception handlers will be called twice. The first exception handler call has the \f3type\fP argument as one of -\f3SF_CLOSING\fP or \f3SF_NEW\fP (see \f3sfdisc()\fP). -The latter, \f3SF_NEW\fP is used when a stream is being closed via \f3sfnew()\fP +\f3SFIO_CLOSING\fP or \f3SFIO_NEW\fP (see \f3sfdisc()\fP). +The latter, \f3SFIO_NEW\fP is used when a stream is being closed via \f3sfnew()\fP so that it can be renewed. -The second call uses \f3type\fP as \f3SF_FINAL\fP +The second call uses \f3type\fP as \f3SFIO_FINAL\fP and is done after all closing operations have succeeded but before the stream itself is deallocated. In either case, if the exception handler returns a negative value, @@ -625,16 +625,16 @@ The \f3type\fP argument is composed of some subset of the below bit flags: .Tp -\f3SF_STRING\fP: +\f3SFIO_STRING\fP: A null byte will replace the record separator to make the record into a C string. Otherwise, the record separator is left alone. .Tp -\f3SF_LOCKR\fP: +\f3SFIO_LOCKR\fP: Upon successfully obtaining a record \f3r\fP, the stream will be locked from further access until it is released with a call \f3sfread(f,r,0)\fP. .Tp -\f3SF_LASTR\fP: +\f3SFIO_LASTR\fP: This should be used only after a failed \f3sfgetr()\fP to retrieve the last incomplete record. In this case, \f3rsc\fP is ignored. .Ss " ssize_t sfputr(Sfio_t* f, const char* s, int rsc)" @@ -662,16 +662,16 @@ It returns the number of bytes actually read or \f3-1\fP on error. .Ss " ssize_t sfwrite(Sfio_t* f, const void* buf, size_t n)" This function writes \f3n\fP bytes from \f3buf\fP to \f3f\fP. -If \f3f\fP is \f3SF_STRING\fP, and the buffer is not large enough, -an \f3SF_WRITE\fP exception shall be raised. +If \f3f\fP is \f3SFIO_STRING\fP, and the buffer is not large enough, +an \f3SFIO_WRITE\fP exception shall be raised. \f3sfwrite()\fP returns the number of bytes written or \f3-1\fP on failure. .Ss " Sfoff_t sfseek(Sfio_t* f, Sfoff_t offset, int type)" This function sets a new I/O position for \f3f\fP. It returns the new position or \f3-1\fP on failure. -If the stream is a \f3SF_STRING\fP stream and the new +If the stream is a \f3SFIO_STRING\fP stream and the new address is beyond the current buffer extent, -an \f3SF_SEEK\fP exception will be raised (see \f3sfdisc()\fP). +an \f3SFIO_SEEK\fP exception will be raised (see \f3sfdisc()\fP). The new position is determined based on \f3offset\fP and \f3type\fP which is composed from the bit flags: @@ -680,18 +680,18 @@ \f3offset\fP is the desired position. .Tp \f31\fP or \f3SEEK_CUR\fP: -\f3offset\fP is relative to the current position (see \f3SF_PUBLIC\fP below). +\f3offset\fP is relative to the current position (see \f3SFIO_PUBLIC\fP below). .Tp \f32\fP or \f3SEEK_END\fP: \f3offset\fP is relative to the physical end of file. .Tp -\f3SF_SHARE\fP: -The stream is treated as if it has the control bit \f3SF_SHARE\fP on. +\f3SFIO_SHARE\fP: +The stream is treated as if it has the control bit \f3SFIO_SHARE\fP on. This implies that a system call seek will be done to ensure that the location seeking to is valid. .Tp -\f3SF_PUBLIC\fP: -The stream is treated as if it has the control bit \f3SF_PUBLIC\fP on. +\f3SFIO_PUBLIC\fP: +The stream is treated as if it has the control bit \f3SFIO_PUBLIC\fP on. If the physical file position has changed from its last known location, the current position is taken as the new physical position. Otherwise, the current position is the logical stream position. @@ -699,19 +699,19 @@ This function reserves a data block from the stream \f3f\fP. It returns the reserved data block on success and \f3NULL\fP on failure. -If \f3f\fP is a \f3SF_READ\fP stream, the data block is a segment of input data. -If \f3f\fP is a \f3SF_WRITE\fP stream, the data block is a buffer +If \f3f\fP is a \f3SFIO_READ\fP stream, the data block is a segment of input data. +If \f3f\fP is a \f3SFIO_WRITE\fP stream, the data block is a buffer suitable for writing output data. -For consistency, if \f3f\fP is opened with \f3SF_READ|SF_WRITE\fP, -it will normally be treated as if it is a \f3SF_READ\fP stream +For consistency, if \f3f\fP is opened with \f3SFIO_READ|SFIO_WRITE\fP, +it will normally be treated as if it is a \f3SFIO_READ\fP stream (see \f3sfset()\fP for forcing a particular mode) but the returned buffer can also be written into (more below). -However, it is possible to bias to \f3SF_WRITE\fP when the \f3type\fP -argument is non-negative by adding the \f3SF_WRITE\fP bit \f3type\fP. +However, it is possible to bias to \f3SFIO_WRITE\fP when the \f3type\fP +argument is non-negative by adding the \f3SFIO_WRITE\fP bit \f3type\fP. In any case, a reserved data block is guaranteed to be valid only until a future access to the stream \f3f\fP. -When \f3f\fP is \f3SF_READ\fP, \f3SF_SHARE\fP and unseekable, +When \f3f\fP is \f3SFIO_READ\fP, \f3SFIO_SHARE\fP and unseekable, \f3sfreserve()\fP will attempt to peek at input data without consuming it. This enables separate processes to share in reading input from unseekable file descriptors (e.g., pipes or devices). @@ -723,12 +723,12 @@ \f3sfvalue(f)\fP gives the size of the available data block. Any partially reserved data block after a failed \f3sfreserve()\fP call can be obtained in another \f3sfreserve()\fP call with the argument -\f3type\fP being \f3SF_LASTR\fP. The second argument \f3n\fP +\f3type\fP being \f3SFIO_LASTR\fP. The second argument \f3n\fP to \f3sfreserve()\fP will be ignored in this case. A \f3sfreserve()\fP call is successful if it can obtain a data block of size at least the absolute value of \f3n\fP. -For a \f3SF_READ\fP atream, the argument \f3n\fP is treated as follows: +For a \f3SFIO_READ\fP atream, the argument \f3n\fP is treated as follows: .Tp \f3n < 0\fP: \f3sfreserve()\fP attempts to get \fIat least\fP \f3|n|\fP bytes @@ -741,21 +741,21 @@ If \f3type != 0\fP, no attempt will be made to read data into the buffer. For example, the call \f3sfreserve(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 \f3sfreserve(f, 0, SF_LOCKR)\fP is similar but also locks the stream. +The call \f3sfreserve(f, 0, SFIO_LOCKR)\fP is similar but also locks the stream. .Tp \f3n > 0\fP: \f3sfreserve()\fP will use attempt to get \fIat most\fP \f3n\fP bytes into -the buffer. Further, if \f3type == 3SF_LOCKR\fP (see below), read attempts +the buffer. Further, if \f3type == 3SFIO_LOCKR\fP (see below), read attempts end on a positive amount. For a successful reservation, the argument \f3type\fP dictates treatment as follows: .Tp -\f3type == SF_LASTR\fP: -After a \f3sfreserve()\fP call with \f3type != SF_LOCKR\fP fails, +\f3type == SFIO_LASTR\fP: +After a \f3sfreserve()\fP call with \f3type != SFIO_LOCKR\fP fails, there may be some left over data not accessible via conventional Sfio calls. Immediately after such a failed call, -another call to \f3sfreserve\fP with \f3type == SF_LASTR\fP will return any left over +another call to \f3sfreserve\fP with \f3type == SFIO_LASTR\fP will return any left over data and also advance the stream I/O position by the amount of returned data. .Tp \f3type < 0\fP: @@ -766,20 +766,20 @@ buffer of data and simultaneously advance the stream I/O position by the amount indicated by \f3sfvalue(f)\fP. .Tp -\f3type == SF_LOCKR\fP: +\f3type == SFIO_LOCKR\fP: The stream I/O position remains unchanged. In addition, \f3f\fP will be locked from further access. -As appropriate to the stream type (\f3SF_READ\fP, \f3SF_WRITE\fP or both), +As appropriate to the stream type (\f3SFIO_READ\fP, \f3SFIO_WRITE\fP or both), \f3f\fP can be unlocked later with one of \f3sfread(f,rsrv,size)\fP or \f3sfwrite(f,rsrv,size)\fP where \f3rsrv\fP is the reserved data block and \f3size\fP is the amount of -data to be consumed. For example, if \f3f\fP is a locked \f3SF_READ\fP stream, +data to be consumed. For example, if \f3f\fP is a locked \f3SFIO_READ\fP stream, the call \f3sfread(f,rsrv,1)\fP will reopen the stream and simultaneously advance the stream I/O position by \f31\fP. Finally, a stream opened for both reading and writing can release the lock with either call (with associated operational semantics!) For example, the below code reads 10 bytes of data from a stream -opened with both \f3SF_READ\fP and \f3SF_WRITE\fP, modifies the data in place, +opened with both \f3SFIO_READ\fP and \f3SFIO_WRITE\fP, modifies the data in place, then rewrites the new data back to the stream: .nf .ft 5 @@ -823,12 +823,12 @@ The top environment of a stack, say \f3fe\fP, is automatically popped whenever its format string is completely processed. In this case, its event-handling function (if any) is called -as \f3(*eventf)(f,SF_FINAL,NULL,fe)\fP. +as \f3(*eventf)(f,SFIO_FINAL,NULL,fe)\fP. The top environment can also be popped by giving an argument \f3NULL\fP to \f3%!\fP or by returning a negative value in an extension function. In these cases, the event-handling function is called -as \f3(*eventf)(f,SF_DPOP,form,fe)\fP where \f3form\fP is the remainder +as \f3(*eventf)(f,SFIO_DPOP,form,fe)\fP where \f3form\fP is the remainder of the format string. A negative return value from the event handling function will prevent the environment from being popped. @@ -1068,7 +1068,7 @@ .PP The standard patterns are: \f3n, s, c, %, h, i, d, p, u, o, x, X, g, G, e, E, f\fP and \f3!\fP. -Except for \f3!\fP which shall be described below, +Except for \f3!\fP (which is described under \f3%! and Sffmt_t\fP above), see the ANSI C specification of \f3fprintf(3)\fP for details on the other patterns. Let \f3z\fP be some pattern type. A formatting pattern is defined as below: .nf @@ -1083,7 +1083,8 @@ Arguments are numbered so that the first argument after \f3format\fP is at position 1. If \f3pos\fP is not specified, the argument following the most recently used one will be used. -The pattern \f3%!\fP (see below) cannot be used subsequent to a usage of \f3pos$\fP. +The pattern \f3%!\fP (see \f3%! and Sffmt_t\fP above) +cannot be used subsequent to a usage of \f3pos$\fP. Doing so may cause unexpected behaviors. .Tp \f3flag\fP: @@ -1267,13 +1268,13 @@ .PP A white space character (blank, tab, or new-line) in \f3format\fP normally matches a maximal sequence of input white space characters. -However, if the input stream is in \f3SF_LINE\fP mode (see \f3sfset()\fP), +However, if the input stream is in \f3SFIO_LINE\fP mode (see \f3sfset()\fP), a new-line character only matches white spaces up to an input new-line character. This is useful to avoid blocking when scanning typed inputs. .PP The standard scan patterns are: \f3i, d, u, o, x, X, p, n, f, e, E, g, G, c, %, s, \fP and \f3!\fP. -Except for \f3!\fP which shall be described below, +Except for \f3!\fP (which is described under \f3%! and Sffmt_t\fP above), see the ANSI C specification of \f3fscanf(3)\fP for details on other patterns. Let \f3z\fP be some pattern type. A formatting pattern is specified as below: .nf @@ -1288,7 +1289,8 @@ Arguments are numbered so that the first argument after \f3format\fP is at position 1. If \f3pos\fP is not specified, the argument following the most recently used one will be used. -The pattern \f3%!\fP (see below) cannot be used subsequent to a usage of \f3pos$\fP. +The pattern \f3%!\fP (see \f3%! and Sffmt_t\fP above) +cannot be used subsequent to a usage of \f3pos$\fP. .Tp \f3*:\fP This discards the corresponding scanned item. @@ -1418,7 +1420,7 @@ In invocations of \f3sfsetbuf()\fP other than the above case, the \f3size\fP argument is treated as follows: .Tp -\f3size == SF_UNBOUND\fP: +\f3size == SFIO_UNBOUND\fP: Sfio will pick a suitable buffer size. If \f3buf\fP is \f3NULL\fP, Sfio will also pick a suitable buffering scheme (such as memory mapping). @@ -1442,10 +1444,10 @@ This function synchronizes the logical and physical views of stream \f3f\fP. It returns a negative value for failure and \f30\fP for success. -For a \f3SF_WRITE\fP stream, synchronization means to write out any buffered data. -For a seekable \f3SF_READ\fP file stream, +For a \f3SFIO_WRITE\fP stream, synchronization means to write out any buffered data. +For a seekable \f3SFIO_READ\fP file stream, the physical file position is aligned with the logical stream position and, -if \f3SF_SHARE\fP is on, buffered data is discarded. +if \f3SFIO_SHARE\fP is on, buffered data is discarded. If \f3f\fP is \f3NULL\fP, all streams are synchronized. If \f3f\fP is the base of a stream stack (see \f3sfstack()\fP), all stacked streams are synchronized. @@ -1453,7 +1455,7 @@ If \f3f\fP is in a pool (see \f3sfpool()\fP) but not being the head, the pool head is synchronized. -If \f3f\fP has flag \f3SF_IOCHECK\fP, the \f3SF_SYNC\fP event is raised +If \f3f\fP has flag \f3SFIO_IOCHECK\fP, the \f3SFIO_SYNC\fP event is raised before and after synchronization. See \f3sfdisc()\fP for details. .Ss " int sfpoll(Sfio_t** flist, int n, int timeout)" This function polls a set of streams to see if I/O operations @@ -1463,9 +1465,9 @@ before and after the stream is polled (see \f3sfdisc()\fP for details). After a successful \f3sfpoll()\fP call, for each ready stream \f3f\fP, \f3sfvalue(f)\fP returns -a bit combination of \f3SF_READ\fP and \f3SF_WRITE\fP to tell which I/O -mode is available. If \f3SF_READ\fP is available, an attempt to read -a byte will not block. If \f3SF_WRITE\fP is available, +a bit combination of \f3SFIO_READ\fP and \f3SFIO_WRITE\fP to tell which I/O +mode is available. If \f3SFIO_READ\fP is available, an attempt to read +a byte will not block. If \f3SFIO_WRITE\fP is available, an attempt to flush will not block. \f3sfpoll()\fP returns the number of ready streams or \f3-1\fP on failure. .Tp @@ -1478,11 +1480,11 @@ This defines an elapse time in milliseconds to wait to see if any stream is ready for I/O. If \f3timeout\fP is negative, \f3sfpoll()\fP will block until some stream become ready. -Note that \f3SF_STRING\fP and normal file streams never block +Note that \f3SFIO_STRING\fP and normal file streams never block and are always ready for I/O. If a stream with discipline is being polled and its readiness is as yet undetermined (e.g., empty buffer,) -the discipline exception function will be called with \f3SF_DPOLL\fP +the discipline exception function will be called with \f3SFIO_DPOLL\fP before querying the operating system. .Ss " Sfio_t* sfpool(Sfio_t* f, Sfio_t* poolf, int mode)" This function manipulates pools of streams. @@ -1506,22 +1508,22 @@ .Tp \f3mode\fP: If \f3poolf\fP is already in a pool, \f3mode\fP is ignored. -Otherwise, \f3mode\fP should be \f30\fP or \f3SF_SHARE\fP. -A \f3SF_SHARE\fP pool contains streams with \f3SF_WRITE\fP mode. +Otherwise, \f3mode\fP should be \f30\fP or \f3SFIO_SHARE\fP. +A \f3SFIO_SHARE\fP pool contains streams with \f3SFIO_WRITE\fP mode. In addition, on change to a new head stream, buffered write data of the current head is transferred to the new head. .Ss " int sfpurge(Sfio_t* f)" This function discards all buffered data -unless \f3f\fP is a \f3SF_STRING\fP stream. -Note that if \f3f\fP is a \f3SF_READ\fP stream based on an unseekable device, +unless \f3f\fP is a \f3SFIO_STRING\fP stream. +Note that if \f3f\fP is a \f3SFIO_READ\fP stream based on an unseekable device, purged data will not be recoverable. If \f3f\fP is a \f3sfpopen\fP-stream opened for both read and write, data of both the read and write pipe ends will be purged (see \f3sfset()\fP to selectively turn off read or write mode if one set of data is to be preserved). -After purging, if \f3f\fP has flag \f3SF_IOCHECK\fP, -the event \f3SF_PURGE\fP is raised. +After purging, if \f3f\fP has flag \f3SFIO_IOCHECK\fP, +the event \f3SFIO_PURGE\fP is raised. \f3sfpurge()\fP returns \f3-1\fP for failure and \f30\fP for success. .Ss "DISCIPLINE, EVENT-HANDLING" .PP @@ -1552,7 +1554,7 @@ .ft 1 .fi -If \f3disc\fP is \f3SF_POPDISC\fP or \f3NULL\fP, +If \f3disc\fP is \f3SFIO_POPDISC\fP or \f3NULL\fP, the top element of the stack, if any, is popped and its address is returned. Otherwise, \f3disc\fP is pushed onto the discipline stack. In this case, if successful, \f3sfdisc()\fP returns @@ -1594,7 +1596,7 @@ \f3>0\fP: If the event was raised due to an I/O error, the error has been repaired and the on-going operation shall continue normally. -For some events, e.g., \f3SF_DPOLL\fP, the return value may also have +For some events, e.g., \f3SFIO_DPOLL\fP, the return value may also have additional meanings. .Tp \f3=0\fP: @@ -1606,14 +1608,14 @@ The argument \f3type\fP of \f3(*exceptf)()\fP identifies the particular exceptional event: .Tp -\f3SF_LOCKED\fP: +\f3SFIO_LOCKED\fP: The stream cannot be accessed because it was frozen by certain operations such as \f3sfreserve()\fP or \f3sfstack()\fP. .Tp -\f3SF_READ\fP, \f3SF_WRITE\fP: +\f3SFIO_READ\fP, \f3SFIO_WRITE\fP: These events are raised around reading and writing operations. -If \f3SF_IOCHECK\fP is on, \f3SF_READ\fP and \f3SF_WRITE\fP +If \f3SFIO_IOCHECK\fP is on, \f3SFIO_READ\fP and \f3SFIO_WRITE\fP are raised immediately before \f3read(2) and write(2)\fP calls. In this case, \f3*((ssize_t*)value)\fP is the amount of data to be processed. The return value of \f3(*exceptf)()\fP, if negative, @@ -1623,35 +1625,35 @@ but the amount should be restricted to the amount specified by this value. If the return value is zero, the I/O operation is carried out normally. -\f3SF_READ\fP and \f3SF_WRITE\fP are also raised on operation failures. +\f3SFIO_READ\fP and \f3SFIO_WRITE\fP are also raised on operation failures. In such a case, \f3*((ssize_t*)value)\fP is the return value from the failed operation. .Tp -\f3SF_SEEK\fP: +\f3SFIO_SEEK\fP: This event is raised when a seek operation fails. .Tp -\f3SF_NEW\fP, \f3SF_CLOSING\fP (\f3SF_CLOSE\fP), \f3SF_FINAL\fP: +\f3SFIO_NEW\fP, \f3SFIO_CLOSING\fP, \f3SFIO_FINAL\fP: These events are raised during a stream closing. -\f3SF_NEW\fP is raised for a stream about to be closed to be renewed (see \f3sfnew()\fP). -\f3SF_CLOSING\fP is raised for a stream about to be closed. -\f3SF_FINAL\fP is raised after a stream has been closed and before +\f3SFIO_NEW\fP is raised for a stream about to be closed to be renewed (see \f3sfnew()\fP). +\f3SFIO_CLOSING\fP is raised for a stream about to be closed. +\f3SFIO_FINAL\fP is raised after a stream has been closed and before its space is to be destroyed (see \f3sfclose()\fP). For these events, a non-zero return value from \f3(*exceptf)()\fP causes \f3sfclose()\fP to return immediately with the same value. .Tp -\f3SF_DPUSH\fP, \f3SF_DPOP\fP, \f3SF_DBUFFER\fP: -Events \f3SF_DPUSH\fP and \f3SF_DPOP\fP are raised when a +\f3SFIO_DPUSH\fP, \f3SFIO_DPOP\fP, \f3SFIO_DBUFFER\fP: +Events \f3SFIO_DPUSH\fP and \f3SFIO_DPOP\fP are raised when a discipline is about to be pushed or popped. \f3(Sfdisc_t*)value\fP is the to-be top discipline, if any. A stream buffer is always synchronized before pushing or popping a discipline. -If this synchronization fails, \f3SF_DBUFFER\fP will be raised with +If this synchronization fails, \f3SFIO_DBUFFER\fP will be raised with \f3*((size_t*)value)\fP being the amount of data still in the buffer. If the return value of \f3exceptf\fP is non-negative, the push or pop operation will continue normally; otherwise, \f3sfdisc()\fP returns failure. .Tp -\f3SF_DPOLL\fP: +\f3SFIO_DPOLL\fP: This event is raised by \f3sfpoll()\fP to see if the stream is ready for I/O. \f3*((int*)value)\fP indicates a time-out interval to wait. @@ -1659,32 +1661,32 @@ A zero return value means that \f3sfpoll()\fP should query the underlying file descriptor. A positive return value means non-blocking. In addition, -this value will be a bit combination of \f3SF_READ\fP and \f3SF_WRITE\fP +this value will be a bit combination of \f3SFIO_READ\fP and \f3SFIO_WRITE\fP to indicate what I/O modes are ready. .Tp -\f3SF_READY\fP: +\f3SFIO_READY\fP: This event is raised by \f3sfpoll()\fP for each ready stream. The third argument to the event handler is an integer composed with -the two bits \f3SF_READ\fP and \f3SF_WRITE\fP to indicate which +the two bits \f3SFIO_READ\fP and \f3SFIO_WRITE\fP to indicate which I/O modes are ready. .Tp -\f3SF_SYNC\fP, \f3SF_PURGE\fP: -If \f3SF_IOCHECK\fP is set, +\f3SFIO_SYNC\fP, \f3SFIO_PURGE\fP: +If \f3SFIO_IOCHECK\fP is set, these events are raised respectively for a \f3sfsync()\fP or \f3sfpurge()\fP call. In each case, the respective event is raised once before the appropriate operation (synchronization or purging) with \f3((int)value)\fP being \f31\fP and once after with \f3((int)value)\fP being \f30\fP. Note that \f3sfsync()\fP is called for each -\f3SF_WRITE\fP or \f3SF_SHARE|SF_READ\fP stream on closing. +\f3SFIO_WRITE\fP or \f3SFIO_SHARE|SFIO_READ\fP stream on closing. .Tp -\f3SF_ATEXIT\fP: +\f3SFIO_ATEXIT\fP: This event is raised for each open stream before the process exits. .Ss " int sfraise(Sfio_t* f, int type, void* data)" If \f3f\fP is non-\f3NULL\fP, \f3sfraise()\fP calls all exception handlers of \f3f\fP with the event \f3type\fP and associated \f3data\fP. If an exception handler returns a non-zero value, \f3sfraise()\fP immediate returns the same value. -Application-defined events should start from the value \f3SF_EVENT\fP +Application-defined events should start from the value \f3SFIO_EVENT\fP so as to avoid confusion with system-defined events, \f3sfraise()\fP returns \f30\fP on success and \f3-1\fP on failure. @@ -1715,14 +1717,14 @@ It returns the previous set of flags or \f30\fP on error. Settable flags are: -\f3SF_READ\fP, \f3SF_WRITE\fP, \f3SF_IOCHECK\fP, -\f3SF_LINE\fP, \f3SF_SHARE\fP, \f3SF_PUBLIC\fP, \f3SF_MALLOC\fP and -\f3SF_STATIC\fP. -Note that \f3SF_READ\fP and \f3SF_WRITE\fP can be turned on or off only -if the stream was opened as \f3SF_READ|SF_WRITE\fP. +\f3SFIO_READ\fP, \f3SFIO_WRITE\fP, \f3SFIO_IOCHECK\fP, +\f3SFIO_LINE\fP, \f3SFIO_SHARE\fP, \f3SFIO_PUBLIC\fP, \f3SFIO_MALLOC\fP and +\f3SFIO_STATIC\fP. +Note that \f3SFIO_READ\fP and \f3SFIO_WRITE\fP can be turned on or off only +if the stream was opened as \f3SFIO_READ|SFIO_WRITE\fP. Turning off one of them means that the stream is to be treated exclusively in the other mode. It is not possible to turn off both. -If legal, an attempt to turn on either \f3SF_READ\fP or \f3SF_WRITE\fP +If legal, an attempt to turn on either \f3SFIO_READ\fP or \f3SFIO_WRITE\fP will cause the stream to be in the given I/O mode. .Tp \f3set == 0:\fP @@ -1739,7 +1741,7 @@ .Ss " int sfsetfd(Sfio_t* f, int fd)" This function changes the file descriptor of \f3f\fP. Before a change is realized, -\f3(*notify)(f,SF_SETFD,newfd)\fP (see \f3sfnotify()\fP) is called. +\f3(*notify)(f,SFIO_SETFD,newfd)\fP (see \f3sfnotify()\fP) is called. \f3sfsetfd()\fP returns \f3-1\fP on failure and the new file descriptor on success. .Tp \f3fd >= 0\fP: @@ -1771,15 +1773,15 @@ If it is \f3NULL\fP, \f3sfstack()\fP does nothing and returns \f3top\fP. .Tp \f3top\fP: -If this is \f3SF_POPSTACK\fP or \f3NULL\fP, +If this is \f3SFIO_POPSTACK\fP or \f3NULL\fP, the stack is popped and \f3sfstack()\fP returns the popped stream. Otherwise, \f3top\fP is pushed on top of the stack identified by \f3base\fP and \f3sfstack()\fP returns the \f3base\fP stream. .Ss " char* sfstruse(Sfio_t* f)" Makes the string in a Sfio string buffer ready for use -and makes the buffer ready for re-use. This is done by +and makes the buffer ready for reuse. This is done by writing a terminating 0 byte to the given -.B SF_STRING +.B SFIO_STRING buffer, setting the I/O position to the start of the buffer so that subsequent write operations will overwrite it, and returning a pointer to the beginning of the string. @@ -1796,7 +1798,7 @@ \f3sfsize()\fP returns \f3-1\fP. .Ss " Sfoff_t sftell(Sfio_t* f)" This function returns the current I/O position in stream \f3f\fP. -Note that if \f3f\fP is \f3SF_APPEND\fP +Note that if \f3f\fP is \f3SFIO_APPENDWR\fP and a writing operation was just performed, the current I/O position is at the physical end of file. If \f3f\fP is unseekable, \f3sftell\fP returns the number of bytes @@ -1829,21 +1831,21 @@ as \f3(*notify)(f, type, data)\fP on various stream events. Arguments \f3type\fP and \f3data\fP indicate the reason for the call and accompanying data: .Tp -\f3SF_NEW\fP: +\f3SFIO_NEW\fP: \f3f\fP is being opened and \f3data\fP is the underlying file descriptor. .Tp -\f3SF_CLOSING\fP (\f3SF_CLOSE\fP): +\f3SFIO_CLOSING\fP: \f3f\fP is the stream being closed and \f3data\fP is the underlying file descriptor. .Tp -\f3SF_SETFD\fP: +\f3SFIO_SETFD\fP: The file descriptor of \f3f\fP is being changed to the one defined by \f3data\fP (see \f3sfsetfd()\fP). .Tp -\f3SF_READ\fP: +\f3SFIO_READ\fP: An attempt to change \f3f\fP to read mode failed. \f3data\fP is the file descriptor of the stream. .Tp -\f3SF_WRITE\fP: +\f3SFIO_WRITE\fP: An attempt to change \f3f\fP to write mode failed. \f3data\fP is the file descriptor of the stream. .Ss " int sfwalk(Sfwalk_f walkf, void* data, int type)" @@ -1853,8 +1855,8 @@ \f3sfwalk()\fP returns 0 if no stream was processed. Otherwise, it returns the return value from the last invocation of \f3walkf()\fP. -As an example, the call \f3sfwalk(walkf, data, SF_READ)\fP will iterate over all streams -opened for reading. Similarly, \f3sfwalk(walkf, data, SF_READ|SF_WRITE)\fP +As an example, the call \f3sfwalk(walkf, data, SFIO_READ)\fP will iterate over all streams +opened for reading. Similarly, \f3sfwalk(walkf, data, SFIO_READ|SFIO_WRITE)\fP iterates over all streams opened for both reading and writing. Lastly, \f3sfwalk(walkf, data, 0)\fP iterates over all streams. .Ss "MISCELLANEOUS FUNCTIONS" @@ -1986,7 +1988,7 @@ Certain older Stdio applications require these to be declared as addresses of structures so that static initializations of the sort ``\f3FILE*\ f\ =\ stdin;\fP'' would work. -Such applications should use the compile time flag \f3SF_FILE_STRUCT\fP +Such applications should use the compile time flag \f3SFIO_FILE_STRUCT\fP to achieve the desired effect. .PP Below are the supported Stdio functions:
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/stk.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/stk.3
Changed
@@ -4,24 +4,30 @@ \fBstk\fR \- data stack storage library .SH SYNOPSIS .ta .75i 1.5i 2.25i 3i 3.75i 4.5i 5.25i 6i +.de Ss +.fl +.ne 3 +.SS "\\$1" +.. .PP .nf \f3 #include <stk.h> Stk_t *stkopen(int \fIflags\fP); +void stkoverflow(Stk_t *\fIstack\fP, void *(\fIoverflow\fP)(size_t)); Stk_t *stkinstall(Stk_t *\fIstack\fP, char *(\fIoverflow\fP)(size_t)); int stkclose(Stk_t *\fIstack\fP); unsigned int stklink(Stk_t *\fIstack\fP) -char *stkalloc(Stk_t *\fIstack\fP, unsigned \fIsize\fP); +void *stkalloc(Stk_t *\fIstack\fP, unsigned \fIsize\fP); char *stkcopy(Stk_t *\fIstack\fP, const char *\fIstring\fP); -char *stkset(Stk_t *\fIstack\fP, char *\fIaddress\fP, unsigned \fIoffset\fP); +void *stkset(Stk_t *\fIstack\fP, void *\fIaddress\fP, unsigned \fIoffset\fP); -char *stkseek(Stk_t *\fIstack\fP, unsigned \fIoffset\fP); +void *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); +void *stkfreeze(Stk_t *\fIstack\fP, unsigned \fIextra\fP); int stkon(Stk *\fIstack\fP, char* \fIaddr\fP) \fR .fi @@ -33,16 +39,15 @@ memory regions, called stack frames, that can hold objects of arbitrary size. A stack is represented by the type \f3Stk_t\fP -defined in header \f3<stk.h>\fP. +defined in the header \f3<stk.h>\fP. The type \f3Stk_t\fP is compatible with the type \f3Sfio_t\fP defined by the \f3sfio\fP(3) library. +There is a preset initial stack which can be referenced +by the constant \f3stkstd\fP (stack standard). .PP -At any instant there is one active stack which can be referenced -by the constant \f3stkstd\fP. -Variable size objects can be -added to the active stack +Objects of variable size can be +added to a stack, and programs can reference these objects directly with pointers. -.PP In addition, the last object on the stack (referred to here as the current object) can be built incrementally. @@ -53,50 +58,72 @@ change so that it is necessary to reference the object with relative offsets ranging from zero to the current offset of the object. .PP -There is a preset initial active stack. -To use an additional stack, it is necessary to create it and to -install it as the active stack. +The \f3sfio\fP(3) output functions can be used to build +the current object incrementally. +An object that is built incrementally on the stack will +always occupy contiguous memory within a stack frame, +but until \f3stkfreeze\fP() is called, +the location in memory for the object can change. +There is a current offset associated with the current object that +determines where subsequent operations apply. +Initially, this offset is zero, and the offset changes as a result +of the operations you specify. +.Ss "Descriptions of the functions" .PP -A stack is created with the \f3stkopen\fP() function. +The \f3stkopen\fP() function creates a new stack. The \fIflags\fP argument is an options bitmask. If the \f3STK_SMALL\fP bit is set, the stack allocates memory in -small blocks, optimizing for memory usage at the expense of performance. +small blocks, optimizing memory usage at the expense of performance. If the \f3STK_NULL\fP bit is set, a stack overflow will cause stack operations to return a null pointer instead of throwing an exception. +If the \f3STK_NULL\fP bit is not set and the \f3stkstd\fP stack has +a custom overflow function set (see \f3stkoverflow\fP() below), +then the new stack inherits the pointer to that overflow function. If successful, \f3stkopen\fP() returns a pointer to a stack whose reference count is 1. Otherwise, \f3stkopen\fP() returns a null pointer. .PP -The \f3stklink\fP() function increases the reference count for the -given \fIstack\fP and returns the increased count. -.PP -The \f3stkinstall\fP() function -makes the specified \fIstack\fP the active stack and returns a pointer -to the previous active stack. -If the \fIoverflow\fP argument is not null and the stack was not opened with -the \f3STK_NULL\fP option, \fIoverflow\fP specifies a function that will +The \f3stkoverflow\fP() function specifies a function that will be called whenever \f3malloc\fP(3) fails while trying to grow the stack. The \fIoverflow\fP function will be called with the size that was passed to \f3malloc\fP(3). The \fIoverflow\fP function can call \f3exit\fP(3), call \f3longjmp\fP(3) or return. -If the \f3overflow\fP function returns, +If the \f2overflow\fP function returns, it must return a pointer to a memory region of the given size. -The default action is to write an error to standard error and to +If \f2overflow\fP is \f3NULL\fP, then the stack overflow action +is reset to the default. +If the stack was opened with the \f3STK_NULL\fP option, +the default is to return a null pointer, +otherwise the default is to write an error to standard error and to call \f3exit\fP(2) with a non-zero exit value. +.PP +The \f3stkinstall\fP() function +is deprecated and provided for backward compatibility. +\f3stkinstall\fP() makes \f3stkstd\fP refer to the specified \fIstack\fP pointer +and returns a pointer to the previous \f3stkstd\fP stack. +If the \fIoverflow\fP argument is not null and the stack was not opened with +the \f3STK_NULL\fP option, then \fIoverflow\fP sets the overflow action +(see \f3overflow\fP() above). When \fIstack\fP is a null pointer, -the active stack is not changed -but the \fIoverflow\fP function for the active stack can be changed -and a pointer to the active stack is returned. +the \f3stkstd\fP stack is not changed +but the \fIoverflow\fP function for the \f3stkstd\fP stack can be changed +and a pointer to the \f3stkstd\fP stack is returned. +(Current usage is simply +passing the pointer to the desired stack to the \f3stk\fP functions, +and using \f3stkoverflow\fP() to set the stack overflow function). .PP The \f3stkclose\fP() function decrements the reference count and frees the memory associated with the specified stack when the reference count is zero. The effect of subsequent references to objects -on the stack are undefined. +on the stack is undefined. +.PP +The \f3stklink\fP() function increases the reference count for the +given \fIstack\fP and returns the increased count. .PP The \f3stkalloc\fP() function returns an aligned pointer to space on the @@ -122,17 +149,6 @@ If it is non-null, but is not the address of an object on the stack, the program aborts and dumps core. .PP -The \f3sfio\fP(3) output functions can be used to build -current object incrementally. -An object that is built incrementally on the stack will -always occupy contiguous memory within a stack frame but -until \f3stkfreeze\fP() is called, -the location in memory for the object can change. -There is a current offset associated with the current object that -determines where subsequent operations apply. -Initially, this offset is zero, and the offset changes as a result -of the operations you specify. -.PP The \f3stkseek\fP() function is used set the offset for the current object. The \fIoffset\fP argument to \f3stkseek\fP() specifies the new @@ -149,6 +165,9 @@ This address is only valid until another stack operation is given. The result is not defined if \fIoffset\fP exceeds the size of the current object. +This function returns a \f3char\fP pointer instead of \f3void\fP pointer +to make it easy to dereference the return value directly and read +an individual byte on the stack. .PP The \f3stkfreeze\fP() function terminates the current object on the @@ -167,10 +186,17 @@ that is used for building parse trees and carrying out expansions. It provides an efficient mechanism for grouping dynamically allocated objects so that they can be freed all at once rather than individually. +.PP +In 2024, as part of changes made by +Martijn Dekker <martijn@inlv.org> for ksh 93u+m, +the return types of \f3stkalloc\fP(), \f3stkset\fP(), \f3stkseek\fP() and +\f3stkfreeze\fP() were changed from \f3char*\fP to \f3void*\fP, +the \f3stkoverflow\fP() function was added, +and the \f3stkinstall\fP() function was deprecated. .SH AUTHOR - David Korn +David Korn .SH SEE ALSO -\f3exit(2)\fP -\f3longjmp(3)\fP -\f3malloc(3)\fP -\f3sfio(3)\fP +\f3exit\fP(2), +\f3longjmp\fP(3), +\f3malloc\fP(3), +\f3sfio\fP(3)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/man/tok.3 -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/man/tok.3
Changed
@@ -195,12 +195,12 @@ discipline onto a string or file stream. Seeks are disabled on the resulting stream. If -.L "flags == SF_READ" +.L "flags == SFIO_READ" then .L input is a file name; If -.L "flags == SF_STRING" +.L "flags == SFIO_STRING" then .L input is a 0 terminated string;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/fastfind.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/fastfind.c
Changed
@@ -69,8 +69,6 @@ * SUCH DAMAGE. */ -static const char id = "\n@(#)$Id: fastfind (AT&T Research) 2002-10-02 $\0\n"; - static const char lib = "libast:fastfind"; #include "findlib.h" @@ -139,7 +137,7 @@ Find_t* findopen(const char* file, const char* pattern, const char* type, Finddisc_t* disc) { - Find_t* fp; + Find_t* fp = NULL; char* p; char* s; char* b; @@ -301,7 +299,7 @@ } if (s) *s = '/'; - if (!(fp->fp = sfnew(NULL, NULL, (size_t)SF_UNBOUND, fd, SF_WRITE))) + if (!(fp->fp = sfnew(NULL, NULL, (size_t)SFIO_UNBOUND, fd, SFIO_WRITE))) { if (fp->disc->errorf) (*fp->disc->errorf)(fp, fp->disc, ERROR_SYSTEM|2, "%s: cannot open tmp file", fp->encode.temp); @@ -677,7 +675,7 @@ char* findread(Find_t* fp) { - char* p; + char* p = NULL; char* q; char* s; char* b; @@ -686,7 +684,7 @@ int n; int m; int ignorecase; - int t; + int t = 0; unsigned char w4; struct stat st; @@ -802,7 +800,7 @@ if (fp->dirs) for (;;) { - if (!*fp->dirs) + if (!*fp->dirs || !p) return NULL; /* @@ -1221,7 +1219,7 @@ * append the front compressed strings */ - if (sfmove(fp->fp, sp, SF_UNBOUND, -1) < 0 || !sfeof(fp->fp)) + if (sfmove(fp->fp, sp, SFIO_UNBOUND, -1) < 0 || !sfeof(fp->fp)) { sfclose(sp); if (fp->disc->errorf)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/glob.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/glob.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -73,6 +73,8 @@ #include <glob.h> +static Stk_t *globstk = stkstd; + /* * default gl_diropen */ @@ -158,7 +160,7 @@ gl_nextdir(glob_t* gp, char* dir) { if (!(dir = gp->gl_nextpath)) - dir = gp->gl_nextpath = stkcopy(stkstd,pathbin()); + dir = gp->gl_nextpath = stkcopy(globstk,pathbin()); switch (*gp->gl_nextpath) { case 0: @@ -237,46 +239,46 @@ int offset; int type; - stkseek(stkstd,MATCHPATH(gp)); + stkseek(globstk,MATCHPATH(gp)); if (dir) { - sfputr(stkstd,dir,-1); - sfputc(stkstd,gp->gl_delim); + sfputr(globstk,dir,-1); + sfputc(globstk,gp->gl_delim); } if (endslash) *endslash = 0; - sfputr(stkstd,pat,-1); + sfputr(globstk,pat,-1); if (rescan) { - if ((*gp->gl_type)(gp, stkptr(stkstd,MATCHPATH(gp)), 0) != GLOB_DIR) + if ((*gp->gl_type)(gp, stkptr(globstk,MATCHPATH(gp)), 0) != GLOB_DIR) return; - sfputc(stkstd,gp->gl_delim); - offset = stktell(stkstd); + sfputc(globstk,gp->gl_delim); + offset = stktell(globstk); /* if null, reserve room for . */ if (*rescan) - sfputr(stkstd,rescan,-1); + sfputr(globstk,rescan,-1); else - sfputc(stkstd,0); - sfputc(stkstd,0); - rescan = stkptr(stkstd,offset); - ap = (globlist_t*)stkfreeze(stkstd,0); + sfputc(globstk,0); + sfputc(globstk,0); + rescan = stkptr(globstk,offset); + ap = stkfreeze(globstk,0); ap->gl_begin = (char*)rescan; ap->gl_next = gp->gl_rescan; gp->gl_rescan = ap; } else { - if (!endslash && (gp->gl_flags & GLOB_MARK) && (type = (*gp->gl_type)(gp, stkptr(stkstd,MATCHPATH(gp)), 0))) + if (!endslash && (gp->gl_flags & GLOB_MARK) && (type = (*gp->gl_type)(gp, stkptr(globstk,MATCHPATH(gp)), 0))) { if ((gp->gl_flags & GLOB_COMPLETE) && type != GLOB_EXE) { - stkseek(stkstd,0); + stkseek(globstk,0); return; } else if (type == GLOB_DIR && (gp->gl_flags & GLOB_MARK)) - sfputc(stkstd,gp->gl_delim); + sfputc(globstk,gp->gl_delim); } - ap = (globlist_t*)stkfreeze(stkstd,1); + ap = stkfreeze(globstk,1); ap->gl_next = gp->gl_match; gp->gl_match = ap; gp->gl_pathc++; @@ -598,7 +600,7 @@ globlist_t* ap; char* pat; globlist_t* top; - Stk_t* oldstak; + Stk_t* oldstak = NULL; char** argv; char** av; size_t skip; @@ -697,7 +699,7 @@ } skip = gp->gl_pathc; if (gp->gl_stak) - oldstak = stkinstall(gp->gl_stak, 0); + oldstak = globstk, globstk = gp->gl_stak; if (flags & GLOB_DOOFFS) extra += gp->gl_offs; if (gp->gl_suffix) @@ -761,7 +763,7 @@ break; } } - top = ap = (globlist_t*)stkalloc(stkstd,(optlen ? 2 : 1) * strlen(pattern) + sizeof(globlist_t) + suflen + gp->gl_extra); + top = ap = stkalloc(globstk,(optlen ? 2 : 1) * strlen(pattern) + sizeof(globlist_t) + suflen + gp->gl_extra); ap->gl_next = 0; ap->gl_flags = 0; ap->gl_begin = ap->gl_path + gp->gl_extra; @@ -799,7 +801,7 @@ gp->gl_list = gp->gl_match; else { - argv = (char**)stkalloc(stkstd,(gp->gl_pathc + extra) * sizeof(char*)); + argv = stkalloc(globstk,(gp->gl_pathc + extra) * sizeof(char*)); if (gp->gl_flags & GLOB_APPEND) { skip += --extra; @@ -832,7 +834,7 @@ if (gp->gl_starstar > 1) gp->gl_flags &= ~GLOB_STARSTAR; if (gp->gl_stak) - stkinstall(oldstak, 0); + globstk = oldstak; return gp->gl_error; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/magic.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/magic.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -27,8 +27,6 @@ * the sum of the hacks {s5,v10,planix} is _____ than the parts */ -static const char id = "\n@(#)$Id: magic library (AT&T Research) 2011-03-09 $\0\n"; - static const char lib = "libast:magic"; #include <ast.h> @@ -153,8 +151,8 @@ Entry_t* magiclast; /* last entry in magic */ \ char* mime; /* MIME type */ \ unsigned char* x2n; /* CC_ALIEN=>CC_NATIVE */ \ - char fbufSF_BUFSIZE + 1; /* file data */ \ - char xbufSF_BUFSIZE + 1; /* indirect file data */ \ + char fbufSFIO_BUFSIZE + 1; /* file data */ \ + char xbufSFIO_BUFSIZE + 1; /* indirect file data */ \ char nbuf256; /* !CC_NATIVE data */ \ char mbuf64; /* mime string */ \ char sbuf64; /* type suffix string */ \ @@ -293,7 +291,7 @@ { if (off + siz > mp->fbmx) return NULL; - n = (off / (SF_BUFSIZE / 2)) * (SF_BUFSIZE / 2); + n = (off / (SFIO_BUFSIZE / 2)) * (SFIO_BUFSIZE / 2); if (sfseek(mp->fp, n, SEEK_SET) != n) return NULL; if ((mp->xbsz = sfread(mp->fp, mp->xbuf, sizeof(mp->xbuf) - 1)) < 0) @@ -935,7 +933,7 @@ static int ckenglish(Magic_t* mp, int pun, int badpun) { - char* s; + unsigned char* s; int vowl = 0; int freq = 0; int rare = 0; @@ -946,11 +944,11 @@ return 0; if ((mp->count'>' + mp->count'<' + mp->count'/') > mp->count'E' + mp->count'e') return 0; - for (s = "aeiou"; *s; s++) + for (s = (unsigned char*)"aeiou"; *s; s++) vowl += mp->counttoupper(*s) + mp->count*s; - for (s = "etaion"; *s; s++) + for (s = (unsigned char*)"etaion"; *s; s++) freq += mp->counttoupper(*s) + mp->count*s; - for (s = "vjkqxz"; *s; s++) + for (s = (unsigned char*)"vjkqxz"; *s; s++) rare += mp->counttoupper(*s) + mp->count*s; return 5 * vowl >= mp->fbsz - mp->count' ' && freq >= 10 * rare; } @@ -974,9 +972,9 @@ char* t2; char* t3; int n; - int badpun; + int badpun = 0; int code; - int pun; + int pun = 0; Cctype_t flags; Info_t* ip; @@ -1057,8 +1055,6 @@ *b = c; b = (unsigned char*)mp->fbuf; } - badpun = 0; - pun = 0; q = 0; s = 0; t = 0; @@ -1245,11 +1241,11 @@ mp->mime = "application/x-tex"; goto qualify; } - if (mp->fbsz < SF_BUFSIZE && + if (mp->fbsz < SFIO_BUFSIZE && (mp->multi'(' == mp->multi')' && mp->multi'{' == mp->multi'}' && mp->multi'' == mp->multi'') || - mp->fbsz >= SF_BUFSIZE && + mp->fbsz >= SFIO_BUFSIZE && (mp->multi'(' >= mp->multi')' && mp->multi'{' >= mp->multi'}' && mp->multi'' >= mp->multi'')) @@ -1299,8 +1295,8 @@ } } if (mp->identifierID_MAM1 >= 2 && mp->identifierID_MAM3 >= 2 && - (mp->fbsz < SF_BUFSIZE && mp->identifierID_MAM1 == mp->identifierID_MAM2 || - mp->fbsz >= SF_BUFSIZE && mp->identifierID_MAM1 >= mp->identifierID_MAM2)) + (mp->fbsz < SFIO_BUFSIZE && mp->identifierID_MAM1 == mp->identifierID_MAM2 || + mp->fbsz >= SFIO_BUFSIZE && mp->identifierID_MAM1 >= mp->identifierID_MAM2)) { id_mam: s = T("mam program"); @@ -2323,7 +2319,6 @@ char* magictype(Magic_t* mp, Sfio_t* fp, const char* file, struct stat* st) { - off_t off; char* s; mp->flags = mp->disc->flags; @@ -2332,6 +2327,7 @@ s = T("cannot stat"); else { + off_t off = 0; if (mp->fp = fp) off = sfseek(mp->fp, 0, SEEK_CUR); s = type(mp, file, st, mp->tbuf, &mp->tbufsizeof(mp->tbuf)-1);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/mime.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/mime.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,8 +24,6 @@ * mime/mailcap support library */ -static const char id = "\n@(#)$Id: mime library (AT&T Research) 2002-10-29 $\0\n"; - static const char lib = "libast:mime"; #include "mimelib.h" @@ -142,9 +140,9 @@ Att_t* att; char* t; char* v; - char* k; - char* x; - Att_t* tta; + char* k = NULL; + char* x = NULL; + Att_t* tta = NULL; int q; for (; isspace(*s); s++); @@ -225,9 +223,12 @@ *t++ = 0; if (!(att = newof(0, Att_t, 1, 0))) return -1; + if (!x) + abort(); x = strcopy(att->name = x, k) + 1; x = strcopy(att->value = x, v) + 1; - tta = tta->next = att; + tta->next = att; + tta = att; if (!strcasecmp(k, "test")) cap->test = att->value; } @@ -313,7 +314,7 @@ if (!(s = sfstruse(mp->buf))) return -1; } - if (fp = tokline(s, SF_READ, NULL)) + if (fp = tokline(s, SFIO_READ, NULL)) { while (t = sfgetr(fp, '\n', 1)) if (mimeset(mp, t, flags))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/optget.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/optget.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -31,7 +31,8 @@ #include <debug.h> #include <ccode.h> #include <ctype.h> -#include <errno.h> + +#define OPTGET_VERSION "optget (ksh 93u+m) 2024-03-05" #define KEEP "*A-Za-zA-Za-z*" #define OMIT "*@(\\-+*\\?*\\|\\@\\(#\\)|Copyright \\(c\\)|\\$\\I\\d\\: )*" @@ -206,8 +207,9 @@ C("\b-?\b and \b--?\b* options are the same \ for all \bAST\b commands. For any \aitem\a below, if \b--\b\aitem\a is not \ supported by a given command then it is equivalent to \b--\?\?\b\aitem\a. The \ -\b--\?\?\b form should be used for portability. All output is written to the \ -standard error."), +\b--\?\?\b form should be used for portability. \ +All output is written to the standard error. \ +Note that question marks should be quoted to avoid pathanme expansion."), }; static const Help_t styles = @@ -255,8 +257,11 @@ the \aoption\a output in the \aitem\a style. Otherwise print \ \bversion=\b\an\a where \an\a>0 if \b--\?\?\b\aitem\a is supported, \b0\b \ if not."), + ':', C("\?\?\?\?\?\?EMPHASIS"), + C("Equivalent to \b--\?\?\?ESC\b."), ':', C("\?\?\?\?\?\?ESC"), - C("Emit escape codes even if output is not a terminal."), + C("Emit ANSI escape codes for emphasis even if standard error is not on a terminal. \ +Use \b--\?\?noESC\b to emit no escape codes even if standard error is on a terminal."), ':', C("\?\?\?\?\?\?MAN=\asection\a"), C("List the \bman\b(1) section title for \asection\a the \ current command."), @@ -902,13 +907,15 @@ if (!state.localized) { + unsigned char *opts = (unsigned char*)OPT_FLAGS; + unsigned char *o; state.localized = 1; if (!ast.locale.serial) setlocale(LC_ALL, ""); state.xp = sfstropen(); - if (!mapOPT_FLAGS0) - for (n = 0, t = OPT_FLAGS; *t; t++) - map*t = ++n; + if (!mapopts0) + for (n = 0, o = opts; *o; o++) + map*o = ++n; } #if _BLD_DEBUG error(-2, "optget debug"); @@ -1584,7 +1591,7 @@ char* t; char* o; char* a = 0; - char* b; + char* b = style == STYLE_nroff ? "\\ " : " "; int sep; if (flags & OPT_functions) @@ -1593,7 +1600,6 @@ { sep = ' '; o = T(NULL, ID, "options"); - b = style == STYLE_nroff ? "\\ " : " "; for (;;) { t = (char*)memchr(p, '\n', n); @@ -2354,10 +2360,10 @@ char* s; char* d; char* v; - char* cb; - char* dt; + char* cb = NULL; + char* dt = NULL; char* ov; - char* pp; + char* pp = NULL; char* rb; char* re; int f; @@ -2415,7 +2421,7 @@ Sfio_t* sp_misc = 0; if (!(mp = state.mp) && !(mp = state.mp = sfstropen())) - goto nospace; + goto outofmemory; if (!what) style = state.style; else if (!*what) @@ -2435,7 +2441,7 @@ if ((style = state.force) < STYLE_man) style = STYLE_man; if (!(sp_help = sfstropen())) - goto nospace; + goto outofmemory; for (i = 0; i < elementsof(help_head); i++) list(sp_help, &help_headi); for (i = 0; i < elementsof(styles); i++) @@ -2443,7 +2449,7 @@ for (i = 0; i < elementsof(help_tail); i++) list(sp_help, &help_taili); if (!(opts = sfstruse(sp_help))) - goto nospace; + goto outofmemory; } /* @@ -2469,7 +2475,7 @@ { o = &one; if (init((char*)opts, o)) - goto nospace; + goto outofmemory; } e = o + 1; } @@ -2492,9 +2498,9 @@ if (style <= STYLE_usage) { if (!(sp_text = sfstropen()) || !(sp_info = sfstropen())) - goto nospace; + goto outofmemory; if (style >= STYLE_match && style < STYLE_keys && !(sp_body = sfstropen())) - goto nospace; + goto outofmemory; } switch (style) { @@ -2513,21 +2519,22 @@ sfputc(mp, '\f'); break; default: - state.emphasis = 0; - if (x = getenv("ERROR_OPTIONS")) + if (!state.emphasis) { - if (strmatch(x, "*noemphasi*")) - break; - if (strmatch(x, "*emphasi*")) + if (x = getenv("ERROR_OPTIONS")) { - state.emphasis = 1; - break; + if (strmatch(x, "*noemphasi*")) + break; + if (strmatch(x, "*emphasi*")) + { + state.emphasis = 1; + break; + } } + if (isatty(sffileno(sfstderr)) && (x = getenv("TERM")) + && strmatch(x, "(ansi|cons|dtterm|linux|qansi|rxvt|screen|sun|vt1-50-40125|wsvt|xterm)*")) + state.emphasis = 1; } - if (isatty(sffileno(sfstderr)) - && (x = getenv("TERM")) - && strmatch(x, "(ansi|cons|dtterm|linux|screen|sun|vt???|wsvt|xterm)*")) - state.emphasis = 1; break; } x = ""; @@ -2898,7 +2905,7 @@ { p++; if (!(sp = sp_plus) && !(sp = sp_plus = sfstropen())) - goto nospace; + goto outofmemory; } else if (style >= STYLE_match) sp = sp_body; @@ -2959,6 +2966,7 @@ rb = re = 0; sl = 0; vl = 0; + cl = 0; if (*p == '') { if ((c = *(p = next(p + 1, version))) == '(') @@ -2976,7 +2984,7 @@ if (*(p + 1) != '-') { if (!sp_misc && !(sp_misc = sfstropen())) - goto nospace; + goto outofmemory; else p = textout(sp_misc, p, cb, cl, style, 1, 3, sp_info, version, id, catalog, &hflags); continue; @@ -3018,7 +3026,7 @@ sp_head = sp_body; hflags = dflags = bflags; if (!(sp_body = sfstropen())) - goto nospace; + goto outofmemory; } continue; } @@ -3279,7 +3287,7 @@ if (sp_body) sfputc(sp_body, ' '); else if (!(sp_body = sfstropen())) - goto nospace; + goto outofmemory; if (mutex) { if (mutex & 1) @@ -3429,7 +3437,7 @@ else sfprintf(sp_info, " %s %s\bno%-.*s\b %s.", T(NULL, ID, "On by default; use"), "--"+2-prefix, u - w, w, T(NULL, ID, "to turn off")); if (!(t = sfstruse(sp_info))) - goto nospace; + goto outofmemory; textout(sp_body, t, 0, 0, style, 0, 0, sp_info, version, NULL, NULL, &bflags); } if (*p == GO) @@ -3456,7 +3464,7 @@ else sfprintf(sp_info, "%s%s", y, T(NULL, ID, "The option value may be omitted.")); if (!(t = sfstruse(sp_info))) - goto nospace; + goto outofmemory; textout(sp_body, t, 0, 0, style, 4, 0, sp_info, version, NULL, NULL, &bflags); y = " "; } @@ -3473,7 +3481,7 @@ sfputc(sp_info, '\b'); sfputc(sp_info, '.'); if (!(t = sfstruse(sp_info))) - goto nospace; + goto outofmemory; textout(sp_body, t, 0, 0, style, 4, 0, sp_info, version, NULL, NULL, &bflags); } } @@ -3495,7 +3503,7 @@ if (sp_misc) { if (!(p = sfstruse(sp_misc))) - goto nospace; + goto outofmemory; for (t = p; *t == '\t' || *t == '\n'; t++); if (*t) { @@ -3516,7 +3524,7 @@ if (style == STYLE_keys && sfstrtell(mp) > 1) sfstrseek(mp, -1, SEEK_CUR); if (!(p = sfstruse(mp))) - goto nospace; + goto outofmemory; return opt_info.msg = p; } sp = sp_text; @@ -3635,10 +3643,10 @@ if (hp = (Help_t*)search(styles, elementsof(styles), sizeof(styles0), (char*)what)) { if (!sp_help && !(sp_help = sfstropen())) - goto nospace; + goto outofmemory; sfprintf(sp_help, "-:%s?%s", hp->match, hp->text); if (!(opts = sfstruse(sp_help))) - goto nospace; + goto outofmemory; goto again; } s = (char*)unknown; @@ -3654,7 +3662,7 @@ if (sfstrtell(sp)) sfputc(sp, ' '); if (!(t = sfstruse(sp_plus))) - goto nospace; + goto outofmemory; sfputr(sp, t, ''); } sfclose(sp_plus); @@ -3664,7 +3672,7 @@ if (sp_head) { if (!(t = sfstruse(sp_head))) - goto nospace; + goto outofmemory; for (; *t == '\n'; t++); sfputr(sp, t, '\n'); sfclose(sp_head); @@ -3705,7 +3713,7 @@ if (style < STYLE_match && sfstrtell(sp)) sfputc(sp, ' '); if (!(t = sfstruse(sp_body))) - goto nospace; + goto outofmemory; if (style == STYLE_html && !(dflags & HELP_head) && (bflags & HELP_head)) sfputr(sp, "\n</DIV>", '\n'); sfputr(sp, t, -1); @@ -3726,7 +3734,7 @@ sp_misc = 0; } if (!(p = sfstruse(sp))) - goto nospace; + goto outofmemory; astwinsize(1, NULL, &state.width); if (state.width < 20) state.width = OPT_WIDTH; @@ -3754,7 +3762,7 @@ *t++ = c; } *t = 0; - sfprintf(mp, "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n<HEAD>\n<META name=\"generator\" content=\"optget (AT&T Research) 2011-11-11\">\n%s<TITLE>%s man document</TITLE>\n<STYLE type=\"text/css\">\ndiv.SH { padding-left:2em; text-indent:0em; }\ndiv.SY { padding-left:4em; text-indent:-2em; }\ndt { float:left; clear:both; }\ndd { margin-left:3em; }\n</STYLE>\n</HEAD>\n<BODY bgcolor=white>\n", (state.flags & OPT_proprietary) ? "<!--INTERNAL-->\n" : "", id); + sfprintf(mp, "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\n<HTML>\n<HEAD>\n<META name=\"generator\" content=\"" OPTGET_VERSION "\">\n%s<TITLE>%s man document</TITLE>\n<STYLE type=\"text/css\">\ndiv.SH { padding-left:2em; text-indent:0em; }\ndiv.SY { padding-left:4em; text-indent:-2em; }\ndt { float:left; clear:both; }\ndd { margin-left:3em; }\n</STYLE>\n</HEAD>\n<BODY bgcolor=white>\n", (state.flags & OPT_proprietary) ? "<!--INTERNAL-->\n" : "", id); sfprintf(mp, "<H4><TABLE width=100%%><TR><TH align=left>%s ( %s ) <TH align=center><A href=\".\" title=\"Index\">%s</A><TH align=right>%s ( %s )</TR></TABLE></H4>\n<HR>\n", ud, section, T(NULL, ID, secname(section)), ud, section); co = 2; pt = ptstk; @@ -4072,12 +4080,12 @@ else sfputr(mp, p, 0); if (!(p = sfstruse(mp))) - goto nospace; + goto outofmemory; if (sp) sfclose(sp); return opt_info.msg = p; - nospace: - s = T(NULL, ID, "* out of space *"); + outofmemory: + s = T(NULL, ID, "* out of memory *"); nope: if (psp) pop(psp); @@ -4150,7 +4158,7 @@ if (opt_info.num != LONG_MIN) opt_info.num = (long)(opt_info.number = 0); if (!p || !(mp = state.mp) && !(mp = state.mp = sfstropen())) - goto nospace; + goto outofmemory; s = *p == '-' ? p : opt_info.name; if (*p == '!') { @@ -4183,7 +4191,7 @@ else if (p = sfstruse(tp)) sfputr(mp, T(id, catalog, p), ' '); else - goto nospace; + goto outofmemory; } p = opt_info.name2 ? C("value expected") : C("argument expected"); } @@ -4211,8 +4219,8 @@ sfputr(mp, " -- out of range", -1); if (opt_info.arg = sfstruse(mp)) return ':'; - nospace: - opt_info.arg = T(NULL, ID, "* out of space *"); + outofmemory: + opt_info.arg = T(NULL, ID, "* out of memory *"); return ':'; } @@ -4285,7 +4293,7 @@ int no; int nov; int num; - int numchr; + int numchr = 0; int prefix; int version; Help_t* hp; @@ -4299,6 +4307,7 @@ if (!oopts) return 0; + state.emphasis = 0; state.pindex = opt_info.index; state.poffset = opt_info.offset; if (!opt_info.index) @@ -4749,13 +4758,13 @@ else if (*s == '') { s = next(s + 1, version); + k = *(f = s); if (*s == '(') { s = nest(f = s); if (!conformance(f, s - f)) goto disable; } - k = *(f = s); if (k == '+' || k == '-') /* ignore */; else if (k == '' || version < 1) @@ -4795,7 +4804,7 @@ { sfprintf(xp, ":%s|%s?", g, e); if (!(s = sfstruse(xp))) - goto nospace; + goto outofmemory; } } else @@ -5027,7 +5036,7 @@ else if (*(f + 1) == '=') break; else - cache->flagsmap*f = m; + cache->flagsmap*((unsigned char*)f) = m; j = 0; /* * parse and cache short option equivalents, @@ -5146,7 +5155,7 @@ if (*(s + 2) == '?') m |= OPT_cache_optional; } - cache->flagsmap*s = m; + cache->flagsmap*((unsigned char*)s) = m; } s++; continue; @@ -5384,7 +5393,7 @@ { sfprintf(xp, ":%s|%s?", b, e); if (!(s = sfstruse(xp))) - goto nospace; + goto outofmemory; } } else @@ -5576,7 +5585,7 @@ } pop(psp); return '?'; - nospace: + outofmemory: pop(psp); return opterror(NULL, 0, 0, NULL, NULL); } @@ -5608,9 +5617,6 @@ char* s = (char*)str; Sfio_t* mp; int c; - int ql; - int qr; - int qc; int v; char* e; @@ -5660,7 +5666,7 @@ opt_info.index = 1; opt_info.offset = ++s - (char*)str; if (!(s = sfstruse(mp))) - goto nospace; + goto outofmemory; s += 2; e = opt_info.name; while (e < &opt_info.namesizeof(opt_info.name)-1 && (*e++ = *s++)); @@ -5672,8 +5678,10 @@ } if (c == ':' || c == '=') { + int ql = 0; + int qr = 0; + int qc = 0; sfputc(mp, c); - ql = qr = 0; while (c = *++s) { if (c == '\\') @@ -5724,7 +5732,7 @@ opt_info.argv = state.strv; state.strv0 = T(NULL, ID, "option"); if (!(state.strv1 = sfstruse(mp))) - goto nospace; + goto outofmemory; state.strv2 = 0; opt_info.offset = s - (char*)str; } @@ -5758,6 +5766,6 @@ else c = '-'; return c; - nospace: + outofmemory: return opterror(NULL, 0, 0, NULL, NULL); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/optjoin.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/optjoin.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -55,8 +55,8 @@ int user; int last_index; int last_offset; - int err_index; - int err_offset; + int err_index = 0; + int err_offset = 0; state = optstate(&opt_info); err = rep = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/procopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/procopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -393,7 +393,7 @@ procopen(const char* cmd, char** argv, char** envv, long* modv, int flags) { Proc_t* proc = 0; - int procfd; + int procfd = -1; char** p; char** v; int i; @@ -431,9 +431,6 @@ goto bad; switch (flags & (PROC_READ|PROC_WRITE)) { - case 0: - procfd = -1; - break; case PROC_READ: procfd = 1; break;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/signal.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/signal.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,18 +23,9 @@ * fun==SIG_DFL also unblocks signal */ -#if !__HAIKU__ - -#undef signal -#define signal ______signal - -#endif - #include <ast.h> #include <sig.h> -#undef signal - #undef _def_map_ast #include <ast_map.h> @@ -60,7 +51,7 @@ #define sa_mask sv_mask #endif -extern Sig_handler_t +Sig_handler_t signal(int sig, Sig_handler_t fun) { struct sigaction na;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/state.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/state.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -18,8 +18,6 @@ * * ***********************************************************************/ -static const char id = "\n@(#)$Id: ast (ksh 93u+m) $\0\n"; - #include <ast.h> #undef strcmp
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/stk.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/stk.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -53,12 +53,13 @@ #define STK_FSIZE (1024*sizeof(char*)) #define STK_HDRSIZE (sizeof(Sfio_t)+sizeof(Sfdisc_t)) -typedef char* (*_stk_overflow_)(size_t); +typedef void* (*_stk_overflow_)(size_t); +typedef char* (*_old_stk_overflow_)(size_t); /* for stkinstall (deprecated) */ static int stkexcept(Sfio_t*,int,void*,Sfdisc_t*); static Sfdisc_t stkdisc = { 0, 0, 0, stkexcept }; -Sfio_t _Stak_data = SFNEW(NULL,0,-1,SF_STATIC|SF_WRITE|SF_STRING,&stkdisc); +Sfio_t _Stak_data = SFNEW(NULL,0,-1,SFIO_STATIC|SFIO_WRITE|SFIO_STRING,&stkdisc); struct frame { @@ -86,40 +87,16 @@ #define stk2stream(sp) ((Sfio_t*)(((char*)(sp))-STK_HDRSIZE)) #define stkleft(stream) ((stream)->_endb-(stream)->_data) - -#ifdef STKSTATS - static struct - { - int create; - int delete; - int install; - int alloc; - int copy; - int puts; - int seek; - int set; - int grow; - int addsize; - int delsize; - int movsize; - } _stkstats; -# define increment(x) (_stkstats.x++) -# define count(x,n) (_stkstats.x += (n)) -#else -# define increment(x) -# define count(x,n) -#endif /* STKSTATS */ - -static const char Omsg = "malloc failed while growing stack\n"; +static const char Omsg = "out of memory while growing stack\n"; /* * default overflow exception */ -static noreturn char *overflow(size_t n) +static noreturn void *overflow(size_t n) { NoP(n); write(2,Omsg, sizeof(Omsg)-1); - exit(2); + exit(128); UNREACHABLE(); } @@ -132,7 +109,7 @@ init = size; sp = stkopen(0); init = 1; - stkinstall(sp,overflow); + stkinstall(sp,(_old_stk_overflow_)overflow); } static int stkexcept(Sfio_t *stream, int type, void* val, Sfdisc_t* dp) @@ -141,14 +118,13 @@ NoP(val); switch(type) { - case SF_CLOSING: + case SFIO_CLOSING: { struct stk *sp = stream2stk(stream); char *cp = sp->stkbase; struct frame *fp; if(--sp->stkref == 0) { - increment(delete); if(stream==stkstd) stkset(stream,NULL,0); else @@ -172,13 +148,13 @@ stream->_data = stream->_next = 0; } return 0; - case SF_FINAL: + case SFIO_FINAL: free(stream); return 1; - case SF_DPOP: + case SFIO_DPOP: return -1; - case SF_WRITE: - case SF_SEEK: + case SFIO_WRITE: + case SFIO_SEEK: { long size = sfvalue(stream); if(init) @@ -195,7 +171,7 @@ stkinit(size); } return 1; - case SF_NEW: + case SFIO_NEW: return -1; } return 0; @@ -214,13 +190,11 @@ char *cp; if(!(stream=newof(NULL,Sfio_t, 1, sizeof(*dp)+sizeof(*sp)))) return NULL; - increment(create); - count(addsize,sizeof(*stream)+sizeof(*dp)+sizeof(*sp)); dp = (Sfdisc_t*)(stream+1); dp->exceptf = stkexcept; sp = (struct stk*)(dp+1); sp->stkref = 1; - sp->stkflags = (flags&STK_SMALL); + sp->stkflags = flags; if(flags&STK_NULL) sp->stkoverflow = 0; else sp->stkoverflow = stkcur?stkcur->stkoverflow:overflow; bsize = init+sizeof(struct frame); @@ -234,14 +208,13 @@ free(stream); return NULL; } - count(addsize,sizeof(*fp)+bsize); cp = (char*)(fp+1); sp->stkbase = (char*)fp; fp->prev = 0; fp->nalias = 0; fp->aliases = 0; fp->end = sp->stkend = cp+bsize; - if(!sfnew(stream,cp,bsize,-1,SF_STRING|SF_WRITE|SF_STATIC|SF_EOF)) + if(!sfnew(stream,cp,bsize,-1,SFIO_STRING|SFIO_WRITE|SFIO_STATIC|SFIO_EOF)) return NULL; sfdisc(stream,dp); return stream; @@ -252,7 +225,7 @@ * if <stream> is not null, it becomes the new current stack * <oflow> becomes the new overflow function */ -Sfio_t *stkinstall(Sfio_t *stream, _stk_overflow_ oflow) +Sfio_t *stkinstall(Sfio_t *stream, _old_stk_overflow_ oflow) { Sfio_t *old; struct stk *sp; @@ -260,15 +233,14 @@ { stkinit(1); if(oflow) - stkcur->stkoverflow = oflow; + stkcur->stkoverflow = (_stk_overflow_)oflow; return NULL; } - increment(install); old = stkcur?stk2stream(stkcur):0; if(stream) { sp = stream2stk(stream); - while(sfstack(stkstd, SF_POPSTACK)); + while(sfstack(stkstd, SFIO_POPSTACK)); if(stream!=stkstd) sfstack(stkstd,stream); stkcur = sp; @@ -276,11 +248,23 @@ else sp = stkcur; if(oflow) - sp->stkoverflow = oflow; + sp->stkoverflow = (_stk_overflow_)oflow; return old; } /* + * set or unset the overflow function + */ +void stkoverflow(Sfio_t *stream, _stk_overflow_ oflow) +{ + struct stk *sp; + if(!init) + stkinit(1); + sp = stream2stk(stream); + sp->stkoverflow = oflow ? oflow : (sp->stkflags & STK_NULL ? NULL : overflow); +} + +/* * increase the reference count on the given <stack> */ unsigned int stklink(Sfio_t* stream) @@ -319,21 +303,20 @@ return 0; } /* - * reset the bottom of the current stack back to <loc> - * if <loc> is null, then the stack is reset to the beginning - * if <loc> is not in this stack, the program dumps core + * reset the bottom of the current stack back to <address> + * if <address> is null, then the stack is reset to the beginning + * if <address> is not in this stack, the program dumps core * otherwise, the top of the stack is set to stkbot+<offset> */ -char *stkset(Sfio_t * stream, char* loc, size_t offset) +void *stkset(Sfio_t *stream, void *address, size_t offset) { struct stk *sp = stream2stk(stream); - char *cp; + char *cp, *loc = (char*)address; struct frame *fp; int frames = 0; int n; if(!init) stkinit(offset+1); - increment(set); while(1) { fp = (struct frame*)sp->stkbase; @@ -376,45 +359,43 @@ else stream->_data = stream->_next = (unsigned char*)cp; found: - return (char*)stream->_data; + return stream->_data; } /* * allocate <n> bytes on the current stack */ -char *stkalloc(Sfio_t *stream, size_t n) +void *stkalloc(Sfio_t *stream, size_t n) { unsigned char *old; if(!init) stkinit(n); - increment(alloc); n = roundof(n,STK_ALIGN); if(stkleft(stream) <= (int)n && !stkgrow(stream,n)) return NULL; old = stream->_data; stream->_data = stream->_next = old+n; - return (char*)old; + return old; } /* * begin a new stack word of at least <n> bytes */ -char *_stkseek(Sfio_t *stream, ssize_t n) +void *_stkseek(Sfio_t *stream, ssize_t n) { if(!init) stkinit(n); - increment(seek); if(stkleft(stream) <= n && !stkgrow(stream,n)) return NULL; stream->_next = stream->_data+n; - return (char*)stream->_data; + return stream->_data; } /* * advance the stack to the current top * if extra is non-zero, first add extra bytes and zero the first */ -char *stkfreeze(Sfio_t *stream, size_t extra) +void *stkfreeze(Sfio_t *stream, size_t extra) { unsigned char *old, *top; if(!init) @@ -462,7 +443,6 @@ n = roundof(cp-(unsigned char*)str,STK_ALIGN); if(!init) stkinit(n); - increment(copy); if(stkleft(stream) <= n && !stkgrow(stream,n)) cp = 0; else @@ -515,8 +495,6 @@ cp = newof(dp, char, n, nn*sizeof(char*)); if(!cp && (!sp->stkoverflow || !(cp = (*sp->stkoverflow)(n)))) return NULL; - increment(grow); - count(addsize,n - (dp?m:0)); if(dp==cp) { nn--; @@ -542,10 +520,7 @@ fp->aliasesnn-1 = oldbase + roundof(sizeof(struct frame),STK_ALIGN); } if(m && !dp) - { memcpy(cp,(char*)stream->_data,m); - count(movsize,m); - } sfsetbuf(stream,cp,sp->stkend-cp); return (char*)(stream->_next = stream->_data+m); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/translate.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/translate.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -295,7 +295,7 @@ char* t; int p; int oerrno; - Catalog_t* cp; + Catalog_t* cp = NULL; Message_t* mp; static uint32_t serial; @@ -348,7 +348,6 @@ #if DEBUG_trace > 1 sfprintf(sfstderr, "AHA#%d:%s cmd %s cat %s:%s ID %s msg `%s'\n", __LINE__, __FILE__, cmd, cat, error_info.catalog, ast.id, msg); #endif - cp = 0; goto done; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/misc/univlib.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/misc/univlib.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -14,6 +14,7 @@ * David Korn <dgk@research.att.com> * * Phong Vo <kpv@research.att.com> * * Martijn Dekker <martijn@inlv.org> * +* Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ /* @@ -33,9 +34,7 @@ #define _UNIVLIB_H #define getuniverse ______getuniverse -#define readlink ______readlink #define setuniverse ______setuniverse -#define symlink ______symlink #define universe ______universe #include <ast.h> @@ -49,9 +48,7 @@ #endif #undef getuniverse -#undef readlink #undef setuniverse -#undef symlink #undef universe #if _cmd_universe @@ -73,9 +70,7 @@ #endif extern int getuniverse(char*); -extern int readlink(const char*, char*, int); extern int setuniverse(int); -extern int symlink(const char*, const char*); extern int universe(int); #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathbin.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathbin.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -28,7 +28,7 @@ char* pathbin(void) { - char* bin; + char* bin; static char* val;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathcheck.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathcheck.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -48,7 +48,7 @@ pathcheck(const char* package, const char* tool, Pathcheck_t* pc) { #ifdef PARANOID - char* s; + char* s; struct stat st; if (strmatch(tool, PARANOID) && environ && (s = *environ) && *s++ == '_' && *s++ == '=' && !stat(s, &st))
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathfind.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathfind.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -49,7 +49,7 @@ int pathinclude(const char* dir) { - Dir_t* dp; + Dir_t* dp; struct stat st; if (dir && *dir && !streq(dir, ".") && directory(dir, &st)) @@ -82,8 +82,8 @@ { Dir_t* dp; char* s; - char tmpPATH_MAX; - struct stat st; + char tmpPATH_MAX; + struct stat st; if (((s = strrchr(name, '/')) || (s = (char*)name)) && strchr(s, '.')) type = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathicase.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathicase.c
Changed
@@ -1,8 +1,7 @@ /*********************************************************************** * * * This file is part of the ksh 93u+m package * -* Copyright (c) 2021-2022 Contributors to ksh 93u+m * -* <https://github.com/ksh93/ksh> * +* Copyright (c) 2021-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,14 +23,14 @@ #if _hdr_linux_msdos_fs #include <linux/msdos_fs.h> #endif -#if _hdr_sys_ioctl +#if _sys_ioctl #include <sys/ioctl.h> #endif -#if _hdr_sys_ioctl && _hdr_linux_fs && defined(FS_IOC_GETFLAGS) && defined(FS_CASEFOLD_FL) +#if _sys_ioctl && _hdr_linux_fs && defined(FS_IOC_GETFLAGS) && defined(FS_CASEFOLD_FL) #define _linux_casefold 1 #endif -#if _hdr_sys_ioctl && _hdr_linux_msdos_fs && defined(FAT_IOCTL_GET_ATTRIBUTES) +#if _sys_ioctl && _hdr_linux_msdos_fs && defined(FAT_IOCTL_GET_ATTRIBUTES) #define _linux_fatfs 1 #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathkey.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathkey.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -280,5 +280,11 @@ while (k > key + 8) *--k = '.'; } +/* disable false positive warning */ +#if __clang__ +#pragma clang diagnostic ignored "-Wreturn-stack-address" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wreturn-local-addr" +#endif return key == buf ? strdup(key) : key; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathpath.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathpath.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -47,7 +47,7 @@ char* pathpath_20100601(const char* p, const char* a, int mode, char* path, size_t size) { - char* s; + char* s; char* x; char bufPATH_MAX; @@ -120,5 +120,11 @@ x = !a && strchr(p, '/') ? "" : pathbin(); if (!(s = pathaccess(x, p, a, mode, path, size)) && !*x && (x = getenv("FPATH"))) s = pathaccess(x, p, a, mode, path, size); +/* disable false positive warning */ +#if __clang__ +#pragma clang diagnostic ignored "-Wreturn-stack-address" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wreturn-local-addr" +#endif return (s && path == buf) ? strdup(s) : s; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathprobe.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathprobe.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -318,5 +318,11 @@ if (eaccess(path, R_OK)) return NULL; } +/* disable false positive warning */ +#if __clang__ +#pragma clang diagnostic ignored "-Wreturn-stack-address" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wreturn-local-addr" +#endif return path == buf ? strdup(path) : path; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/path/pathrepl.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/path/pathrepl.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -43,7 +43,7 @@ { const char* m = match; const char* r; - char* t; + char* t; if (!match) match = "";
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/port/astconf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/port/astconf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,8 +23,6 @@ * extended to allow some features to be set per-process */ -static const char id = "\n@(#)$Id: getconf (AT&T Research) 2012-05-01 $\0\n"; - #include "univlib.h" #include <ast.h> @@ -792,10 +790,10 @@ static int lookup(Lookup_t* look, const char* name, unsigned int flags) { - Conf_t* mid = (Conf_t*)conf; - Conf_t* lo = mid; - Conf_t* hi = mid + conf_elements; - int v; + Conf_t* lo = (Conf_t*)conf; + Conf_t* mid = lo; + Conf_t* hi = lo + conf_elements - 1; + int v = 0; int c; char* e; const Prefix_t* p; @@ -1316,9 +1314,9 @@ ops1 = 0; if (*pp = procopen(_pth_getconf, cmd, environ, ops, PROC_READ)) { - if (sp = sfnew(NULL, NULL, SF_UNBOUND, (*pp)->rfd, SF_READ)) + if (sp = sfnew(NULL, NULL, SFIO_UNBOUND, (*pp)->rfd, SFIO_READ)) { - sfdisc(sp, SF_POPDISC); + sfdisc(sp, SFIO_POPDISC); return sp; } procclose(*pp);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/port/astmath.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/port/astmath.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -20,27 +20,33 @@ /* * used to test if -last requires -lm * - * arch -last -lm - * ---- ----- --- - * linux.sparc sfdlen,sfputd frexp,ldexp + * This program is compiled and linked from a probe script in libast/Mamfile + * but never actually run. It is only used to check if linking succeeds + * without or with -lm. + * + * For that test to work correctly, we must work around compiler optimization. + * The rand() calls are to stop the result from being considered known at + * compile time, which would cause modern compilers to optimize out the probe + * calls, which would in turn cause linking to succeed where it shouldn't. */ #if N >= 8 #define _ISOC99_SOURCE 1 #endif +#include <stdlib.h> #include <math.h> int main(void) { #if N & 1 - long double value = 0; + long double value = rand(); #else - double value = 0; + double value = rand(); #endif #if N < 5 - int exp = 0; + int exp = rand(); #endif #if N == 1
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/port/lc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/port/lc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -60,7 +60,6 @@ { &default_lc, 0, 0 }, { &default_lc, 0, 0 }, { &default_lc, 0, 0 }, - { &default_lc, 0, 0 }, { &default_lc, 0, 0 } } }; @@ -90,7 +89,6 @@ { &debug_lc, 0, 0 }, { &debug_lc, 0, 0 }, { &debug_lc, 0, 0 }, - { &debug_lc, 0, 0 }, { &debug_lc, 0, 0 } }, &default_lc @@ -112,7 +110,6 @@ &default_lc, &default_lc, &default_lc, - &default_lc, &default_lc }; @@ -139,7 +136,6 @@ case LC_PAPER: return AST_LC_PAPER; case LC_TELEPHONE: return AST_LC_TELEPHONE; case LC_TIME: return AST_LC_TIME; - case LC_XLITERATE: return AST_LC_XLITERATE; } return -1; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/port/lcgen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/port/lcgen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -17,7 +17,11 @@ * Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ +#if __clang__ #pragma clang diagnostic ignored "-Wparentheses" +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic ignored "-Wparentheses" +#endif /* * generate <lc.h> implementation tables from lc.tab * this must make it through vanilla cc with no -last @@ -231,12 +235,12 @@ char** ve; Attribute_t* ap; Attribute_list_t* al; - Attribute_list_t* az; + Attribute_list_t* az = NULL; Charset_t* cp; Territory_t* tp; Language_t* lp; Language_list_t* ll; - Language_list_t* lz; + Language_list_t* lz = NULL; Map_t* mp; char* b; char* f;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/port/mc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/port/mc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -57,7 +57,7 @@ char* s; char* e; char* p; - const char* v; + const char* v = NULL; int i; int first; int next; @@ -622,7 +622,7 @@ { SFCVINIT(); cv = _Sfcv36; - for (n = m = 0; (c = cv*s) < 36; s++) + for (n = m = 0; (c = cv*((unsigned char*)s)) < 36; s++) { m++; n ^= c;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regclass.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regclass.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -71,7 +71,14 @@ static int Isgraph(int c) { return iswgraph(c); } static int Islower(int c) { return iswlower(c); } static int Isprint(int c) { return iswprint(c); } -static int Ispunct(int c) { return iswpunct(c); } +static int Ispunct(int c) +{ +#if _iswpunct_broken && CC_NATIVE == CC_ASCII + if (c < 128) + return ispunct(c); +#endif + return iswpunct(c); +} static int Isspace(int c) { return iswspace(c); } static int Notspace(int c) { return !iswspace(c); } static int Isupper(int c) { return iswupper(c); } @@ -221,7 +228,7 @@ cp->size = 0; if (!streq(cp->name, s)) { - free((char*)cp->name); + free((void*)cp->name); cp->name = 0; } } @@ -234,7 +241,7 @@ /* mvs.390 needs the (char*) cast -- barf */ if (!(cp->wtype = wctype((char*)cp->name))) { - free((char*)cp->name); + free((void*)cp->name); cp->name = 0; return NULL; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regcomp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regcomp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -1031,7 +1031,7 @@ int et; Ckey_t key; - cc = 0; + c = cc = 0; for (;;) { k = key; @@ -1203,7 +1203,7 @@ * inrange: 0=no, 1=possibly, 2=definitely */ - inrange = 0; + inrange = last = 0; for (;;) { if (!(c = *env->cursor) || c == env->terminator || c == env->delimiter && (env->flags & REG_ESCAPE)) @@ -1423,10 +1423,10 @@ Cchr_t* xc; Celt_t* ce; Cchr_t key; - int rw; - int rc; + int rw = 0; + int rc = 0; wchar_t wc; - unsigned char* rp; + unsigned char* rp = NULL; unsigned char* pp; char cb2COLL_KEY_MAX+1; @@ -2514,6 +2514,7 @@ } p = env->pattern; i = env->type; + e = NULL; if (x) { if (typ >= 0) @@ -2581,8 +2582,8 @@ Token_t tok; int c; int i; - int n; - int x; + int n = 1; + int x = 0; int parno; int type; regflags_t flags;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regdecomp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regdecomp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -71,7 +71,7 @@ Rex_t* q; unsigned char* s; unsigned char* t; - int c; + int c = 0; int m; int cb; int cd;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regexec.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regexec.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -55,9 +55,7 @@ */ #undef regexec -#if _map_libc #define regexec _ast_regexec -#endif extern int regexec(const regex_t* p, const char* s, size_t nmatch, oldregmatch_t* oldmatch, regflags_t flags)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regnexec.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regnexec.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -150,7 +150,7 @@ inc = 16; if (!(sp = stkopen(STK_SMALL|STK_NULL))) return NULL; - if (!(v = (Vector_t*)stkseek(sp, sizeof(Vector_t) + inc * siz))) + if (!(v = stkseek(sp, sizeof(Vector_t) + inc * siz))) { stkclose(sp); return NULL; @@ -171,7 +171,7 @@ if (index >= v->max) { while ((v->max += v->inc) <= index); - if (!(v = (Vector_t*)stkseek(v->stk, sizeof(Vector_t) + v->max * v->siz))) + if (!(v = stkseek(v->stk, sizeof(Vector_t) + v->max * v->siz))) return NULL; *p = v; v->vec = (char*)v + sizeof(Vector_t); @@ -207,7 +207,7 @@ stknew(sp, &p); size = sizeof(Stk_frame_t) + sizeof(size_t) + size - 1; - if (!(f = (Stk_frame_t*)stkalloc(sp, sizeof(Stk_frame_t) + sizeof(Stk_frame_t*) + size - 1))) + if (!(f = stkalloc(sp, sizeof(Stk_frame_t) + sizeof(Stk_frame_t*) + size - 1))) return NULL; f->pos = p; stkframe(sp) = f; @@ -252,7 +252,7 @@ if (rex->re.group.number <= 0 || (num = rex->re.group.last - rex->re.group.number + 1) <= 0) num = 0; - if (!(f = (Match_frame_t*)stkpush(env->mst, sizeof(Match_frame_t) + (num - 1) * sizeof(regmatch_t)))) + if (!(f = stkpush(env->mst, sizeof(Match_frame_t) + (num - 1) * sizeof(regmatch_t)))) { env->error = REG_ESPACE; return 1; @@ -960,7 +960,7 @@ e = env->end; if (!(rex->flags & REG_MINIMAL)) { - if (!(b = (unsigned char*)stkpush(env->mst, n))) + if (!(b = stkpush(env->mst, n))) { env->error = REG_ESPACE; return BAD; @@ -1032,6 +1032,8 @@ cont = rex->re.conj_right.cont; break; case REX_DONE: + { + Pos_t* pos; if (!env->stack) return BEST; n = s - env->beg; @@ -1060,7 +1062,8 @@ env->best0.rm_eo = n; memcpy(&env->best1, &env->match1, r * sizeof(regmatch_t)); n = env->pos->cur; - if (!vector(Pos_t, env->bestpos, n)) + pos = vector(Pos_t, env->bestpos, n); + if (!pos) { env->error = REG_ESPACE; return BAD; @@ -1069,6 +1072,7 @@ memcpy(env->bestpos->vec, env->pos->vec, n * sizeof(Pos_t)); DEBUG_TEST(0x0100,(sfprintf(sfstdout,"AHA#%04d 0x%04x %s (%z,%z)(%z,%z)(%z,%z)(%z,%z) (%z,%z)(%z,%z)\n", __LINE__, debug_flag, rexname(rex), env->best0.rm_so, env->best0.rm_eo, env->best1.rm_so, env->best1.rm_eo, env->best2.rm_so, env->best2.rm_eo, env->best3.rm_so, env->best3.rm_eo, env->match0.rm_so, env->match0.rm_eo, env->match1.rm_so, env->match1.rm_eo)),(0)); return GOOD; + } case REX_DOT: if (LEADING(env, rex, s)) return NONE; @@ -1106,7 +1110,7 @@ } else { - if (!(b = (unsigned char*)stkpush(env->mst, n))) + if (!(b = stkpush(env->mst, n))) { env->error = REG_ESPACE; return BAD; @@ -1418,7 +1422,7 @@ n = ((i + 7) >> 3) + 1; catcher.type = REX_NEG_CATCH; catcher.re.neg_catch.beg = s; - if (!(p = (unsigned char*)stkpush(env->mst, n))) + if (!(p = stkpush(env->mst, n))) return BAD; memset(catcher.re.neg_catch.index = p, 0, n); catcher.next = rex->next; @@ -1517,7 +1521,7 @@ } else { - if (!(b = (unsigned char*)stkpush(env->mst, n))) + if (!(b = stkpush(env->mst, n))) { env->error = REG_ESPACE; return BAD; @@ -1854,7 +1858,7 @@ int regnexec_20120528(const regex_t* p, const char* s, size_t len, size_t nmatch, regmatch_t* match, regflags_t flags) { - ssize_t n; + ssize_t n = 0; int i; int j; int k; @@ -1884,7 +1888,7 @@ if (env->stack = env->hard || !(env->flags & REG_NOSUB) && nmatch) { n = env->nsub; - if (!(env->match = (regmatch_t*)stkpush(env->mst, 2 * (n + 1) * sizeof(regmatch_t))) || + if (!(env->match = stkpush(env->mst, 2 * (n + 1) * sizeof(regmatch_t))) || !env->pos && !(env->pos = vecopen(16, sizeof(Pos_t))) || !env->bestpos && !(env->bestpos = vecopen(16, sizeof(Pos_t)))) { @@ -2060,9 +2064,7 @@ */ #undef regnexec -#if _map_libc #define regnexec _ast_regnexec -#endif extern int regnexec(const regex_t* p, const char* s, size_t len, size_t nmatch, oldregmatch_t* oldmatch, regflags_t flags)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regrexec.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regrexec.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -147,9 +147,7 @@ */ #undef regrexec -#if _map_libc #define regrexec _ast_regrexec -#endif extern int regrexec(const regex_t* p, const char* s, size_t len, size_t nmatch, oldregmatch_t* oldmatch, regflags_t flags, int sep, void* handle, regrecord_t record)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regsub.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regsub.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,7 +33,7 @@ int c; char* s; char* e; - const char* b; + const char* b = NULL; regflags_t f; f = flags &= (REG_SUB_LOWER|REG_SUB_UPPER); @@ -195,6 +195,8 @@ { if (c < 0 || *sp != ')') { + if (!b) + abort(); for (; b < sp; b++) sfputc(dp, *b); continue;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/regex/regsubexec.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/regex/regsubexec.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -197,9 +197,7 @@ */ #undef regsubexec -#if _map_libc #define regsubexec _ast_regsubexec -#endif extern int regsubexec(const regex_t* p, const char* s, size_t nmatch, oldregmatch_t* oldmatch)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfgetl.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfgetl.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -25,6 +25,6 @@ extern Sflong_t _sfgetl(Sfio_t* f) { - sfungetc(f, (unsigned char)_SF_(f)->val); + sfungetc(f, (unsigned char)_SFIO_(f)->val); return sfgetl(f); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfgetu.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfgetu.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -25,6 +25,6 @@ extern Sfulong_t _sfgetu(Sfio_t* f) { - sfungetc(f, (unsigned char)_SF_(f)->val); + sfungetc(f, (unsigned char)_SFIO_(f)->val); return sfgetu(f); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -37,20 +37,20 @@ return NULL; /* changing the control flags */ - if(f && !file && !((f->flags|sflags)&SF_STRING) ) - { if(f->mode&SF_INIT ) /* stream uninitialized, ok to set flags */ - { f->flags |= (sflags & (SFIO_FLAGS & ~SF_RDWR)); + if(f && !file && !((f->flags|sflags)&SFIO_STRING) ) + { if(f->mode&SFIO_INIT ) /* stream uninitialized, ok to set flags */ + { f->flags |= (sflags & (SFIO_FLAGS & ~SFIO_RDWR)); - if((sflags &= SF_RDWR) != 0) /* reset read/write modes */ - { f->flags = (f->flags & ~SF_RDWR) | sflags; + if((sflags &= SFIO_RDWR) != 0) /* reset read/write modes */ + { f->flags = (f->flags & ~SFIO_RDWR) | sflags; - if((f->flags&SF_RDWR) == SF_RDWR) - f->bits |= SF_BOTH; - else f->bits &= ~SF_BOTH; + if((f->flags&SFIO_RDWR) == SFIO_RDWR) + f->bits |= SFIO_BOTH; + else f->bits &= ~SFIO_BOTH; - if(f->flags&SF_READ) - f->mode = (f->mode&~SF_WRITE)|SF_READ; - else f->mode = (f->mode&~SF_READ)|SF_WRITE; + if(f->flags&SFIO_READ) + f->mode = (f->mode&~SFIO_WRITE)|SFIO_READ; + else f->mode = (f->mode&~SFIO_READ)|SFIO_WRITE; } } else /* make sure there is no buffered data */ @@ -66,7 +66,7 @@ fcntl(f->file, F_SETFL, ctl); } #if !O_cloexec - if (fflags & SF_FD_CLOEXEC) + if (fflags & SFIO_FD_CLOEXEC) SETCLOEXEC(f->file); #endif } @@ -74,9 +74,9 @@ return f; } - if(sflags&SF_STRING) + if(sflags&SFIO_STRING) { f = sfnew(f,(char*)file, - file ? (size_t)strlen((char*)file) : (size_t)SF_UNBOUND, + file ? (size_t)strlen((char*)file) : (size_t)SFIO_UNBOUND, -1,sflags); } else @@ -84,7 +84,7 @@ return NULL; #if _has_oflags /* open the file */ - while((fd = open((char*)file,oflags,SF_CREATMODE)) < 0 && errno == EINTR) + while((fd = open((char*)file,oflags,SFIO_CREATMODE)) < 0 && errno == EINTR) errno = 0; #else while((fd = open(file,oflags&O_ACCMODE)) < 0 && errno == EINTR) @@ -96,14 +96,14 @@ } if(oflags&O_TRUNC ) /* truncate file */ { int tf; - while((tf = creat(file,SF_CREATMODE)) < 0 && + while((tf = creat(file,SFIO_CREATMODE)) < 0 && errno == EINTR) errno = 0; CLOSE(tf); } } else if(oflags&O_CREAT) - { while((fd = creat(file,SF_CREATMODE)) < 0 && errno == EINTR) + { while((fd = creat(file,SFIO_CREATMODE)) < 0 && errno == EINTR) errno = 0; if((oflags&O_ACCMODE) != O_WRONLY) { /* the file now exists, reopen it for read/write */ @@ -119,7 +119,7 @@ /* we may have to reset the file descriptor to its old value */ oldfd = f ? f->file : -1; - if((f = sfnew(f,NULL,(size_t)SF_UNBOUND,fd,sflags)) && oldfd >= 0) + if((f = sfnew(f,NULL,(size_t)SFIO_UNBOUND,fd,sflags)) && oldfd >= 0) (void)sfsetfd(f,oldfd); } @@ -138,7 +138,7 @@ while(1) switch(*mode++) { case 'a' : - sflags |= SF_WRITE | SF_APPENDWR; + sflags |= SFIO_WRITE | SFIO_APPENDWR; oflags |= O_WRONLY | O_APPEND | O_CREAT; continue; case 'b' : @@ -146,22 +146,22 @@ continue; case 'e' : oflags |= O_cloexec; - fflags |= SF_FD_CLOEXEC; + fflags |= SFIO_FD_CLOEXEC; continue; case 'r' : - sflags |= SF_READ; + sflags |= SFIO_READ; oflags |= O_RDONLY; continue; case 's' : - sflags |= SF_STRING; + sflags |= SFIO_STRING; continue; case 't' : oflags |= O_TEXT; continue; case 'w' : - sflags |= SF_WRITE; + sflags |= SFIO_WRITE; oflags |= O_WRONLY | O_CREAT; - if(!(sflags&SF_READ)) + if(!(sflags&SFIO_READ)) oflags |= O_TRUNC; continue; case 'x' : @@ -171,11 +171,11 @@ /* stdio compatibility -- fd >= FOPEN_MAX (or other magic number) ok */ continue; case 'W' : - sflags |= SF_WCWIDTH; + sflags |= SFIO_WCWIDTH; continue; case '+' : if(sflags) - sflags |= SF_READ|SF_WRITE; + sflags |= SFIO_READ|SFIO_WRITE; continue; default : if(!(oflags&O_CREAT) ) @@ -184,14 +184,14 @@ if(!(oflags&(O_BINARY|O_TEXT))) oflags |= O_BINARY; #endif - if((sflags&SF_RDWR) == SF_RDWR) + if((sflags&SFIO_RDWR) == SFIO_RDWR) oflags = (oflags&~O_ACCMODE)|O_RDWR; if(oflagsp) *oflagsp = oflags; if(fflagsp) *fflagsp = fflags; - if((sflags&(SF_STRING|SF_RDWR)) == SF_STRING) - sflags |= SF_READ; + if((sflags&(SFIO_STRING|SFIO_RDWR)) == SFIO_STRING) + sflags |= SFIO_READ; return sflags; } }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfputd.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfputd.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,7 +32,7 @@ uchar cN_ARRAY; Sfdouble_t x; - if(!f || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + if(!f || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); @@ -63,17 +63,17 @@ s = (ends = &c0)+sizeof(c); while(s > ends) - { /* get 2^SF_PRECIS precision at a time */ - n = (int)(x = ldexpl(v,SF_PRECIS)); - *--s = n|SF_MORE; + { /* get 2^SFIO_PRECIS precision at a time */ + n = (int)(x = ldexpl(v,SFIO_PRECIS)); + *--s = n|SFIO_MORE; v = x-n; if(v <= 0.) break; } - /* last byte is not SF_MORE */ + /* last byte is not SFIO_MORE */ ends = &c0 + sizeof(c) -1; - *ends &= ~SF_MORE; + *ends &= ~SFIO_MORE; /* write out coded bytes */ n = ends - s + 1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfputl.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfputl.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,22 +32,22 @@ ssize_t n, p; uchar cN_ARRAY; - if(!f || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + if(!f || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); s = ps = &(cN_ARRAY-1); if(v < 0) - { /* add 1 to avoid 2-complement problems with -SF_MAXINT */ + { /* add 1 to avoid 2-complement problems with -SFIO_MAXINT */ v = -(v+1); - *s = (uchar)(SFSVALUE(v) | SF_SIGN); + *s = (uchar)(SFSVALUE(v) | SFIO_SIGN); } else *s = (uchar)(SFSVALUE(v)); - v = (Sfulong_t)v >> SF_SBITS; + v = (Sfulong_t)v >> SFIO_SBITS; while(v > 0) - { *--s = (uchar)(SFUVALUE(v) | SF_MORE); - v = (Sfulong_t)v >> SF_UBITS; + { *--s = (uchar)(SFUVALUE(v) | SFIO_MORE); + v = (Sfulong_t)v >> SFIO_UBITS; } n = (ps-s)+1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfputm.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfputm.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,15 +33,15 @@ ssize_t n, p; uchar cN_ARRAY; - if(!f || v > m || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + if(!f || v > m || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); - /* code v as integers in base SF_UBASE */ + /* code v as integers in base SFIO_UBASE */ s = ps = &(cN_ARRAY-1); *s = (uchar)SFBVALUE(v); - while((m >>= SF_BBITS) > 0 ) - { v >>= SF_BBITS; + while((m >>= SFIO_BBITS) > 0 ) + { v >>= SFIO_BBITS; *--s = (uchar)SFBVALUE(v); } n = (ps-s)+1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/_sfputu.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/_sfputu.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,15 +32,15 @@ ssize_t n, p; uchar cN_ARRAY; - if(!f || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + if(!f || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); - /* code v as integers in base SF_UBASE */ + /* code v as integers in base SFIO_UBASE */ s = ps = &(cN_ARRAY-1); *s = (uchar)SFUVALUE(v); - while((v >>= SF_UBITS) ) - *--s = (uchar)(SFUVALUE(v) | SF_MORE); + while((v >>= SFIO_UBITS) ) + *--s = (uchar)(SFUVALUE(v) | SFIO_MORE); n = (ps-s)+1; if(n > 8 || SFWPEEK(f,ps,p) < n)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfclose.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfclose.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,10 +33,10 @@ GETLOCAL(f,local); - if(!(f->mode&SF_INIT) && - SFMODE(f,local) != (f->mode&SF_RDWR) && - SFMODE(f,local) != (f->mode&(SF_READ|SF_SYNCED)) && - _sfmode(f,SF_SYNCED,local) < 0) + if(!(f->mode&SFIO_INIT) && + SFMODE(f,local) != (f->mode&SFIO_RDWR) && + SFMODE(f,local) != (f->mode&(SFIO_READ|SFIO_SYNCED)) && + _sfmode(f,SFIO_SYNCED,local) < 0) return -1; /* closing a stack of streams */ @@ -56,14 +56,14 @@ if(f->disc == _Sfudisc) /* closing the ungetc stream */ f->disc = NULL; else if(f->file >= 0) /* sync file pointer */ - { f->bits |= SF_ENDING; + { f->bits |= SFIO_ENDING; rv = sfsync(f); } SFLOCK(f,0); /* raise discipline exceptions */ - if(f->disc && (ex = SFRAISE(f,local ? SF_NEW : SF_CLOSING,NULL)) != 0) + if(f->disc && (ex = SFRAISE(f,local ? SFIO_NEW : SFIO_CLOSING,NULL)) != 0) return ex; if(!local && f->pool) @@ -82,24 +82,24 @@ } } else - { f->mode &= ~SF_LOCK; /**/ASSERT(_Sfpmove); + { f->mode &= ~SFIO_LOCK; /**/ASSERT(_Sfpmove); if((*_Sfpmove)(f,-1) < 0) { SFOPEN(f,0); return -1; } - f->mode |= SF_LOCK; + f->mode |= SFIO_LOCK; } f->pool = NULL; } - if(f->data && (!local || (f->flags&SF_STRING) || (f->bits&SF_MMAP) ) ) + if(f->data && (!local || (f->flags&SFIO_STRING) || (f->bits&SFIO_MMAP) ) ) { /* free buffer */ #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) SFMUNMAP(f,f->data,f->endb-f->data); else #endif - if(f->flags&SF_MALLOC) + if(f->flags&SFIO_MALLOC) data = f->data; f->data = NULL; @@ -108,8 +108,8 @@ /* zap the file descriptor */ if(_Sfnotify) - (*_Sfnotify)(f, SF_CLOSING, (void*)((long)f->file)); - if(f->file >= 0 && !(f->flags&SF_STRING)) + (*_Sfnotify)(f, SFIO_CLOSING, (void*)((long)f->file)); + if(f->file >= 0 && !(f->flags&SFIO_STRING)) { while(close(f->file) < 0 ) { if(errno == EINTR) errno = 0; @@ -122,7 +122,7 @@ f->file = -1; SFKILL(f); - f->flags &= SF_STATIC; + f->flags &= SFIO_STATIC; f->here = 0; f->extent = -1; f->endb = f->endr = f->endw = f->next = f->data; @@ -138,17 +138,17 @@ rv = _sfpclose(f); if(!local) - { if(f->disc && (ex = SFRAISE(f,SF_FINAL,NULL)) != 0 ) + { if(f->disc && (ex = SFRAISE(f,SFIO_FINAL,NULL)) != 0 ) { rv = ex; goto done; } - if(!(f->flags&SF_STATIC) ) + if(!(f->flags&SFIO_STATIC) ) free(f); else { f->disc = NULL; f->stdio = NULL; - f->mode = SF_AVAIL; + f->mode = SFIO_AVAIL; } }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfclrlock.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfclrlock.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,24 +29,24 @@ int rv; /* already closed */ - if(f && (f->mode&SF_AVAIL) || !f) + if(f && (f->mode&SFIO_AVAIL) || !f) return 0; /* clear error bits */ - f->flags &= ~(SF_ERROR|SF_EOF); + f->flags &= ~(SFIO_ERROR|SFIO_EOF); /* clear peek locks */ - if(f->mode&SF_PKRD) + if(f->mode&SFIO_PKRD) { f->here -= f->endb-f->next; f->endb = f->next; } SFCLRBITS(f); - /* throw away all lock bits except for stacking state SF_PUSH */ - f->mode &= (SF_RDWR|SF_INIT|SF_POOL|SF_PUSH|SF_SYNCED|SF_STDIO); + /* throw away all lock bits except for stacking state SFIO_PUSH */ + f->mode &= (SFIO_RDWR|SFIO_INIT|SFIO_POOL|SFIO_PUSH|SFIO_SYNCED|SFIO_STDIO); - rv = (f->mode&SF_PUSH) ? 0 : (f->flags&SFIO_FLAGS); + rv = (f->mode&SFIO_PUSH) ? 0 : (f->flags&SFIO_FLAGS); return rv; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfcvt.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfcvt.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,12 +29,12 @@ static char *lc_inf = "inf", *uc_inf = "INF"; static char *lc_nan = "nan", *uc_nan = "NAN"; static char *Zero = "0"; -#define SF_INF ((_Sfi = 3), strlcpy(buf, (format & SFFMT_UPPER) ? uc_inf : lc_inf, size), buf) -#define SF_NAN ((_Sfi = 3), strlcpy(buf, (format & SFFMT_UPPER) ? uc_nan : lc_nan, size), buf) -#define SF_ZERO ((_Sfi = 1), strlcpy(buf, Zero, size), buf) -#define SF_INTPART (SF_IDIGITS/2) +#define SFIO_INF ((_Sfi = 3), strlcpy(buf, (format & SFFMT_UPPER) ? uc_inf : lc_inf, size), buf) +#define SFIO_NAN ((_Sfi = 3), strlcpy(buf, (format & SFFMT_UPPER) ? uc_nan : lc_nan, size), buf) +#define SFIO_ZERO ((_Sfi = 1), strlcpy(buf, Zero, size), buf) +#define SFIO_INTPART (SFIO_IDIGITS/2) -#if !_lib_isnan +#if !_lib_isnan || __ANDROID_API__ #undef isnan #undef isnanl #if _lib_fpclassify @@ -136,7 +136,7 @@ if (f < 0) #endif *sign = 1; - return SF_NAN; + return SFIO_NAN; } #if _lib_isinf if (n = isinf(f)) @@ -147,7 +147,7 @@ if (n < 0 || f < 0) #endif *sign = 1; - return SF_INF; + return SFIO_INF; } #endif @@ -161,9 +161,9 @@ } if(f < LDBL_MIN) - return SF_ZERO; + return SFIO_ZERO; if(f > LDBL_MAX) - return SF_INF; + return SFIO_INF; if(format & SFFMT_AFORMAT) { Sfdouble_t g; @@ -193,26 +193,26 @@ n = 0; if(f >= (Sfdouble_t)CVT_LDBL_MAXINT) { /* scale to a small enough number to fit an int */ - v = SF_MAXEXP10-1; + v = SFIO_MAXEXP10-1; do { if(f < _Sfpos10v) v -= 1; else { f *= _Sfneg10v; - if((n += (1<<v)) >= SF_IDIGITS) - return SF_INF; + if((n += (1<<v)) >= SFIO_IDIGITS) + return SFIO_INF; } } 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; + v = SFIO_MAXEXP10-1; do { if(f <= _Sfneg10v) { f *= _Sfpos10v; - if((n += (1<<v)) >= SF_IDIGITS) - return SF_INF; + if((n += (1<<v)) >= SFIO_IDIGITS) + return SFIO_INF; } else if (--v < 0) break; @@ -221,7 +221,7 @@ } *decpt = (int)n; - b = sp = buf + SF_INTPART; + b = sp = buf + SFIO_INTPART; if((v = (CVT_LDBL_INT)f) != 0) { /* translate the integer part */ f -= (Sfdouble_t)v; @@ -229,10 +229,10 @@ sfucvt(v,sp,n,ep,CVT_LDBL_INT,unsigned CVT_LDBL_INT); n = b-sp; - if((*decpt += (int)n) >= SF_IDIGITS) - return SF_INF; + if((*decpt += (int)n) >= SFIO_IDIGITS) + return SFIO_INF; b = sp; - sp = buf + SF_INTPART; + sp = buf + SFIO_INTPART; } else n = 0; @@ -286,7 +286,7 @@ if (f < 0) #endif *sign = 1; - return SF_NAN; + return SFIO_NAN; } #if _lib_isinf if (n = isinf(f)) @@ -297,7 +297,7 @@ if (n < 0 || f < 0) #endif *sign = 1; - return SF_INF; + return SFIO_INF; } #endif @@ -311,9 +311,9 @@ } if(f < DBL_MIN) - return SF_ZERO; + return SFIO_ZERO; if(f > DBL_MAX) - return SF_INF; + return SFIO_INF; if(format & SFFMT_AFORMAT) { double g; @@ -342,25 +342,25 @@ n = 0; if(f >= (double)CVT_DBL_MAXINT) { /* scale to a small enough number to fit an int */ - v = SF_MAXEXP10-1; + v = SFIO_MAXEXP10-1; do { if(f < _Sfpos10v) v -= 1; else { f *= _Sfneg10v; - if((n += (1<<v)) >= SF_IDIGITS) - return SF_INF; + if((n += (1<<v)) >= SFIO_IDIGITS) + return SFIO_INF; } } while(f >= (double)CVT_DBL_MAXINT); } else if(f > 0.0 && f < 0.1) { /* scale to avoid excessive multiply by 10 below */ - v = SF_MAXEXP10-1; + v = SFIO_MAXEXP10-1; do { if(f <= _Sfneg10v) { f *= _Sfpos10v; - if((n += (1<<v)) >= SF_IDIGITS) - return SF_INF; + if((n += (1<<v)) >= SFIO_IDIGITS) + return SFIO_INF; } else if(--v < 0) break; @@ -369,7 +369,7 @@ } *decpt = (int)n; - b = sp = buf + SF_INTPART; + b = sp = buf + SFIO_INTPART; if((v = (CVT_DBL_INT)f) != 0) { /* translate the integer part */ f -= (double)v; @@ -377,10 +377,10 @@ sfucvt(v,sp,n,ep,CVT_DBL_INT,unsigned CVT_DBL_INT); n = b-sp; - if((*decpt += (int)n) >= SF_IDIGITS) - return SF_INF; + if((*decpt += (int)n) >= SFIO_IDIGITS) + return SFIO_INF; b = sp; - sp = buf + SF_INTPART; + sp = buf + SFIO_INTPART; } else n = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfdisc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfdisc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -47,7 +47,7 @@ static int _dccaexcept(Sfio_t* f, int type, void* val, Sfdisc_t* disc) { - if(disc && type == SF_FINAL) + if(disc && type == SFIO_FINAL) free(disc); return 0; } @@ -100,13 +100,13 @@ if((Sfio_t*)disc == f) /* special case to get the top discipline */ return f->disc; - if((f->flags&SF_READ) && f->proc && (f->mode&SF_WRITE) ) + if((f->flags&SFIO_READ) && f->proc && (f->mode&SFIO_WRITE) ) { /* make sure in read mode to check for read-ahead data */ - if(_sfmode(f,SF_READ,0) < 0) + if(_sfmode(f,SFIO_READ,0) < 0) return NULL; } else - { if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0) + { if((f->mode&SFIO_RDWR) != f->mode && _sfmode(f,0,0) < 0) return NULL; } @@ -118,25 +118,25 @@ goto done; /* synchronize before switching to a new discipline */ - if(!(f->flags&SF_STRING)) + if(!(f->flags&SFIO_STRING)) { (void)SFSYNC(f); /* do a silent buffer synch */ - if((f->mode&SF_READ) && (f->mode&SF_SYNCED) ) - { f->mode &= ~SF_SYNCED; + if((f->mode&SFIO_READ) && (f->mode&SFIO_SYNCED) ) + { f->mode &= ~SFIO_SYNCED; f->endb = f->next = f->endr = f->endw = f->data; } /* if there is buffered data, ask app before proceeding */ - if(((f->mode&SF_WRITE) && (n = f->next-f->data) > 0) || - ((f->mode&SF_READ) && (n = f->endb-f->next) > 0) ) + if(((f->mode&SFIO_WRITE) && (n = f->next-f->data) > 0) || + ((f->mode&SFIO_READ) && (n = f->endb-f->next) > 0) ) { int rv = 0; if(rv == 0 && f->disc && f->disc->exceptf) /* ask current discipline */ { SFOPEN(f,0); - rv = (*f->disc->exceptf)(f, SF_DBUFFER, &n, f->disc); + rv = (*f->disc->exceptf)(f, SFIO_DBUFFER, &n, f->disc); SFLOCK(f,0); } if(rv == 0 && disc && disc->exceptf) /* ask discipline being pushed */ { SFOPEN(f,0); - rv = (*disc->exceptf)(f, SF_DBUFFER, &n, disc); + rv = (*disc->exceptf)(f, SFIO_DBUFFER, &n, disc); SFLOCK(f,0); } if(rv < 0) @@ -144,7 +144,7 @@ } /* trick the new discipline into processing already buffered data */ - if((f->mode&SF_READ) && n > 0 && disc && disc->readf ) + if((f->mode&SFIO_READ) && n > 0 && disc && disc->readf ) { if(!(dcca = (Dccache_t*)malloc(sizeof(Dccache_t)+n)) ) goto done; memclear(dcca, sizeof(Dccache_t)); @@ -170,14 +170,14 @@ GETDISCF(owritef,writef); GETDISCF(oseekf,seekf); - if(disc == SF_POPDISC) + if(disc == SFIO_POPDISC) { /* popping, warn the being popped discipline */ if(!(d = f->disc) ) goto done; disc = d->disc; if(d->exceptf) { SFOPEN(f,0); - if((*(d->exceptf))(f,SF_DPOP,disc,d) < 0 ) + if((*(d->exceptf))(f,SFIO_DPOP,disc,d) < 0 ) goto done; SFLOCK(f,0); } @@ -191,7 +191,7 @@ d = f->disc; if(d && d->exceptf) { SFOPEN(f,0); - if( (*(d->exceptf))(f,SF_DPUSH,disc,d) < 0 ) + if( (*(d->exceptf))(f,SFIO_DPUSH,disc,d) < 0 ) goto done; SFLOCK(f,0); } @@ -212,7 +212,7 @@ rdisc = disc; } - if(!(f->flags&SF_STRING) ) + if(!(f->flags&SFIO_STRING) ) { /* this stream may have to be reinitialized */ int reinit = 0; #define DISCF(dst,iof) (dst ? dst->iof : NULL) @@ -230,15 +230,15 @@ if(reinit) { SETLOCAL(f); - f->bits &= ~SF_NULL; /* turn off /dev/null handling */ - if((f->bits&SF_MMAP) || (f->mode&SF_INIT)) - sfsetbuf(f,NULL,(size_t)SF_UNBOUND); + f->bits &= ~SFIO_NULL; /* turn off /dev/null handling */ + if((f->bits&SFIO_MMAP) || (f->mode&SFIO_INIT)) + sfsetbuf(f,NULL,(size_t)SFIO_UNBOUND); else if(f->data == f->tiny) sfsetbuf(f,NULL,0); else { int flags = f->flags; sfsetbuf(f,f->data,f->size); - f->flags |= (flags&SF_MALLOC); + f->flags |= (flags&SFIO_MALLOC); } } }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfdlen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfdlen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -39,8 +39,8 @@ else exp = 0; for(w = 1; w <= N_ARRAY; ++w) - { /* get 2^SF_PRECIS precision at a time */ - n = (int)(x = ldexpl(v,SF_PRECIS)); + { /* get 2^SFIO_PRECIS precision at a time */ + n = (int)(x = ldexpl(v,SFIO_PRECIS)); v = x-n; if(v <= 0.) break;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfecvt.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfecvt.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,7 +24,7 @@ int* sign) /* to return sign */ { int len; - static char bufSF_MAXDIGITS; + static char bufSFIO_MAXDIGITS; return _sfcvt(&dval,buf,sizeof(buf),n_digit,decpt,sign,&len,SFFMT_EFORMAT); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfexcept.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfexcept.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,10 +35,10 @@ return -1; GETLOCAL(f,local); - lock = f->mode&SF_LOCK; + lock = f->mode&SFIO_LOCK; if(local && io <= 0) - f->flags |= io < 0 ? SF_ERROR : SF_EOF; + f->flags |= io < 0 ? SFIO_ERROR : SFIO_EOF; if(disc && disc->exceptf) { /* let the stream be generally accessible for this duration */ @@ -53,28 +53,28 @@ if(local && lock) SFLOCK(f,0); - if(io > 0 && !(f->flags&SF_STRING) ) + if(io > 0 && !(f->flags&SFIO_STRING) ) return ev; if(ev < 0) - return SF_EDONE; + return SFIO_EDONE; if(ev > 0) - return SF_EDISC; + return SFIO_EDISC; } - if(f->flags&SF_STRING) - { if(type == SF_READ) + if(f->flags&SFIO_STRING) + { if(type == SFIO_READ) goto chk_stack; - else if(type != SF_WRITE && type != SF_SEEK) - return SF_EDONE; + else if(type != SFIO_WRITE && type != SFIO_SEEK) + return SFIO_EDONE; if(local && io >= 0) - { if(f->size >= 0 && !(f->flags&SF_MALLOC)) + { if(f->size >= 0 && !(f->flags&SFIO_MALLOC)) goto chk_stack; /* extend buffer */ if((size = f->size) < 0) size = 0; if((io -= size) <= 0) - io = SF_GRAIN; - size = ((size+io+SF_GRAIN-1)/SF_GRAIN)*SF_GRAIN; + io = SFIO_GRAIN; + size = ((size+io+SFIO_GRAIN-1)/SFIO_GRAIN)*SFIO_GRAIN; if(f->size > 0) data = (uchar*)realloc((char*)f->data,size); else data = (uchar*)malloc(size); @@ -85,24 +85,24 @@ f->endr = f->endw = f->data = data; f->size = size; } - return SF_EDISC; + return SFIO_EDISC; } if(errno == EINTR) - { if(_Sfexiting || (f->bits&SF_ENDING) || /* stop being a hero */ - (f->flags&SF_IOINTR) ) /* application requests to return */ - return SF_EDONE; + { if(_Sfexiting || (f->bits&SFIO_ENDING) || /* stop being a hero */ + (f->flags&SFIO_IOINTR) ) /* application requests to return */ + return SFIO_EDONE; /* a normal interrupt, we can continue */ errno = 0; - f->flags &= ~(SF_EOF|SF_ERROR); - return SF_ECONT; + f->flags &= ~(SFIO_EOF|SFIO_ERROR); + return SFIO_ECONT; } chk_stack: if(local && f->push && - ((type == SF_READ && f->next >= f->endb) || - (type == SF_WRITE && f->next <= f->data))) + ((type == SFIO_READ && f->next >= f->endb) || + (type == SFIO_WRITE && f->next <= f->data))) { /* pop the stack */ Sfio_t *pf; @@ -117,9 +117,9 @@ if(lock) SFLOCK(f,0); - ev = ev < 0 ? SF_EDONE : SF_ESTACK; + ev = ev < 0 ? SFIO_EDONE : SFIO_ESTACK; } - else ev = SF_EDONE; + else ev = SFIO_EDONE; return ev; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfextern.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfextern.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -44,9 +44,9 @@ ssize_t _Sfi = -1; /* value for a few fast macro functions */ ssize_t _Sfmaxr = 0; /* default (unlimited) max record size */ -Sfio_t _Sfstdin = SFNEW(NULL,-1,0,(SF_READ |SF_STATIC),NULL); -Sfio_t _Sfstdout = SFNEW(NULL,-1,1,(SF_WRITE|SF_STATIC),NULL); -Sfio_t _Sfstderr = SFNEW(NULL,-1,2,(SF_WRITE|SF_STATIC),NULL); +Sfio_t _Sfstdin = SFNEW(NULL,-1,0,(SFIO_READ |SFIO_STATIC),NULL); +Sfio_t _Sfstdout = SFNEW(NULL,-1,1,(SFIO_WRITE|SFIO_STATIC),NULL); +Sfio_t _Sfstderr = SFNEW(NULL,-1,2,(SFIO_WRITE|SFIO_STATIC),NULL); #undef sfstdin #undef sfstdout
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sffcvt.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sffcvt.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,7 +24,7 @@ int* sign) /* to return sign */ { int len; - static char bufSF_MAXDIGITS; + static char bufSFIO_MAXDIGITS; return _sfcvt(&dval,buf,sizeof(buf),n_digit,decpt,sign,&len,0); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sffilbuf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sffilbuf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -40,14 +40,14 @@ GETLOCAL(f,local); /* any peek data must be preserved across stacked streams */ - rcrv = f->mode&(SF_RC|SF_RV|SF_LOCK); + rcrv = f->mode&(SFIO_RC|SFIO_RV|SFIO_LOCK); rc = f->getr; - justseek = f->bits&SF_JUSTSEEK; f->bits &= ~SF_JUSTSEEK; + justseek = f->bits&SFIO_JUSTSEEK; f->bits &= ~SFIO_JUSTSEEK; - for(first = 1;; first = 0, (f->mode &= ~SF_LOCK) ) + for(first = 1;; first = 0, (f->mode &= ~SFIO_LOCK) ) { /* check mode */ - if(SFMODE(f,local) != SF_READ && _sfmode(f,SF_READ,local) < 0) + if(SFMODE(f,local) != SFIO_READ && _sfmode(f,SFIO_READ,local) < 0) return -1; SFLOCK(f,local); @@ -56,11 +56,11 @@ { /* on first iteration, n is amount beyond current buffer; afterward, n is the exact amount requested */ if((first && n <= 0) || (!first && n <= r) || - (f->flags&SF_STRING)) + (f->flags&SFIO_STRING)) break; /* try shifting left to make room for new data */ - if(!(f->bits&SF_MMAP) && f->next > f->data && + if(!(f->bits&SFIO_MMAP) && f->next > f->data && n > (f->size - (f->endb-f->data)) ) { ssize_t s = r; @@ -76,15 +76,15 @@ f->endb = f->data + s; } } - else if(!(f->flags&SF_STRING) && !(f->bits&SF_MMAP) ) + else if(!(f->flags&SFIO_STRING) && !(f->bits&SFIO_MMAP) ) f->next = f->endb = f->endr = f->data; - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) r = n > 0 ? n : f->size; - else if(!(f->flags&SF_STRING) ) + else if(!(f->flags&SFIO_STRING) ) { r = f->size - (f->endb - f->data); /* available buffer */ if(n > 0) - { if(r > n && f->extent < 0 && (f->flags&SF_SHARE) ) + { if(r > n && f->extent < 0 && (f->flags&SFIO_SHARE) ) r = n; /* read only as much as requested */ else if(justseek && n <= f->iosz && f->iosz <= f->size) r = f->iosz; /* limit buffer filling */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfflsbuf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfflsbuf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -19,7 +19,7 @@ #include "sfhdr.h" /* Write a buffer out to a file descriptor or -** extending a buffer for a SF_STRING stream. +** extending a buffer for a SFIO_STRING stream. ** ** Written by Kiem-Phong Vo */ @@ -38,23 +38,23 @@ GETLOCAL(f,local); - for(written = 0;; f->mode &= ~SF_LOCK) + for(written = 0;; f->mode &= ~SFIO_LOCK) { /* check stream mode */ - if(SFMODE(f,local) != SF_WRITE && _sfmode(f,SF_WRITE,local) < 0) + if(SFMODE(f,local) != SFIO_WRITE && _sfmode(f,SFIO_WRITE,local) < 0) return -1; SFLOCK(f,local); /* current data extent */ n = f->next - (data = f->data); - if(n == (f->endb-data) && (f->flags&SF_STRING)) + if(n == (f->endb-data) && (f->flags&SFIO_STRING)) { /* call sfwr() to extend string buffer and process events */ - w = ((f->bits&SF_PUTR) && f->val > 0) ? f->val : 1; + w = ((f->bits&SFIO_PUTR) && f->val > 0) ? f->val : 1; (void)SFWR(f, data, w, f->disc); - /* !(f->flags&SF_STRING) is required because exception + /* !(f->flags&SFIO_STRING) is required because exception handlers may turn a string stream to a file stream */ - if(f->next < f->endb || !(f->flags&SF_STRING) ) + if(f->next < f->endb || !(f->flags&SFIO_STRING) ) n = f->next - (data = f->data); else { SFOPEN(f,local); @@ -67,7 +67,7 @@ if(n < (f->endb - (data = f->data))) { *f->next++ = c; if(c == '\n' && - (f->flags&SF_LINE) && !(f->flags&SF_STRING)) + (f->flags&SFIO_LINE) && !(f->flags&SFIO_STRING)) { c = -1; n += 1; } @@ -82,7 +82,7 @@ } } - if(n == 0 || (f->flags&SF_STRING)) + if(n == 0 || (f->flags&SFIO_STRING)) break; isall = SFISALL(f,isall); @@ -102,7 +102,7 @@ return -1; } } - else /* w < 0 means SF_EDISC or SF_ESTACK in sfwr() */ + else /* w < 0 means SFIO_EDISC or SFIO_ESTACK in sfwr() */ { if(c < 0) /* back to the calling write operation */ break; else continue; /* try again to write out c */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfgetd.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfgetd.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,7 +32,7 @@ if(!f || (sign = sfgetc(f)) < 0 || (exp = (int)sfgetu(f)) < 0) return -1.; - if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0) + if(f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0) return -1.; SFLOCK(f,0); @@ -41,7 +41,7 @@ for(;;) { /* fast read for data */ if(SFRPEEK(f,s,p) <= 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; v = -1.; goto done; } @@ -49,8 +49,8 @@ for(ends = s+p; s < ends; ) { c = *s++; v += SFUVALUE(c); - v = ldexpl(v,-SF_PRECIS); - if(!(c&SF_MORE)) + v = ldexpl(v,-SFIO_PRECIS); + if(!(c&SFIO_MORE)) { f->next = s; goto done; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfgetl.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfgetl.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,25 +29,25 @@ uchar *s, *ends, c; int p; - if(!f || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return (Sflong_t)(-1); SFLOCK(f,0); for(v = 0;;) { if(SFRPEEK(f,s,p) <= 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; v = (Sflong_t)(-1); goto done; } for(ends = s+p; s < ends;) { c = *s++; - if(c&SF_MORE) - v = ((Sfulong_t)v << SF_UBITS) | SFUVALUE(c); + if(c&SFIO_MORE) + v = ((Sfulong_t)v << SFIO_UBITS) | SFUVALUE(c); else { /* special translation for this byte */ - v = ((Sfulong_t)v << SF_SBITS) | SFSVALUE(c); + v = ((Sfulong_t)v << SFIO_SBITS) | SFSVALUE(c); f->next = s; - v = (c&SF_SIGN) ? -v-1 : v; + v = (c&SFIO_SIGN) ? -v-1 : v; goto done; } }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfgetm.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfgetm.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,21 +29,21 @@ uchar *s, *ends, c; int p; - if(!f || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return (Sfulong_t)(-1); SFLOCK(f,0); for(v = 0;; ) { if(SFRPEEK(f,s,p) <= 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; v = (Sfulong_t)(-1); goto done; } for(ends = s+p; s < ends;) { c = *s++; - v = (v << SF_BBITS) | SFBVALUE(c); - if((m >>= SF_BBITS) <= 0) + v = (v << SFIO_BBITS) | SFBVALUE(c); + if((m >>= SFIO_BBITS) <= 0) { f->next = s; goto done; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfgetr.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfgetr.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,7 +33,7 @@ int found; Sfrsrv_t* rsrv; - if(!f || rc < 0 || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || rc < 0 || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return NULL; SFLOCK(f,0); @@ -44,10 +44,10 @@ found = 0; /* compatibility mode */ - type = type < 0 ? SF_LASTR : type == 1 ? SF_STRING : type; + type = type < 0 ? SFIO_LASTR : type == 1 ? SFIO_STRING : type; - if(type&SF_LASTR) /* return the broken record */ - { if((f->flags&SF_STRING) && (un = f->endb - f->next)) + if(type&SFIO_LASTR) /* return the broken record */ + { if((f->flags&SFIO_STRING) && (un = f->endb - f->next)) { us = f->next; f->next = f->endb; found = 1; @@ -64,7 +64,7 @@ if((n = (ends = f->endb) - (s = f->next)) <= 0) { /* for unseekable devices, peek-read 1 record */ f->getr = rc; - f->mode |= SF_RC; + f->mode |= SFIO_RC; /* fill buffer the conventional way */ if(SFRPEEK(f,s,n) <= 0) @@ -73,7 +73,7 @@ } else { ends = s+n; - if(f->mode&SF_RC) + if(f->mode&SFIO_RC) { s = ends-1 == rc ? ends-1 : ends; goto do_copy; } @@ -94,8 +94,8 @@ found = 1; if(!us && - (!(type&SF_STRING) || !(f->flags&SF_STRING) || - ((f->flags&SF_STRING) && (f->bits&SF_BOTH) ) ) ) + (!(type&SFIO_STRING) || !(f->flags&SFIO_STRING) || + ((f->flags&SFIO_STRING) && (f->bits&SFIO_BOTH) ) ) ) { /* returning data in buffer */ us = f->next; un = s - f->next; @@ -107,7 +107,7 @@ /* amount to be read */ n = s - f->next; - if(!found && (_Sfmaxr > 0 && un+n+1 >= _Sfmaxr || (f->flags&SF_STRING))) /* already exceed limit */ + if(!found && (_Sfmaxr > 0 && un+n+1 >= _Sfmaxr || (f->flags&SFIO_STRING))) /* already exceed limit */ { us = NULL; goto done; } @@ -135,11 +135,11 @@ done: _Sfi = f->val = un; f->getr = 0; - if(found && rc != 0 && (type&SF_STRING) ) + if(found && rc != 0 && (type&SFIO_STRING) ) { usun-1 = '\0'; if(us >= f->data && us < f->endb) { f->getr = rc; - f->mode |= SF_GETR; + f->mode |= SFIO_GETR; } } @@ -149,8 +149,8 @@ SFOPEN(f,0); - if(us && (type&SF_LOCKR) ) - { f->mode |= SF_PEEK|SF_GETR; + if(us && (type&SFIO_LOCKR) ) + { f->mode |= SFIO_PEEK|SFIO_GETR; f->endr = f->data; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfgetu.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfgetu.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,21 +29,21 @@ uchar *s, *ends, c; int p; - if(!f || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return (Sfulong_t)(-1); SFLOCK(f,0); for(v = 0;;) { if(SFRPEEK(f,s,p) <= 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; v = (Sfulong_t)(-1); goto done; } for(ends = s+p; s < ends;) { c = *s++; - v = (v << SF_UBITS) | SFUVALUE(c); - if(!(c&SF_MORE)) + v = (v << SFIO_UBITS) | SFUVALUE(c); + if(!(c&SFIO_MORE)) { f->next = s; goto done; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfhdr.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfhdr.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -115,13 +115,7 @@ #endif #if _socket_peek -#if __FreeBSD__ && __BSD_VISIBLE -#undef __BSD_VISIBLE /* Hide conflicting SF_SYNC definition. Added 2022-01-20. TODO: review periodically */ #include <sys/socket.h> -#define __BSD_VISIBLE 1 -#else -#include <sys/socket.h> -#endif #endif /* to test for executable access mode of a file */ @@ -130,51 +124,51 @@ #endif /* Private flags in the "bits" field */ -#define SF_MMAP 00000001 /* in memory mapping mode */ -#define SF_BOTH 00000002 /* both read/write */ -#define SF_HOLE 00000004 /* a hole of zero's was created */ -#define SF_NULL 00000010 /* stream is /dev/null */ -#define SF_SEQUENTIAL 00000020 /* sequential access */ -#define SF_JUSTSEEK 00000040 /* just did a sfseek */ -#define SF_PRIVATE 00000100 /* private stream to Sfio */ -#define SF_ENDING 00000200 /* no re-io on interrupts at closing */ -#define SF_WIDE 00000400 /* in wide mode - stdio only */ -#define SF_PUTR 00001000 /* in sfputr() */ +#define SFIO_MMAP 00000001 /* in memory mapping mode */ +#define SFIO_BOTH 00000002 /* both read/write */ +#define SFIO_HOLE 00000004 /* a hole of zero's was created */ +#define SFIO_NULL 00000010 /* stream is /dev/null */ +#define SFIO_SEQUENTIAL 00000020 /* sequential access */ +#define SFIO_JUSTSEEK 00000040 /* just did a sfseek */ +#define SFIO_PRIVATE 00000100 /* private stream to Sfio */ +#define SFIO_ENDING 00000200 /* no re-io on interrupts at closing */ +#define SFIO_WIDE 00000400 /* in wide mode - stdio only */ +#define SFIO_PUTR 00001000 /* in sfputr() */ /* "bits" flags that must be cleared in sfclrlock */ -#define SF_TMPBITS 00170000 -#define SF_DCDOWN 00010000 /* recurse down the discipline stack */ +#define SFIO_TMPBITS 00170000 +#define SFIO_DCDOWN 00010000 /* recurse down the discipline stack */ -#define SF_WCFORMAT 00020000 /* wchar_t formatting - stdio only */ +#define SFIO_WCFORMAT 00020000 /* wchar_t formatting - stdio only */ #if _has_multibyte -#define SFWCSET(f) ((f)->bits |= SF_WCFORMAT) -#define SFWCGET(f,v) (((v) = (f)->bits & SF_WCFORMAT), ((f)->bits &= ~SF_WCFORMAT) ) +#define SFWCSET(f) ((f)->bits |= SFIO_WCFORMAT) +#define SFWCGET(f,v) (((v) = (f)->bits & SFIO_WCFORMAT), ((f)->bits &= ~SFIO_WCFORMAT) ) #else #define SFWCSET(f) #define SFWCGET(f,v) #endif -#define SF_MVSIZE 00040000 /* f->size was reset in sfmove() */ -#define SFMVSET(f) (((f)->size *= SF_NMAP), ((f)->bits |= SF_MVSIZE) ) -#define SFMVUNSET(f) (!((f)->bits&SF_MVSIZE) ? 0 : \ - (((f)->bits &= ~SF_MVSIZE), ((f)->size /= SF_NMAP)) ) +#define SFIO_MVSIZE 00040000 /* f->size was reset in sfmove() */ +#define SFMVSET(f) (((f)->size *= SFIO_NMAP), ((f)->bits |= SFIO_MVSIZE) ) +#define SFMVUNSET(f) (!((f)->bits&SFIO_MVSIZE) ? 0 : \ + (((f)->bits &= ~SFIO_MVSIZE), ((f)->size /= SFIO_NMAP)) ) -#define SFCLRBITS(f) (SFMVUNSET(f), ((f)->bits &= ~SF_TMPBITS) ) +#define SFCLRBITS(f) (SFMVUNSET(f), ((f)->bits &= ~SFIO_TMPBITS) ) -/* bits for the mode field, SF_INIT defined in sfio_t.h */ -#define SF_RC 00000010 /* peeking for a record */ -#define SF_RV 00000020 /* reserve without read or most write */ -#define SF_LOCK 00000040 /* stream is locked for io op */ -#define SF_PUSH 00000100 /* stream has been pushed */ -#define SF_POOL 00000200 /* stream is in a pool but not current */ -#define SF_PEEK 00000400 /* there is a pending peek */ -#define SF_PKRD 00001000 /* did a peek read */ -#define SF_GETR 00002000 /* did a getr on this stream */ -#define SF_SYNCED 00004000 /* stream was synced */ -#define SF_STDIO 00010000 /* given up the buffer to stdio */ -#define SF_AVAIL 00020000 /* was closed, available for reuse */ -#define SF_LOCAL 00100000 /* sentinel for a local call */ +/* bits for the mode field, SFIO_INIT defined in sfio_t.h */ +#define SFIO_RC 00000010 /* peeking for a record */ +#define SFIO_RV 00000020 /* reserve without read or most write */ +#define SFIO_LOCK 00000040 /* stream is locked for io op */ +#define SFIO_PUSH 00000100 /* stream has been pushed */ +#define SFIO_POOL 00000200 /* stream is in a pool but not current */ +#define SFIO_PEEK 00000400 /* there is a pending peek */ +#define SFIO_PKRD 00001000 /* did a peek read */ +#define SFIO_GETR 00002000 /* did a getr on this stream */ +#define SFIO_SYNCED 00004000 /* stream was synced */ +#define SFIO_STDIO 00010000 /* given up the buffer to stdio */ +#define SFIO_AVAIL 00020000 /* was closed, available for reuse */ +#define SFIO_LOCAL 00100000 /* sentinel for a local call */ #ifdef DEBUG #define ASSERT(p) ((p) ? 0 : (abort(),0) ) @@ -240,9 +234,9 @@ #endif #ifdef S_IRUSR -#define SF_CREATMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) +#define SFIO_CREATMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #else -#define SF_CREATMODE 0666 +#define SFIO_CREATMODE 0666 #endif /* set close-on-exec */ @@ -259,7 +253,7 @@ # endif /*FIOCLEX*/ #endif /*F_SETFD*/ -#define SF_FD_CLOEXEC 0x0001 +#define SFIO_FD_CLOEXEC 0x0001 /* function to get the decimal point for local environment */ #include "lclib.h" @@ -420,28 +414,28 @@ } Sfextern_t; /* get the real value of a byte in a coded long or ulong */ -#define SFUVALUE(v) (((ulong)(v))&(SF_MORE-1)) -#define SFSVALUE(v) ((( long)(v))&(SF_SIGN-1)) -#define SFBVALUE(v) (((ulong)(v))&(SF_BYTE-1)) +#define SFUVALUE(v) (((ulong)(v))&(SFIO_MORE-1)) +#define SFSVALUE(v) ((( long)(v))&(SFIO_SIGN-1)) +#define SFBVALUE(v) (((ulong)(v))&(SFIO_BYTE-1)) /* pick this many bits in each iteration of double encoding */ -#define SF_PRECIS 7 +#define SFIO_PRECIS 7 /* grain size for buffer increment */ -#define SF_GRAIN 1024 -#define SF_PAGE ((ssize_t)(SF_GRAIN*sizeof(int)*2)) +#define SFIO_GRAIN 1024 +#define SFIO_PAGE ((ssize_t)(SFIO_GRAIN*sizeof(int)*2)) /* when the buffer is empty, certain io requests may be better done directly on the given application buffers. The below condition determines when. */ #define SFDIRECT(f,n) (((ssize_t)(n) >= (f)->size) || \ - ((n) >= SF_GRAIN && (ssize_t)(n) >= (f)->size/16 ) ) + ((n) >= SFIO_GRAIN && (ssize_t)(n) >= (f)->size/16 ) ) /* number of pages to memory map at a time */ #if _ptr_bits >= 64 -#define SF_NMAP 1024 +#define SFIO_NMAP 1024 #else -#define SF_NMAP 32 +#define SFIO_NMAP 32 #endif #ifndef MAP_VARIABLE @@ -477,23 +471,23 @@ /* the bottomless bit bucket */ #define DEVNULL "/dev/null" -#define SFSETNULL(f) ((f)->extent = (Sfoff_t)(-1), (f)->bits |= SF_NULL) -#define SFISNULL(f) ((f)->extent < 0 && ((f)->bits&SF_NULL) ) +#define SFSETNULL(f) ((f)->extent = (Sfoff_t)(-1), (f)->bits |= SFIO_NULL) +#define SFISNULL(f) ((f)->extent < 0 && ((f)->bits&SFIO_NULL) ) -#define SFKILL(f) ((f)->mode = (SF_AVAIL|SF_LOCK) ) -#define SFKILLED(f) (((f)->mode&(SF_AVAIL|SF_LOCK)) == (SF_AVAIL|SF_LOCK) ) +#define SFKILL(f) ((f)->mode = (SFIO_AVAIL|SFIO_LOCK) ) +#define SFKILLED(f) (((f)->mode&(SFIO_AVAIL|SFIO_LOCK)) == (SFIO_AVAIL|SFIO_LOCK) ) /* exception types */ -#define SF_EDONE 0 /* stop this operation and return */ -#define SF_EDISC 1 /* discipline says it's ok */ -#define SF_ESTACK 2 /* stack was popped */ -#define SF_ECONT 3 /* can continue normally */ - -#define SETLOCAL(f) ((f)->mode |= SF_LOCAL) -#define GETLOCAL(f,v) ((v) = ((f)->mode&SF_LOCAL), (f)->mode &= ~SF_LOCAL, (v)) -#define SFWRALL(f) ((f)->mode |= SF_RV) -#define SFISALL(f,v) ((((v) = (f)->mode&SF_RV) ? ((f)->mode &= ~SF_RV) : 0), \ - ((v) || ((f)->flags&(SF_SHARE|SF_APPENDWR|SF_WHOLE)) ) ) +#define SFIO_EDONE 0 /* stop this operation and return */ +#define SFIO_EDISC 1 /* discipline says it's ok */ +#define SFIO_ESTACK 2 /* stack was popped */ +#define SFIO_ECONT 3 /* can continue normally */ + +#define SETLOCAL(f) ((f)->mode |= SFIO_LOCAL) +#define GETLOCAL(f,v) ((v) = ((f)->mode&SFIO_LOCAL), (f)->mode &= ~SFIO_LOCAL, (v)) +#define SFWRALL(f) ((f)->mode |= SFIO_RV) +#define SFISALL(f,v) ((((v) = (f)->mode&SFIO_RV) ? ((f)->mode &= ~SFIO_RV) : 0), \ + ((v) || ((f)->flags&(SFIO_SHARE|SFIO_APPENDWR|SFIO_WHOLE)) ) ) #define SFSK(f,a,o,d) (SETLOCAL(f),sfsk(f,(Sfoff_t)a,o,d)) #define SFRD(f,b,n,d) (SETLOCAL(f),sfrd(f,b,n,d)) #define SFWR(f,b,n,d) (SETLOCAL(f),sfwr(f,b,n,d)) @@ -509,20 +503,20 @@ #define SFRAISE(f,e,d) (SETLOCAL(f),sfraise(f,e,d)) /* lock/open a stream */ -#define SFMODE(f,l) ((f)->mode & ~(SF_RV|SF_RC|((l) ? SF_LOCK : 0)) ) -#define SFLOCK(f,l) (void)((f)->mode |= SF_LOCK, (f)->endr = (f)->endw = (f)->data) +#define SFMODE(f,l) ((f)->mode & ~(SFIO_RV|SFIO_RC|((l) ? SFIO_LOCK : 0)) ) +#define SFLOCK(f,l) (void)((f)->mode |= SFIO_LOCK, (f)->endr = (f)->endw = (f)->data) #define _SFOPENRD(f) ((f)->endr = (f)->endb) -#define _SFOPENWR(f) ((f)->endw = ((f)->flags&SF_LINE) ? (f)->data : (f)->endb) -#define _SFOPEN(f) ((f)->mode == SF_READ ? _SFOPENRD(f) : \ - (f)->mode == SF_WRITE ? _SFOPENWR(f) : \ +#define _SFOPENWR(f) ((f)->endw = ((f)->flags&SFIO_LINE) ? (f)->data : (f)->endb) +#define _SFOPEN(f) ((f)->mode == SFIO_READ ? _SFOPENRD(f) : \ + (f)->mode == SFIO_WRITE ? _SFOPENWR(f) : \ ((f)->endw = (f)->endr = (f)->data) ) #define SFOPEN(f,l) (void)((l) ? 0 : \ - ((f)->mode &= ~(SF_LOCK|SF_RC|SF_RV), _SFOPEN(f), 0) ) + ((f)->mode &= ~(SFIO_LOCK|SFIO_RC|SFIO_RV), _SFOPEN(f), 0) ) /* check to see if the stream can be accessed */ -#define SFFROZEN(f) (((f)->mode&(SF_PUSH|SF_LOCK|SF_PEEK)) ? 1 : \ - !((f)->mode&SF_STDIO) ? 0 : \ - _Sfstdsync ? (*_Sfstdsync)(f) : (((f)->mode &= ~SF_STDIO),0) ) +#define SFFROZEN(f) (((f)->mode&(SFIO_PUSH|SFIO_LOCK|SFIO_PEEK)) ? 1 : \ + !((f)->mode&SFIO_STDIO) ? 0 : \ + _Sfstdsync ? (*_Sfstdsync)(f) : (((f)->mode &= ~SFIO_STDIO),0) ) /* set discipline code */ @@ -530,24 +524,24 @@ { Sfdisc_t* d; \ if(!(dc)) \ d = (dc) = (f)->disc; \ - else d = (f->bits&SF_DCDOWN) ? ((dc) = (dc)->disc) : (dc); \ + else d = (f->bits&SFIO_DCDOWN) ? ((dc) = (dc)->disc) : (dc); \ while(d && !(d->iof)) d = d->disc; \ if(d) (dc) = d; \ } #define SFDCRD(f,buf,n,dc,rv) \ - { int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \ + { int dcdown = f->bits&SFIO_DCDOWN; f->bits |= SFIO_DCDOWN; \ rv = (*dc->readf)(f,buf,n,dc); \ - if(!dcdown) f->bits &= ~SF_DCDOWN; \ + if(!dcdown) f->bits &= ~SFIO_DCDOWN; \ } #define SFDCWR(f,buf,n,dc,rv) \ - { int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \ + { int dcdown = f->bits&SFIO_DCDOWN; f->bits |= SFIO_DCDOWN; \ rv = (*dc->writef)(f,buf,n,dc); \ - if(!dcdown) f->bits &= ~SF_DCDOWN; \ + if(!dcdown) f->bits &= ~SFIO_DCDOWN; \ } #define SFDCSK(f,addr,type,dc,rv) \ - { int dcdown = f->bits&SF_DCDOWN; f->bits |= SF_DCDOWN; \ + { int dcdown = f->bits&SFIO_DCDOWN; f->bits |= SFIO_DCDOWN; \ rv = (*dc->seekf)(f,addr,type,dc); \ - if(!dcdown) f->bits &= ~SF_DCDOWN; \ + if(!dcdown) f->bits &= ~SFIO_DCDOWN; \ } /* fast peek of a stream */ @@ -597,21 +591,21 @@ #define O_TEMPORARY 000 #endif -#define SF_RADIX 64 /* maximum integer conversion base */ +#define SFIO_RADIX 64 /* maximum integer conversion base */ -#define SF_MAXCHAR ((uchar)(~0)) +#define SFIO_MAXCHAR ((uchar)(~0)) /* floating point to ASCII conversion */ -#define SF_MAXEXP10 6 -#define SF_MAXPOW10 (1 << SF_MAXEXP10) +#define SFIO_MAXEXP10 6 +#define SFIO_MAXPOW10 (1 << SFIO_MAXEXP10) #if !_ast_fltmax_double -#define SF_FDIGITS 1024 /* max allowed fractional digits */ -#define SF_IDIGITS (8*1024) /* max number of digits in int part */ +#define SFIO_FDIGITS 1024 /* max allowed fractional digits */ +#define SFIO_IDIGITS (8*1024) /* max number of digits in int part */ #else -#define SF_FDIGITS 256 /* max allowed fractional digits */ -#define SF_IDIGITS 1024 /* max number of digits in int part */ +#define SFIO_FDIGITS 256 /* max allowed fractional digits */ +#define SFIO_IDIGITS 1024 /* max number of digits in int part */ #endif -#define SF_MAXDIGITS (((SF_FDIGITS+SF_IDIGITS)/sizeof(int) + 1)*sizeof(int)) +#define SFIO_MAXDIGITS (((SFIO_FDIGITS+SFIO_IDIGITS)/sizeof(int) + 1)*sizeof(int)) /* tables for numerical translation */ #define _Sfpos10 (_Sftable.sf_pos10) @@ -645,8 +639,8 @@ Sfdouble_t ldblinf; /* Sfdouble_t INF */ }; typedef struct _sftab_ -{ Sfdouble_t sf_pos10SF_MAXEXP10; /* positive powers of 10 */ - Sfdouble_t sf_neg10SF_MAXEXP10; /* negative powers of 10 */ +{ Sfdouble_t sf_pos10SFIO_MAXEXP10; /* positive powers of 10 */ + Sfdouble_t sf_neg10SFIO_MAXEXP10; /* negative powers of 10 */ uchar sf_dec200; /* ASCII reps of values < 100 */ char* sf_digits; /* digits for general bases */ int (*sf_cvinitf)(); /* initialization function */ @@ -656,9 +650,9 @@ float* sf_flt_pow10; /* float powers of 10 */ double* sf_dbl_pow10; /* double powers of 10 */ Sfdouble_t* sf_ldbl_pow10; /* Sfdouble_t powers of 10 */ - uchar sf_cv36SF_MAXCHAR+1; /* conversion for base 2-36 */ - uchar sf_cv64SF_MAXCHAR+1; /* conversion for base 37-64 */ - uchar sf_typeSF_MAXCHAR+1; /* conversion formats&types */ + uchar sf_cv36SFIO_MAXCHAR+1; /* conversion for base 2-36 */ + uchar sf_cv64SFIO_MAXCHAR+1; /* conversion for base 37-64 */ + uchar sf_typeSFIO_MAXCHAR+1; /* conversion formats&types */ Sfieee_t sf_ieee; /* IEEE floating point constants*/ } Sftab_t; @@ -793,9 +787,4 @@ #endif #endif -#ifdef _SF_HIDESFFLAGS -#undef SFIO_FLAGS -#define SFIO_FLAGS 0177177 /* PUBLIC FLAGS PASSABLE TO SFNEW() */ -#endif - #endif /*_SFHDR_H*/
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfllen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfllen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -26,6 +26,6 @@ { if(v < 0) v = -(v+1); - v = (Sfulong_t)v >> SF_SBITS; + v = (Sfulong_t)v >> SFIO_SBITS; return 1 + (v > 0 ? sfulen(v) : 0); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfmode.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfmode.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -38,7 +38,7 @@ ** 09/09/1999 (thread-safe) ** 02/01/2001 (adaptive buffering) ** 05/31/2002 (multi-byte handling in sfvprintf/vscanf) -** 09/06/2002 (SF_IOINTR flag) +** 09/06/2002 (SFIO_IOINTR flag) ** 11/15/2002 (%#c for sfvprintf) ** 05/31/2003 (sfsetbuf(f,f,align_size) to set alignment for data) ** (%I1d is fixed to handle "signed char" correctly) @@ -76,19 +76,19 @@ SFLOCK(f,0); /* let application know that we are leaving */ - (void)SFRAISE(f, SF_ATEXIT, NULL); + (void)SFRAISE(f, SFIO_ATEXIT, NULL); - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) continue; /* from now on, write streams are unbuffered */ - pool = f->mode&SF_POOL; - f->mode &= ~SF_POOL; - if((f->flags&SF_WRITE) && !(f->mode&SF_WRITE)) - (void)_sfmode(f,SF_WRITE,1); + pool = f->mode&SFIO_POOL; + f->mode &= ~SFIO_POOL; + if((f->flags&SFIO_WRITE) && !(f->mode&SFIO_WRITE)) + (void)_sfmode(f,SFIO_WRITE,1); if(f->data && - ((f->bits&SF_MMAP) || - ((f->mode&SF_WRITE) && f->next == f->data) ) ) + ((f->bits&SFIO_MMAP) || + ((f->mode&SFIO_WRITE) && f->next == f->data) ) ) (void)SFSETBUF(f,NULL,0); f->mode |= pool; @@ -151,7 +151,7 @@ Sfrsrv_t *rsrv, *rs; /* make buffer if nothing yet */ - size = ((size + SF_GRAIN-1)/SF_GRAIN)*SF_GRAIN; + size = ((size + SFIO_GRAIN-1)/SFIO_GRAIN)*SFIO_GRAIN; if(!(rsrv = f->rsrv) || size > rsrv->size) { if(!(rs = (Sfrsrv_t*)malloc(size+sizeof(Sfrsrv_t)))) size = -1; @@ -187,7 +187,7 @@ p->size = p->ndata = 0; p->rdata = NULL; p->file = fd; - p->sigp = (!stdio && pid >= 0 && (f->flags&SF_WRITE)) ? 1 : 0; + p->sigp = (!stdio && pid >= 0 && (f->flags&SFIO_WRITE)) ? 1 : 0; /* protect from broken pipe signal */ if(p->sigp) @@ -250,12 +250,12 @@ if(!(p = f->proc) ) return -1; - if(type == SF_WRITE) + if(type == SFIO_WRITE) { /* save unread data */ p->ndata = f->endb-f->next; if(p->ndata > p->size) { if(p->rdata) - free((char*)p->rdata); + free(p->rdata); if((p->rdata = (uchar*)malloc(p->ndata)) ) p->size = p->ndata; else @@ -297,25 +297,25 @@ int rv = 0; - if(wanted&SF_SYNCED) /* for (SF_SYNCED|SF_READ) stream, just junk data */ - { wanted &= ~SF_SYNCED; - if((f->mode&(SF_SYNCED|SF_READ)) == (SF_SYNCED|SF_READ) ) + if(wanted&SFIO_SYNCED) /* for (SFIO_SYNCED|SFIO_READ) stream, just junk data */ + { wanted &= ~SFIO_SYNCED; + if((f->mode&(SFIO_SYNCED|SFIO_READ)) == (SFIO_SYNCED|SFIO_READ) ) { f->next = f->endb = f->endr = f->data; - f->mode &= ~SF_SYNCED; + f->mode &= ~SFIO_SYNCED; } } - if((!local && SFFROZEN(f)) || (!(f->flags&SF_STRING) && f->file < 0)) + if((!local && SFFROZEN(f)) || (!(f->flags&SFIO_STRING) && f->file < 0)) { if(local || !f->disc || !f->disc->exceptf) { local = 1; goto err_notify; } for(;;) - { if((rv = (*f->disc->exceptf)(f,SF_LOCKED,0,f->disc)) < 0) + { if((rv = (*f->disc->exceptf)(f,SFIO_LOCKED,0,f->disc)) < 0) return rv; if((!local && SFFROZEN(f)) || - (!(f->flags&SF_STRING) && f->file < 0) ) + (!(f->flags&SFIO_STRING) && f->file < 0) ) { if(rv == 0) { local = 1; goto err_notify; @@ -326,16 +326,16 @@ } } - if(f->mode&SF_GETR) - { f->mode &= ~SF_GETR; + if(f->mode&SFIO_GETR) + { f->mode &= ~SFIO_GETR; #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { if (!++f->ngetr) f->tiny0++; - if(((f->tiny0<<8)|f->ngetr) >= (4*SF_NMAP) ) + if(((f->tiny0<<8)|f->ngetr) >= (4*SFIO_NMAP) ) { /* turn off mmap to avoid page faulting */ - sfsetbuf(f,f->tiny,(size_t)SF_UNBOUND); + sfsetbuf(f,f->tiny,(size_t)SFIO_UNBOUND); f->ngetr = f->tiny0 = 0; } } @@ -346,29 +346,29 @@ } } - if(f->mode&SF_STDIO) /* synchronizing with stdio pointers */ + if(f->mode&SFIO_STDIO) /* synchronizing with stdio pointers */ (*_Sfstdsync)(f); - if(f->disc == _Sfudisc && wanted == SF_WRITE && + if(f->disc == _Sfudisc && wanted == SFIO_WRITE && sfclose((*_Sfstack)(f,NULL)) < 0 ) { local = 1; goto err_notify; } - if(f->mode&SF_POOL) + if(f->mode&SFIO_POOL) { /* move to head of pool */ if(f == f->pool->sf0 || (*_Sfpmove)(f,0) < 0 ) { local = 1; goto err_notify; } - f->mode &= ~SF_POOL; + f->mode &= ~SFIO_POOL; } SFLOCK(f,local); /* buffer initialization */ - wanted &= SF_RDWR; - if(f->mode&SF_INIT) + wanted &= SFIO_RDWR; + if(f->mode&SFIO_INIT) { if(!f->pool && _sfsetpool(f) < 0) { rv = -1; @@ -378,24 +378,24 @@ if(wanted == 0) goto done; - if(wanted != (int)(f->mode&SF_RDWR) && !(f->flags&wanted) ) + if(wanted != (int)(f->mode&SFIO_RDWR) && !(f->flags&wanted) ) goto err_notify; - if((f->flags&SF_STRING) && f->size >= 0 && f->data) - { f->mode &= ~SF_INIT; - f->extent = ((f->flags&SF_READ) || (f->bits&SF_BOTH)) ? + if((f->flags&SFIO_STRING) && f->size >= 0 && f->data) + { f->mode &= ~SFIO_INIT; + f->extent = ((f->flags&SFIO_READ) || (f->bits&SFIO_BOTH)) ? f->size : 0; f->here = 0; f->endb = f->data + f->size; f->next = f->endr = f->endw = f->data; - if(f->mode&SF_READ) + if(f->mode&SFIO_READ) f->endr = f->endb; else f->endw = f->endb; } else { n = f->flags; (void)SFSETBUF(f,f->data,f->size); - f->flags |= (n&SF_MALLOC); + f->flags |= (n&SFIO_MALLOC); } } @@ -404,15 +404,15 @@ switch(SFMODE(f,1)) { - case SF_WRITE: /* switching to SF_READ */ - if(wanted == 0 || wanted == SF_WRITE) + case SFIO_WRITE: /* switching to SFIO_READ */ + if(wanted == 0 || wanted == SFIO_WRITE) break; - if(!(f->flags&SF_READ) ) + if(!(f->flags&SFIO_READ) ) goto err_notify; - else if(f->flags&SF_STRING) + else if(f->flags&SFIO_STRING) { SFSTRSIZE(f); f->endb = f->data+f->extent; - f->mode = SF_READ; + f->mode = SFIO_READ; break; } @@ -426,7 +426,7 @@ f->size = sizeof(f->tiny); } f->next = f->endr = f->endw = f->endb = f->data; - f->mode = SF_READ|SF_LOCK; + f->mode = SFIO_READ|SFIO_LOCK; /* restore saved read data for coprocess */ if(f->proc && _sfpmode(f,wanted) < 0) @@ -434,17 +434,17 @@ break; - case (SF_READ|SF_SYNCED): /* a previously sync-ed read stream */ - if(wanted != SF_WRITE) + case (SFIO_READ|SFIO_SYNCED): /* a previously sync-ed read stream */ + if(wanted != SFIO_WRITE) { /* just reset the pointers */ - f->mode = SF_READ|SF_LOCK; + f->mode = SFIO_READ|SFIO_LOCK; /* see if must go with new physical location */ - if((f->flags&(SF_SHARE|SF_PUBLIC)) == (SF_SHARE|SF_PUBLIC) && + if((f->flags&(SFIO_SHARE|SFIO_PUBLIC)) == (SFIO_SHARE|SFIO_PUBLIC) && (addr = SFSK(f,0,SEEK_CUR,f->disc)) != f->here) { #ifdef MAP_TYPE - if((f->bits&SF_MMAP) && f->data) + if((f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f,f->data,f->endb-f->data); f->data = NULL; } @@ -463,14 +463,14 @@ } /* FALLTHROUGH */ - case SF_READ: /* switching to SF_WRITE */ - if(wanted != SF_WRITE) + case SFIO_READ: /* switching to SFIO_WRITE */ + if(wanted != SFIO_WRITE) break; - else if(!(f->flags&SF_WRITE)) + else if(!(f->flags&SFIO_WRITE)) goto err_notify; - else if(f->flags&SF_STRING) + else if(f->flags&SFIO_STRING) { f->endb = f->data+f->size; - f->mode = SF_WRITE|SF_LOCK; + f->mode = SFIO_WRITE|SFIO_LOCK; break; } @@ -479,9 +479,9 @@ goto err_notify; /* reset buffer and seek pointer */ - if(!(f->mode&SF_SYNCED) ) + if(!(f->mode&SFIO_SYNCED) ) { intptr_t nn = f->endb - f->next; - if(f->extent >= 0 && (nn > 0 || (f->data && (f->bits&SF_MMAP))) ) + if(f->extent >= 0 && (nn > 0 || (f->data && (f->bits&SFIO_MMAP))) ) { /* reset file pointer */ addr = f->here - nn; if(SFSK(f,addr,SEEK_SET,f->disc) < 0) @@ -490,12 +490,12 @@ } } - f->mode = SF_WRITE|SF_LOCK; + f->mode = SFIO_WRITE|SFIO_LOCK; #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { if(f->data) SFMUNMAP(f,f->data,f->endb-f->data); - (void)SFSETBUF(f,f->tiny,(size_t)SF_UNBOUND); + (void)SFSETBUF(f,f->tiny,(size_t)SFIO_UNBOUND); } #endif if(f->data == f->tiny) @@ -508,11 +508,11 @@ default: /* unknown case */ err_notify: - if((wanted &= SF_RDWR) == 0 && (wanted = f->flags&SF_RDWR) == SF_RDWR) - wanted = SF_READ; + if((wanted &= SFIO_RDWR) == 0 && (wanted = f->flags&SFIO_RDWR) == SFIO_RDWR) + wanted = SFIO_READ; /* set errno for operations that access wrong stream type */ - if(wanted != (f->mode&SF_RDWR) && f->file >= 0) + if(wanted != (f->mode&SFIO_RDWR) && f->file >= 0) errno = EBADF; if(_Sfnotify) /* notify application of the error */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfmove.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfmove.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -67,19 +67,19 @@ } /* get the streams into the right mode */ - if(fr->mode != SF_READ && _sfmode(fr,SF_READ,0) < 0) + if(fr->mode != SFIO_READ && _sfmode(fr,SFIO_READ,0) < 0) break; SFLOCK(fr,0); /* flush the write buffer as necessary to make room */ if(fw) - { if(fw->mode != SF_WRITE && _sfmode(fw,SF_WRITE,0) < 0 ) + { if(fw->mode != SFIO_WRITE && _sfmode(fw,SFIO_WRITE,0) < 0 ) break; SFLOCK(fw,0); if(fw->next >= fw->endb || (fw->next > fw->data && fr->extent < 0 && - (fw->extent < 0 || (fw->flags&SF_SHARE)) ) ) + (fw->extent < 0 || (fw->flags&SFIO_SHARE)) ) ) if(SFFLSBUF(fw,-1) < 0 ) break; } @@ -95,9 +95,9 @@ } /* about to move all, set map to a large amount */ - if(n < 0 && (fr->bits&SF_MMAP) && !(fr->bits&SF_MVSIZE) ) + if(n < 0 && (fr->bits&SFIO_MMAP) && !(fr->bits&SFIO_MVSIZE) ) { SFMVSET(fr); - fr->bits |= SF_SEQUENTIAL; /* sequentially access data */ + fr->bits |= SFIO_SEQUENTIAL; /* sequentially access data */ } /* try reading a block of data */ @@ -110,23 +110,23 @@ { /* amount of data remained to be read */ if((w = n > MAX_SSIZE ? MAX_SSIZE : (ssize_t)n) < 0) { if(fr->extent < 0) - w = fr->data == fr->tiny ? SF_GRAIN : fr->size; - else if((fr->extent-fr->here) > SF_NMAP*SF_PAGE) - w = SF_NMAP*SF_PAGE; + w = fr->data == fr->tiny ? SFIO_GRAIN : fr->size; + else if((fr->extent-fr->here) > SFIO_NMAP*SFIO_PAGE) + w = SFIO_NMAP*SFIO_PAGE; else w = (ssize_t)(fr->extent-fr->here); } /* use a decent buffer for data transfer but make sure that if we overread, the left over can be retrieved */ - if(!(fr->flags&SF_STRING) && !(fr->bits&SF_MMAP) && + if(!(fr->flags&SFIO_STRING) && !(fr->bits&SFIO_MMAP) && (n < 0 || fr->extent >= 0) ) - { ssize_t maxw = 4*(_Sfpage > 0 ? _Sfpage : SF_PAGE); + { ssize_t maxw = 4*(_Sfpage > 0 ? _Sfpage : SFIO_PAGE); /* direct transfer to a seekable write stream */ if(fw && fw->extent >= 0 && w <= (fw->endb-fw->next) ) { w = fw->endb - (next = fw->next); - direct = SF_WRITE; + direct = SFIO_WRITE; } else if(w > fr->size && maxw > fr->size) { /* making our own buffer */ @@ -138,14 +138,14 @@ if(rbuf) { next = rbuf; w = rsize; - direct = SF_STRING; + direct = SFIO_STRING; } } } if(!direct) { /* make sure we don't read too far ahead */ - if(n > 0 && fr->extent < 0 && (fr->flags&SF_SHARE) ) + if(n > 0 && fr->extent < 0 && (fr->flags&SFIO_SHARE) ) { if((Sfoff_t)(r = fr->size) > n) r = (ssize_t)n; } @@ -190,7 +190,7 @@ } if(fw) - { if(direct == SF_WRITE) + { if(direct == SFIO_WRITE) fw->next += r; else if(r <= (fw->endb-fw->next) ) { memmove(fw->next,next,r); @@ -214,12 +214,12 @@ SFOPEN(fw,0); } - if(n < 0 && (fr->bits&SF_MMAP) && (fr->bits&SF_MVSIZE)) + if(n < 0 && (fr->bits&SFIO_MMAP) && (fr->bits&SFIO_MVSIZE)) { /* back to normal access mode */ SFMVUNSET(fr); - if((fr->bits&SF_SEQUENTIAL) && (fr->data)) + if((fr->bits&SFIO_SEQUENTIAL) && (fr->data)) SFMMSEQOFF(fr,fr->data,fr->endb-fr->data); - fr->bits &= ~SF_SEQUENTIAL; + fr->bits &= ~SFIO_SEQUENTIAL; } if(rbuf)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfnew.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfnew.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,18 +35,18 @@ int sflags; - if(!(flags&SF_RDWR)) + if(!(flags&SFIO_RDWR)) return NULL; sflags = 0; if((f = oldf) ) - { if(flags&SF_EOF) + { if(flags&SFIO_EOF) { SFCLEAR(f); oldf = NULL; } - else if(f->mode&SF_AVAIL) - { /* only allow SF_STATIC to be already closed */ - if(!(f->flags&SF_STATIC) ) + else if(f->mode&SFIO_AVAIL) + { /* only allow SFIO_STATIC to be already closed */ + if(!(f->flags&SFIO_STATIC) ) return NULL; sflags = f->flags; oldf = NULL; @@ -55,26 +55,26 @@ { /* reopening an open stream, close it first */ sflags = f->flags; - if(((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0) || + if(((f->mode&SFIO_RDWR) != f->mode && _sfmode(f,0,0) < 0) || SFCLOSE(f) < 0 ) return NULL; - if(f->data && ((flags&SF_STRING) || size != (size_t)SF_UNBOUND) ) - { if(sflags&SF_MALLOC) + if(f->data && ((flags&SFIO_STRING) || size != (size_t)SFIO_UNBOUND) ) + { if(sflags&SFIO_MALLOC) free(f->data); f->data = NULL; } if(!f->data) - sflags &= ~SF_MALLOC; + sflags &= ~SFIO_MALLOC; } } if(!f) { /* reuse a standard stream structure if possible */ - if(!(flags&SF_STRING) && file >= 0 && file <= 2) + if(!(flags&SFIO_STRING) && file >= 0 && file <= 2) { f = file == 0 ? sfstdin : file == 1 ? sfstdout : sfstderr; if(f) - { if(f->mode&SF_AVAIL) + { if(f->mode&SFIO_AVAIL) { sflags = f->flags; SFCLEAR(f); } @@ -90,25 +90,25 @@ } /* stream type */ - f->mode = (flags&SF_READ) ? SF_READ : SF_WRITE; - f->flags = (flags&SFIO_FLAGS) | (sflags&(SF_MALLOC|SF_STATIC)); - f->bits = (flags&SF_RDWR) == SF_RDWR ? SF_BOTH : 0; + f->mode = (flags&SFIO_READ) ? SFIO_READ : SFIO_WRITE; + f->flags = (flags&SFIO_FLAGS) | (sflags&(SFIO_MALLOC|SFIO_STATIC)); + f->bits = (flags&SFIO_RDWR) == SFIO_RDWR ? SFIO_BOTH : 0; f->file = file; f->here = f->extent = 0; f->getr = f->tiny0 = 0; - f->mode |= SF_INIT; - if(size != (size_t)SF_UNBOUND) + f->mode |= SFIO_INIT; + if(size != (size_t)SFIO_UNBOUND) { f->size = size; f->data = size <= 0 ? NULL : (uchar*)buf; } f->endb = f->endr = f->endw = f->next = f->data; if(_Sfnotify) - (*_Sfnotify)(f, SF_NEW, (void*)((long)f->file)); + (*_Sfnotify)(f, SFIO_NEW, (void*)((long)f->file)); - if(f->flags&SF_STRING) - (void)_sfmode(f,f->mode&SF_RDWR,0); + if(f->flags&SFIO_STRING) + (void)_sfmode(f,f->mode&SFIO_RDWR,0); return f; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfnputc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfnputc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -36,7 +36,7 @@ return -1; GETLOCAL(f,local); - if(SFMODE(f,local) != SF_WRITE && _sfmode(f,SF_WRITE,local) < 0) + if(SFMODE(f,local) != SFIO_WRITE && _sfmode(f,SFIO_WRITE,local) < 0) return -1; SFLOCK(f,local);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfpeek.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfpeek.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,10 +32,10 @@ /* query for the extent of the remainder of the buffer */ if((sz = size) == 0 || !bp) - { if(f->mode&SF_INIT) + { if(f->mode&SFIO_INIT) (void)_sfmode(f,0,0); - if((f->flags&SF_RDWRSTR) == SF_RDWRSTR) + if((f->flags&SFIO_RDWRSTR) == SFIO_RDWRSTR) { SFSTRSIZE(f); n = (f->data+f->here) - f->next; } @@ -50,8 +50,8 @@ /* else fall down and fill buffer */ } - if(!(mode = f->flags&SF_READ) ) - mode = SF_WRITE; + if(!(mode = f->flags&SFIO_READ) ) + mode = SFIO_WRITE; if((int)f->mode != mode && _sfmode(f,mode,0) < 0) return -1; @@ -63,7 +63,7 @@ if((n = sfvalue(f)) > 0) { *bp = f->next; if(sz < 0) - { f->mode |= SF_PEEK; + { f->mode |= SFIO_PEEK; f->endr = f->endw = f->data; } else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfpoll.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfpoll.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -41,12 +41,12 @@ return -1; check = status+n; /* streams that need polling */ - /* a SF_READ stream is ready if there is buffered read data */ -#define RDREADY(f) (((f->mode&SF_READ) && f->next < f->endb) || \ - ((f->mode&SF_WRITE) && f->proc && f->proc->ndata > 0) ) + /* a SFIO_READ stream is ready if there is buffered read data */ +#define RDREADY(f) (((f->mode&SFIO_READ) && f->next < f->endb) || \ + ((f->mode&SFIO_WRITE) && f->proc && f->proc->ndata > 0) ) - /* a SF_WRITE stream is ready if there is no write data */ -#define WRREADY(f) (!(f->mode&SF_WRITE) || f->next == f->data) + /* a SFIO_WRITE stream is ready if there is no write data */ +#define WRREADY(f) (!(f->mode&SFIO_WRITE) || f->next == f->data) #define HASAUXFD(f) (f->proc && f->proc->file >= 0 && f->proc->file != f->file) @@ -55,28 +55,28 @@ statusr = 0; /* terminate poll on interrupt? */ - if(f->flags&SF_IOINTR) + if(f->flags&SFIO_IOINTR) eintr++; /* check accessibility */ - m = f->mode&SF_RDWR; + m = f->mode&SFIO_RDWR; if((int)f->mode != m && _sfmode(f,m,0) < 0) continue; - if((f->flags&SF_READ) && RDREADY(f)) - statusr |= SF_READ; + if((f->flags&SFIO_READ) && RDREADY(f)) + statusr |= SFIO_READ; - if((f->flags&SF_WRITE) && WRREADY(f)) - statusr |= SF_WRITE; + if((f->flags&SFIO_WRITE) && WRREADY(f)) + statusr |= SFIO_WRITE; - if((f->flags&SF_RDWR) == statusr) + if((f->flags&SFIO_RDWR) == statusr) continue; /* has discipline, ask its opinion */ if(f->disc && f->disc->exceptf) - { if((m = (*f->disc->exceptf)(f,SF_DPOLL,&tm,f->disc)) < 0) + { if((m = (*f->disc->exceptf)(f,SFIO_DPOLL,&tm,f->disc)) < 0) continue; else if(m > 0) - { statusr = m&SF_RDWR; + { statusr = m&SFIO_RDWR; continue; } } @@ -84,13 +84,13 @@ if(f->extent < 0) /* unseekable stream, must poll/select */ checkc++ = r; else /* seekable streams are always ready */ - { if(f->flags&SF_READ) - statusr |= SF_READ; - if(f->flags&SF_WRITE) - statusr |= SF_WRITE; + { if(f->flags&SFIO_READ) + statusr |= SFIO_READ; + if(f->flags&SFIO_WRITE) + statusr |= SFIO_WRITE; } } - /* terminate poll on interrupt only if all streams marked SF_IOINTR */ + /* terminate poll on interrupt only if all streams marked SFIO_IOINTR */ eintr = eintr == n ? -1 : EINTR; np = -1; @@ -113,12 +113,12 @@ fdsm.fd = f->file; fdsm.events = fdsm.revents = 0; - if((f->flags&SF_WRITE) && !WRREADY(f) ) + if((f->flags&SFIO_WRITE) && !WRREADY(f) ) fdsm.events |= POLLOUT; - if((f->flags&SF_READ) && !RDREADY(f) ) + if((f->flags&SFIO_READ) && !RDREADY(f) ) { /* a sfpopen situation with two file descriptors */ - if((f->mode&SF_WRITE) && HASAUXFD(f)) + if((f->mode&SFIO_WRITE) && HASAUXFD(f)) { m += 1; fdsm.fd = f->proc->file; fdsm.revents = 0; @@ -139,16 +139,16 @@ for(m = 0, r = 0; r < np; ++r, ++m) { f = facheckr; - if((f->flags&SF_WRITE) && !WRREADY(f) ) + if((f->flags&SFIO_WRITE) && !WRREADY(f) ) { if(fdsm.revents&(POLLOUT|POLLHUP|POLLERR)) - statuscheckr |= SF_WRITE; + statuscheckr |= SFIO_WRITE; } - if((f->flags&SF_READ) && !RDREADY(f)) - { if((f->mode&SF_WRITE) && HASAUXFD(f)) + if((f->flags&SFIO_READ) && !RDREADY(f)) + { if((f->mode&SFIO_WRITE) && HASAUXFD(f)) m += 1; if(fdsm.revents&(POLLIN|POLLHUP|POLLERR)) - statuscheckr |= SF_READ; + statuscheckr |= SFIO_READ; } } @@ -170,11 +170,11 @@ if(f->file > m) m = f->file; - if((f->flags&SF_WRITE) && !WRREADY(f)) + if((f->flags&SFIO_WRITE) && !WRREADY(f)) FD_SET(f->file,&wr); - if((f->flags&SF_READ) && !RDREADY(f)) - { if((f->mode&SF_WRITE) && HASAUXFD(f)) + if((f->flags&SFIO_READ) && !RDREADY(f)) + { if((f->mode&SFIO_WRITE) && HASAUXFD(f)) { if(f->proc->file > m) m = f->proc->file; FD_SET(f->proc->file, &rd); @@ -201,19 +201,19 @@ for(r = 0; r < np; ++r) { f = facheckr; - if((f->flags&SF_WRITE) && !WRREADY(f) ) + if((f->flags&SFIO_WRITE) && !WRREADY(f) ) { if(FD_ISSET(f->file,&wr) ) - statuscheckr |= SF_WRITE; + statuscheckr |= SFIO_WRITE; } - if((f->flags&SF_READ) && !RDREADY(f) ) - { if((f->mode&SF_WRITE) && HASAUXFD(f) ) + if((f->flags&SFIO_READ) && !RDREADY(f) ) + { if((f->mode&SFIO_WRITE) && HASAUXFD(f) ) { if(FD_ISSET(f->proc->file, &rd) ) - statuscheckr |= SF_READ; + statuscheckr |= SFIO_READ; } else { if(FD_ISSET(f->file,&rd) ) - statuscheckr |= SF_READ; + statuscheckr |= SFIO_READ; } } } @@ -230,7 +230,7 @@ /* announce status */ if(f->disc && f->disc->exceptf) - (*f->disc->exceptf)(f,SF_READY,(void*)(long)statusc,f->disc); + (*f->disc->exceptf)(f,SFIO_READY,(void*)(long)statusc,f->disc); if(c > r) /* move to front of list */ { fac = far;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfpool.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfpool.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,7 +22,7 @@ /* Management of pools of streams. ** If pf is not nil, f is pooled with pf and f becomes current; ** otherwise, f is isolated from its pool. flag can be one of -** 0 or SF_SHARE. +** 0 or SFIO_SHARE. ** ** Written by Kiem-Phong Vo. */ @@ -37,7 +37,7 @@ if(p->s_sf && p->sf != p->array) free(p->sf); - p->mode = SF_AVAIL; + p->mode = SFIO_AVAIL; return 0; } @@ -48,7 +48,7 @@ /* look to see if there is a free pool */ for(last = &_Sfpool, p = last->next; p; last = p, p = p->next) - { if(p->mode == SF_AVAIL ) + { if(p->mode == SFIO_AVAIL ) { p->mode = 0; break; } @@ -66,7 +66,7 @@ } - p->mode = mode&SF_SHARE; + p->mode = mode&SFIO_SHARE; p->s_sf = sizeof(p->array)/sizeof(p->array0); p->sf = p->array; @@ -93,12 +93,12 @@ SFLOCK(head,0); rv = -1; - if(!(p->mode&SF_SHARE) || (head->mode&SF_READ) || (f->mode&SF_READ) ) + if(!(p->mode&SFIO_SHARE) || (head->mode&SFIO_READ) || (f->mode&SFIO_READ) ) { if(SFSYNC(head) < 0) goto done; } else /* shared pool of write-streams, data can be moved among streams */ - { if(SFMODE(head,1) != SF_WRITE && _sfmode(head,SF_WRITE,1) < 0) + { if(SFMODE(head,1) != SFIO_WRITE && _sfmode(head,SFIO_WRITE,1) < 0) goto done; /**/ASSERT(f->next == f->data); @@ -124,8 +124,8 @@ f->next = f->data+v; } - f->mode &= ~SF_POOL; - head->mode |= SF_POOL; + f->mode &= ~SFIO_POOL; + head->mode |= SFIO_POOL; head->next = head->endr = head->endw = head->data; /* clear write buffer */ p->sfn = head; @@ -133,7 +133,7 @@ rv = 0; done: - head->mode &= ~SF_LOCK; /* partially unlock because it's no longer head */ + head->mode &= ~SFIO_LOCK; /* partially unlock because it's no longer head */ return rv; } @@ -149,7 +149,7 @@ p->sfn = p->sfn+1; f->pool = NULL; - f->mode &= ~SF_POOL; + f->mode &= ~SFIO_POOL; if(p->n_sf == 0 || p == &_Sfpool) { if(p != &_Sfpool) @@ -167,9 +167,9 @@ p->sf0 = f; } - /* head stream has SF_POOL off */ + /* head stream has SFIO_POOL off */ f = p->sf0; - f->mode &= ~SF_POOL; + f->mode &= ~SFIO_POOL; if(!SFFROZEN(f)) _SFOPEN(f); @@ -221,13 +221,13 @@ } if(f) /* check for permissions */ - { if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0) + { if((f->mode&SFIO_RDWR) != f->mode && _sfmode(f,0,0) < 0) return NULL; if(f->disc == _Sfudisc) (void)sfclose((*_Sfstack)(f,NULL)); } if(pf) - { if((pf->mode&SF_RDWR) != pf->mode && _sfmode(pf,0,0) < 0) + { if((pf->mode&SFIO_RDWR) != pf->mode && _sfmode(pf,0,0) < 0) return NULL; if(pf->disc == _Sfudisc) (void)sfclose((*_Sfstack)(pf,NULL)); @@ -265,10 +265,10 @@ if(pf->pool && pf->pool != &_Sfpool) /* always use current mode */ mode = pf->pool->mode; - if(mode&SF_SHARE) /* can only have write streams */ - { if(SFMODE(f,1) != SF_WRITE && _sfmode(f,SF_WRITE,1) < 0) + if(mode&SFIO_SHARE) /* can only have write streams */ + { if(SFMODE(f,1) != SFIO_WRITE && _sfmode(f,SFIO_WRITE,1) < 0) goto done; - if(SFMODE(pf,1) != SF_WRITE && _sfmode(pf,SF_WRITE,1) < 0) + if(SFMODE(pf,1) != SFIO_WRITE && _sfmode(pf,SFIO_WRITE,1) < 0) goto done; if(f->next > f->data && SFSYNC(f) < 0) /* start f clean */ goto done;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfpopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfpopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -47,9 +47,9 @@ else pflags = 0; flags = 0; - if (sflags & SF_READ) + if (sflags & SFIO_READ) flags |= PROC_READ; - if (sflags & SF_WRITE) + if (sflags & SFIO_WRITE) flags |= PROC_WRITE; av0 = "sh"; av1 = "-c"; @@ -57,9 +57,9 @@ av3 = 0; if (!(proc = procopen(0, av, 0, 0, flags))) return NULL; - if (!(f = sfnew(f, NULL, (size_t)SF_UNBOUND, - (sflags&SF_READ) ? proc->rfd : proc->wfd, sflags|((sflags&SF_RDWR)?0:SF_READ))) || - _sfpopen(f, (sflags&SF_READ) ? proc->wfd : -1, proc->pid, pflags) < 0) + if (!(f = sfnew(f, NULL, (size_t)SFIO_UNBOUND, + (sflags&SFIO_READ) ? proc->rfd : proc->wfd, sflags|((sflags&SFIO_RDWR)?0:SFIO_READ))) || + _sfpopen(f, (sflags&SFIO_READ) ? proc->wfd : -1, proc->pid, pflags) < 0) { if (f) sfclose(f); procclose(proc);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfprintf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfprintf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -41,7 +41,7 @@ /* make a temp stream */ _Sfnotify = 0; - f = sfnew(NULL,NULL,(size_t)SF_UNBOUND, -1,SF_WRITE|SF_STRING); + f = sfnew(NULL,NULL,(size_t)SFIO_UNBOUND, -1,SFIO_WRITE|SFIO_STRING); _Sfnotify = notify; if(!f) return -1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfprints.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfprints.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,7 +33,7 @@ if(!f) /* make a string stream to write into */ { _Sfnotify = 0; - f = sfnew(NULL,NULL,(size_t)SF_UNBOUND, -1,SF_WRITE|SF_STRING); + f = sfnew(NULL,NULL,(size_t)SFIO_UNBOUND, -1,SFIO_WRITE|SFIO_STRING); _Sfnotify = notify; if(!f) return NULL;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfpurge.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfpurge.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -28,24 +28,24 @@ { int mode; - if(!f || (mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode|SF_SYNCED,0) < 0) + if(!f || (mode = f->mode&SFIO_RDWR) != (int)f->mode && _sfmode(f,mode|SFIO_SYNCED,0) < 0) return -1; - if((f->flags&SF_IOCHECK) && f->disc && f->disc->exceptf) - (void)(*f->disc->exceptf)(f,SF_PURGE,(void*)((int)1),f->disc); + if((f->flags&SFIO_IOCHECK) && f->disc && f->disc->exceptf) + (void)(*f->disc->exceptf)(f,SFIO_PURGE,(void*)((int)1),f->disc); if(f->disc == _Sfudisc) (void)sfclose((*_Sfstack)(f,NULL)); /* cannot purge read string streams */ - if((f->flags&SF_STRING) && (f->mode&SF_READ) ) + if((f->flags&SFIO_STRING) && (f->mode&SFIO_READ) ) goto done; SFLOCK(f,0); /* if memory map must be a read stream, pretend data is gone */ #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { f->here -= f->endb - f->next; if(f->data) { SFMUNMAP(f,f->data,f->endb-f->data); @@ -56,20 +56,20 @@ } #endif - switch(f->mode&~SF_LOCK) + switch(f->mode&~SFIO_LOCK) { default : SFOPEN(f,0); return -1; - case SF_WRITE : + case SFIO_WRITE : f->next = f->data; - if(!f->proc || !(f->flags&SF_READ) || !(f->mode&SF_WRITE) ) + if(!f->proc || !(f->flags&SFIO_READ) || !(f->mode&SFIO_WRITE) ) break; /* 2-way pipe, must clear read buffer */ - (void)_sfmode(f,SF_READ,1); + (void)_sfmode(f,SFIO_READ,1); /* FALLTHROUGH */ - case SF_READ: + case SFIO_READ: if(f->extent >= 0 && f->endb > f->next) { f->here -= f->endb-f->next; (void)SFSK(f,f->here,SEEK_SET,f->disc); @@ -81,8 +81,8 @@ SFOPEN(f,0); done: - if((f->flags&SF_IOCHECK) && f->disc && f->disc->exceptf) - (void)(*f->disc->exceptf)(f,SF_PURGE,(void*)((int)0),f->disc); + if((f->flags&SFIO_IOCHECK) && f->disc && f->disc->exceptf) + (void)(*f->disc->exceptf)(f,SFIO_PURGE,(void*)((int)0),f->disc); return 0; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfputr.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfputr.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -30,7 +30,7 @@ uchar *ps; char *ss; - if(!f || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + if(!f || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); @@ -38,20 +38,20 @@ f->val = sn = -1; ss = (char*)s; for(w = 0; (*s || rc >= 0); ) { /* need to communicate string size to exception handler */ - if((f->flags&SF_STRING) && f->next >= f->endb ) + if((f->flags&SFIO_STRING) && f->next >= f->endb ) { sn = sn < 0 ? strlen(s) : (sn - (s-ss)); ss = (char*)s; /* save current checkpoint */ f->val = sn + (rc >= 0 ? 1 : 0); /* space requirement */ - f->bits |= SF_PUTR; /* tell sfflsbuf to use f->val */ + f->bits |= SFIO_PUTR; /* tell sfflsbuf to use f->val */ } SFWPEEK(f,ps,p); - f->bits &= ~SF_PUTR; /* remove any trace of this */ + f->bits &= ~SFIO_PUTR; /* remove any trace of this */ if(p < 0 ) /* something not right about buffering */ break; - if(p == 0 || (f->flags&SF_WHOLE) ) + if(p == 0 || (f->flags&SFIO_WHOLE) ) { n = sn < 0 ? strlen(s) : sn - (s-ss); if(p >= (n + (rc < 0 ? 0 : 1)) ) { /* buffer can hold everything */ @@ -108,11 +108,11 @@ } /* sync unseekable shared streams */ - if(f->extent < 0 && (f->flags&SF_SHARE) ) + if(f->extent < 0 && (f->flags&SFIO_SHARE) ) (void)SFFLSBUF(f,-1); /* check for line buffering */ - else if((f->flags&SF_LINE) && !(f->flags&SF_STRING) && (n = f->next-f->data) > 0) + else if((f->flags&SFIO_LINE) && !(f->flags&SFIO_STRING) && (n = f->next-f->data) > 0) { if(n > w) n = w; f->next -= n;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfraise.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfraise.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -58,15 +58,15 @@ GETLOCAL(f,local); if(!SFKILLED(f) && !(local && - (type == SF_NEW || type == SF_CLOSING || - type == SF_FINAL || type == SF_ATEXIT)) && - SFMODE(f,local) != (f->mode&SF_RDWR) && _sfmode(f,0,local) < 0) + (type == SFIO_NEW || type == SFIO_CLOSING || + type == SFIO_FINAL || type == SFIO_ATEXIT)) && + SFMODE(f,local) != (f->mode&SFIO_RDWR) && _sfmode(f,0,local) < 0) return -1; SFLOCK(f,local); for(disc = f->disc; disc; ) { next = disc->disc; - if(type == SF_FINAL) + if(type == SFIO_FINAL) f->disc = next; if(disc->exceptf)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfrd.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfrd.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -37,7 +37,7 @@ continue; f = p->sf0; if(!SFFROZEN(f) && f->next > f->data && - (f->mode&SF_WRITE) && f->extent < 0 ) + (f->mode&SFIO_WRITE) && f->extent < 0 ) (void)_sfflsbuf(f,-1); } @@ -46,7 +46,7 @@ { f = _Sfpool.sfn; if(!SFFROZEN(f) && f->next > f->data && - (f->mode&SF_WRITE) && f->extent < 0 ) + (f->mode&SFIO_WRITE) && f->extent < 0 ) (void)_sfflsbuf(f,-1); } } @@ -61,25 +61,25 @@ return -1; GETLOCAL(f,local); - if((rcrv = f->mode & (SF_RC|SF_RV)) ) - f->mode &= ~(SF_RC|SF_RV); - f->bits &= ~SF_JUSTSEEK; + if((rcrv = f->mode & (SFIO_RC|SFIO_RV)) ) + f->mode &= ~(SFIO_RC|SFIO_RV); + f->bits &= ~SFIO_JUSTSEEK; - if(f->mode&SF_PKRD) + if(f->mode&SFIO_PKRD) return -1; - if(!local && !(f->bits&SF_DCDOWN)) /* an external user's call */ - { if(f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0) + if(!local && !(f->bits&SFIO_DCDOWN)) /* an external user's call */ + { if(f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0) return -1; if(f->next < f->endb) { if(SFSYNC(f) < 0) return -1; - if((f->mode&(SF_SYNCED|SF_READ)) == (SF_SYNCED|SF_READ) ) + if((f->mode&(SFIO_SYNCED|SFIO_READ)) == (SFIO_SYNCED|SFIO_READ) ) { f->endb = f->next = f->endr = f->data; - f->mode &= ~SF_SYNCED; + f->mode &= ~SFIO_SYNCED; } #ifdef MAP_TYPE - if((f->bits&SF_MMAP) && f->data) + if((f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f, f->data, f->endb-f->data); f->data = NULL; } @@ -90,13 +90,13 @@ for(dosync = 0;;) { /* stream locked by sfsetfd() */ - if(!(f->flags&SF_STRING) && f->file < 0) + if(!(f->flags&SFIO_STRING) && f->file < 0) return 0; - f->flags &= ~(SF_EOF|SF_ERROR); + f->flags &= ~(SFIO_EOF|SFIO_ERROR); dc = disc; - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) { if((r = (f->data+f->extent) - f->next) < 0) r = 0; if(r <= 0) @@ -106,20 +106,20 @@ /* warn that a read is about to happen */ SFDISC(f,dc,readf); - if(dc && dc->exceptf && (f->flags&SF_IOCHECK) ) + if(dc && dc->exceptf && (f->flags&SFIO_IOCHECK) ) { int rv; if(local) SETLOCAL(f); - if((rv = _sfexcept(f,SF_READ,n,dc)) > 0) + if((rv = _sfexcept(f,SFIO_READ,n,dc)) > 0) n = rv; else if(rv < 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; return (ssize_t)rv; } } #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { ssize_t a, round; struct stat st; @@ -130,13 +130,13 @@ } /* actual seek location */ - if((f->flags&(SF_SHARE|SF_PUBLIC)) == (SF_SHARE|SF_PUBLIC) && + if((f->flags&(SFIO_SHARE|SFIO_PUBLIC)) == (SFIO_SHARE|SFIO_PUBLIC) && (r = SFSK(f,0,SEEK_CUR,dc)) != f->here) f->here = r; else f->here -= f->endb-f->next; /* before mapping, make sure we have data to map */ - if((f->flags&SF_SHARE) || (size_t)(r = f->extent-f->here) < n) + if((f->flags&SFIO_SHARE) || (size_t)(r = f->extent-f->here) < n) { if((r = fstat(f->file,&st)) < 0) goto do_except; if((r = (f->extent = st.st_size) - f->here) <= 0 ) @@ -167,14 +167,14 @@ break; else { f->data = NULL; - if((r >>= 1) < (_Sfpage*SF_NMAP) || + if((r >>= 1) < (_Sfpage*SFIO_NMAP) || (errno != EAGAIN && errno != ENOMEM) ) break; } } if(f->data) - { if(f->bits&SF_SEQUENTIAL) + { if(f->bits&SFIO_SEQUENTIAL) SFMMSEQON(f,f->data,r); f->next = f->data+a; f->endr = f->endb = f->data+r; @@ -202,7 +202,7 @@ (void)SFSK(f,f->here,SEEK_SET,dc); /* make a buffer */ - (void)SFSETBUF(f,f->tiny,(size_t)SF_UNBOUND); + (void)SFSETBUF(f,f->tiny,(size_t)SFIO_UNBOUND); if(!buf) { buf = f->data; @@ -219,8 +219,8 @@ } /* make sure file pointer is right */ - if(f->extent >= 0 && (f->flags&SF_SHARE) ) - { if(!(f->flags&SF_PUBLIC) ) + if(f->extent >= 0 && (f->flags&SFIO_SHARE) ) + { if(!(f->flags&SFIO_PUBLIC) ) f->here = SFSK(f,f->here,SEEK_SET,dc); else f->here = SFSK(f,0,SEEK_CUR,dc); } @@ -229,12 +229,12 @@ errno = 0; if(dc && dc->readf) - { int share = f->flags&SF_SHARE; + { int share = f->flags&SFIO_SHARE; if(rcrv) /* pass on rcrv for possible continuations */ f->mode |= rcrv; /* tell readf that no peeking necessary */ - else f->flags &= ~SF_SHARE; + else f->flags &= ~SFIO_SHARE; SFDCRD(f,buf,n,dc,r); @@ -245,15 +245,15 @@ } else if(SFISNULL(f)) r = 0; - else if(f->extent < 0 && (f->flags&SF_SHARE) && rcrv) + else if(f->extent < 0 && (f->flags&SFIO_SHARE) && rcrv) { /* try peek read */ r = sfpkrd(f->file, (char*)buf, n, - (rcrv&SF_RC) ? (int)f->getr : -1, - -1L, (rcrv&SF_RV) ? 1 : 0); + (rcrv&SFIO_RC) ? (int)f->getr : -1, + -1L, (rcrv&SFIO_RV) ? 1 : 0); if(r > 0) - { if(rcrv&SF_RV) - f->mode |= SF_PKRD; - else f->mode |= SF_RC; + { if(rcrv&SFIO_RV) + f->mode |= SFIO_PKRD; + else f->mode |= SFIO_RC; } } else r = read(f->file,buf,n); @@ -262,8 +262,8 @@ errno = oerrno; if(r > 0 ) - { if(!(f->bits&SF_DCDOWN) ) /* not a continuation call */ - { if(!(f->mode&SF_PKRD) ) + { if(!(f->bits&SFIO_DCDOWN) ) /* not a continuation call */ + { if(!(f->mode&SFIO_PKRD) ) { f->here += r; if(f->extent >= 0 && f->extent < f->here) f->extent = f->here; @@ -279,18 +279,18 @@ do_except: if(local) SETLOCAL(f); - switch(_sfexcept(f,SF_READ,(ssize_t)r,dc)) + switch(_sfexcept(f,SFIO_READ,(ssize_t)r,dc)) { - case SF_ECONT : + case SFIO_ECONT : goto do_continue; - case SF_EDONE : + case SFIO_EDONE : n = local ? 0 : (ssize_t)r; return n; - case SF_EDISC : - if(!local && !(f->flags&SF_STRING)) + case SFIO_EDISC : + if(!local && !(f->flags&SFIO_STRING)) goto do_continue; /* FALLTHROUGH */ - case SF_ESTACK : + case SFIO_ESTACK : return -1; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfread.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfread.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,30 +35,30 @@ return (ssize_t)(-1); GETLOCAL(f,local); - justseek = f->bits&SF_JUSTSEEK; f->bits &= ~SF_JUSTSEEK; + justseek = f->bits&SFIO_JUSTSEEK; f->bits &= ~SFIO_JUSTSEEK; if(!buf) return (ssize_t)(n == 0 ? 0 : -1) ; /* release peek lock */ - if(f->mode&SF_PEEK) - { if(!(f->mode&SF_READ) ) + if(f->mode&SFIO_PEEK) + { if(!(f->mode&SFIO_READ) ) return (ssize_t)(-1); - if(f->mode&SF_GETR) + if(f->mode&SFIO_GETR) { if(((uchar*)buf + f->val) != f->next && (!f->rsrv || f->rsrv->data != (uchar*)buf) ) return (ssize_t)(-1); - f->mode &= ~SF_PEEK; + f->mode &= ~SFIO_PEEK; return 0; } else { if((uchar*)buf != f->next) return (ssize_t)(-1); - f->mode &= ~SF_PEEK; - if(f->mode&SF_PKRD) + f->mode &= ~SFIO_PEEK; + if(f->mode&SFIO_PKRD) { /* actually read the data now */ - f->mode &= ~SF_PKRD; + f->mode &= ~SFIO_PKRD; if(n > 0) n = (r = read(f->file,f->data,n)) < 0 ? 0 : r; f->endb = f->data+n; @@ -71,9 +71,9 @@ } s = begs = (uchar*)buf; - for(;; f->mode &= ~SF_LOCK) + for(;; f->mode &= ~SFIO_LOCK) { /* check stream mode */ - if(SFMODE(f,local) != SF_READ && _sfmode(f,SF_READ,local) < 0) + if(SFMODE(f,local) != SFIO_READ && _sfmode(f,SFIO_READ,local) < 0) { n = s > begs ? s-begs : (size_t)(-1); return (ssize_t)n; } @@ -93,12 +93,12 @@ if(n <= 0) /* all done */ break; - if(!(f->flags&SF_STRING) && !(f->bits&SF_MMAP) ) + if(!(f->flags&SFIO_STRING) && !(f->bits&SFIO_MMAP) ) { f->next = f->endb = f->data; /* exact IO is desirable for these cases */ if(SFDIRECT(f,n) || - ((f->flags&SF_SHARE) && f->extent < 0) ) + ((f->flags&SFIO_SHARE) && f->extent < 0) ) r = (ssize_t)n; else if(justseek && n <= f->iosz && f->iosz <= f->size) r = f->iosz; /* limit buffering */ @@ -120,7 +120,7 @@ else { do_filbuf: if(justseek) - f->bits |= SF_JUSTSEEK; + f->bits |= SFIO_JUSTSEEK; if(SFFILBUF(f,-1) <= 0) break; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfreserve.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfreserve.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -37,14 +37,14 @@ sz = size < 0 ? -size : size; - /* see if we need to bias toward SF_WRITE instead of the default SF_READ */ + /* see if we need to bias toward SFIO_WRITE instead of the default SFIO_READ */ if(type < 0) mode = 0; - else if((mode = type&SF_WRITE) ) - type &= ~SF_WRITE; + else if((mode = type&SFIO_WRITE) ) + type &= ~SFIO_WRITE; /* return the last record */ - if(type == SF_LASTR ) + if(type == SFIO_LASTR ) { if((n = f->endb - f->next) > 0 && n == f->val ) { data = f->next; f->next += n; @@ -64,13 +64,13 @@ if(type > 0) { if(type == 1 ) /* upward compatibility mode */ - type = SF_LOCKR; - else if(type != SF_LOCKR) + type = SFIO_LOCKR; + else if(type != SFIO_LOCKR) return NULL; } - if(size == 0 && (type < 0 || type == SF_LOCKR) ) - { if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0) + if(size == 0 && (type < 0 || type == SFIO_LOCKR) ) + { if((f->mode&SFIO_RDWR) != f->mode && _sfmode(f,0,0) < 0) return NULL; SFLOCK(f,0); @@ -81,11 +81,11 @@ } /* iterate until get to a stream that has data or buffer space */ - for(local = 0;; local = SF_LOCAL) + for(local = 0;; local = SFIO_LOCAL) { _Sfi = f->val = -1; - if(!mode && !(mode = f->flags&SF_READ) ) - mode = SF_WRITE; + if(!mode && !(mode = f->flags&SFIO_READ) ) + mode = SFIO_WRITE; if((int)f->mode != mode && _sfmode(f,mode,local) < 0) { SFOPEN(f,0); return NULL; @@ -99,7 +99,7 @@ break; /* set amount to perform IO */ - if(size == 0 || (f->mode&SF_WRITE)) + if(size == 0 || (f->mode&SFIO_WRITE)) iosz = -1; else if(size < 0 && n == 0 && f->push) /* maybe stack-pop */ { if((iosz = f->push->endb - f->push->next) == 0) @@ -117,25 +117,25 @@ /* do a buffer refill or flush */ now = n; - if(f->mode&SF_WRITE) + if(f->mode&SFIO_WRITE) (void)SFFLSBUF(f, iosz); - else if(type == SF_LOCKR && f->extent < 0 && (f->flags&SF_SHARE) ) + else if(type == SFIO_LOCKR && f->extent < 0 && (f->flags&SFIO_SHARE) ) { if(n == 0) /* peek-read only if there is no buffered data */ - { f->mode |= SF_RV; + { f->mode |= SFIO_RV; (void)SFFILBUF(f, iosz ); } if((n = f->endb - f->next) < sz) - { if(f->mode&SF_PKRD) + { if(f->mode&SFIO_PKRD) { f->endb = f->endr = f->next; - f->mode &= ~SF_PKRD; + f->mode &= ~SFIO_PKRD; } break; } } else - { /* sfreserve(f,0,0) == sfread(f, sfreserve(f,-1,SF_LOCKR), 0) */ + { /* sfreserve(f,0,0) == sfread(f, sfreserve(f,-1,SFIO_LOCKR), 0) */ if(size == 0 && type == 0) - f->mode |= SF_RV; + f->mode |= SFIO_RV; (void)SFFILBUF(f, iosz ); } @@ -150,7 +150,7 @@ break; /* request was only to assess data availability */ - if(type == SF_LOCKR && size > 0 && n > 0 ) + if(type == SFIO_LOCKR && size > 0 && n > 0 ) break; } @@ -159,23 +159,23 @@ if(size == 0 || n == 0) { if(n > 0) /* got data */ data = f->next; - else if(type == SF_LOCKR && size == 0 && (rsrv = _sfrsrv(f,0)) ) + else if(type == SFIO_LOCKR && size == 0 && (rsrv = _sfrsrv(f,0)) ) data = rsrv->data; } else if(n >= sz) /* got data */ data = f->next; - else if(f->flags&SF_STRING) /* try extending string buffer */ - { if((f->mode&SF_WRITE) && (f->flags&SF_MALLOC) ) + else if(f->flags&SFIO_STRING) /* try extending string buffer */ + { if((f->mode&SFIO_WRITE) && (f->flags&SFIO_MALLOC) ) { (void)SFWR(f,f->next,sz,f->disc); if((n = f->endb - f->next) >= sz ) data = f->next; } } - else if(f->mode&SF_WRITE) /* allocate side buffer */ - { if(type == SF_LOCKR && (rsrv = _sfrsrv(f, sz)) ) + else if(f->mode&SFIO_WRITE) /* allocate side buffer */ + { if(type == SFIO_LOCKR && (rsrv = _sfrsrv(f, sz)) ) data = rsrv->data; } - else if(type != SF_LOCKR && sz > f->size && (rsrv = _sfrsrv(f,sz)) ) + else if(type != SFIO_LOCKR && sz > f->size && (rsrv = _sfrsrv(f,sz)) ) { if((n = SFREAD(f,rsrv->data,sz)) >= sz) /* read side buffer */ data = rsrv->data; else rsrv->slen = -n; @@ -184,10 +184,10 @@ SFOPEN(f,0); if(data) - { if(type == SF_LOCKR) - { f->mode |= SF_PEEK; - if((f->mode & SF_READ) && size == 0 && data != f->next) - f->mode |= SF_GETR; /* so sfread() will unlock */ + { if(type == SFIO_LOCKR) + { f->mode |= SFIO_PEEK; + if((f->mode & SFIO_READ) && size == 0 && data != f->next) + f->mode |= SFIO_GETR; /* so sfread() will unlock */ f->endr = f->endw = f->data; } else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfresize.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfresize.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -26,16 +26,16 @@ { if(size < 0 || f->extent < 0 || - !f || (f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0)) + !f || (f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0)) return -1; SFLOCK(f,0); - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) { SFSTRSIZE(f); if(f->extent >= size) - { if((f->flags&SF_MALLOC) && (f->next - f->data) <= size) + { if((f->flags&SFIO_MALLOC) && (f->next - f->data) <= size) { size_t s = (((size_t)size + 1023)/1024)*1024; void* d; if(s < f->size && (d = realloc(f->data, s)) )
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfscanf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfscanf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -42,9 +42,9 @@ /* make a fake stream */ SFCLEAR(&f); - f.flags = SF_STRING|SF_READ; - f.bits = SF_PRIVATE; - f.mode = SF_READ; + f.flags = SFIO_STRING|SFIO_READ; + f.bits = SFIO_PRIVATE; + f.mode = SFIO_READ; f.size = strlen((char*)s); f.data = f.next = f.endw = (uchar*)s; f.endb = f.endr = f.data+f.size;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfseek.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfseek.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -27,13 +27,13 @@ static void newpos(Sfio_t* f, Sfoff_t p) { #ifdef MAP_TYPE - if((f->bits&SF_MMAP) && f->data) + if((f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f, f->data, f->endb-f->data); f->data = NULL; } #endif f->next = f->endr = f->endw = f->data; - f->endb = (f->mode&SF_WRITE) ? f->data+f->size : f->data; + f->endb = (f->mode&SFIO_WRITE) ? f->data+f->size : f->data; if((f->here = p) < 0) { f->extent = -1; f->here = 0; @@ -52,29 +52,29 @@ GETLOCAL(f,local); - hardseek = (type|f->flags)&(SF_SHARE|SF_PUBLIC); + hardseek = (type|f->flags)&(SFIO_SHARE|SFIO_PUBLIC); - if(hardseek && f->mode == (SF_READ|SF_SYNCED) ) + if(hardseek && f->mode == (SFIO_READ|SFIO_SYNCED) ) { newpos(f,f->here); - f->mode = SF_READ; + f->mode = SFIO_READ; } /* set and initialize the stream to a definite mode */ - if((int)SFMODE(f,local) != (mode = f->mode&SF_RDWR)) + if((int)SFMODE(f,local) != (mode = f->mode&SFIO_RDWR)) { int flags = f->flags; - if(hardseek&SF_PUBLIC) /* seek ptr must follow file descriptor */ - f->flags |= SF_SHARE|SF_PUBLIC; + if(hardseek&SFIO_PUBLIC) /* seek ptr must follow file descriptor */ + f->flags |= SFIO_SHARE|SFIO_PUBLIC; mode = _sfmode(f,mode,local); - if(hardseek&SF_PUBLIC) + if(hardseek&SFIO_PUBLIC) f->flags = flags; if(mode < 0) return (Sfoff_t)(-1); } - mustsync = (type&SF_SHARE) && !(type&SF_PUBLIC) && - (f->mode&SF_READ) && !(f->flags&SF_STRING); + mustsync = (type&SFIO_SHARE) && !(type&SFIO_PUBLIC) && + (f->mode&SFIO_READ) && !(f->flags&SFIO_STRING); /* X/Open-compliant */ if((type &= (SEEK_SET|SEEK_CUR|SEEK_END)) != SEEK_SET && @@ -96,9 +96,9 @@ SFLOCK(f,local); /* clear error and eof bits */ - f->flags &= ~(SF_EOF|SF_ERROR); + f->flags &= ~(SFIO_EOF|SFIO_ERROR); - while(f->flags&SF_STRING) + while(f->flags&SFIO_STRING) { SFSTRSIZE(f); if(type == SEEK_CUR) @@ -121,15 +121,15 @@ { p = -1; goto done; } - else if(!(f->flags&SF_STRING)) + else if(!(f->flags&SFIO_STRING)) { p = r; goto done; } } - if(f->mode&SF_WRITE) + if(f->mode&SFIO_WRITE) { /* see if we can avoid flushing buffer */ - if(!hardseek && type < SEEK_END && !(f->flags&SF_APPENDWR) ) + if(!hardseek && type < SEEK_END && !(f->flags&SFIO_APPENDWR) ) { s = f->here + (f->next - f->data); r = p + (type == SEEK_SET ? 0 : s); if(r == s) @@ -144,8 +144,8 @@ } } - if(type == SEEK_END || (f->mode&SF_WRITE) ) - { if((hardseek&SF_PUBLIC) || type == SEEK_END) + if(type == SEEK_END || (f->mode&SFIO_WRITE) ) + { if((hardseek&SFIO_PUBLIC) || type == SEEK_END) p = SFSK(f, p, type, f->disc); else { r = p + (type == SEEK_CUR ? f->here : 0); @@ -163,7 +163,7 @@ if(r <= f->here && r >= (f->here - (f->endb-f->data)) ) { if((hardseek || (type == SEEK_CUR && p == 0)) ) { if((s = SFSK(f, 0, SEEK_CUR, f->disc)) == f->here || - (s >= 0 && !(hardseek&SF_PUBLIC) && + (s >= 0 && !(hardseek&SFIO_PUBLIC) && (s = SFSK(f, f->here, SEEK_SET, f->disc)) == f->here) ) goto near_done; else if(s < 0) @@ -188,11 +188,11 @@ goto done; #ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { /* if mmap is not great, stop mmapping if moving around too much */ #if _mmap_worthy < 2 if((f->next - f->data) < ((f->endb - f->data)/4) ) - { SFSETBUF(f,f->tiny,(size_t)SF_UNBOUND); + { SFSETBUF(f,f->tiny,(size_t)SFIO_UNBOUND); hardseek = 1; /* this forces a hard seek below */ } else @@ -229,7 +229,7 @@ /* seeking around and wasting data, be conservative */ if(f->iosz > 0 && (p > f->lpos || p < f->lpos-f->size) ) - f->bits |= SF_JUSTSEEK; + f->bits |= SFIO_JUSTSEEK; } if((hardseek || r != f->here) && (f->here = SFSK(f,r,SEEK_SET,f->disc)) != r)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfset.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfset.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -34,10 +34,10 @@ if(flags == 0 && set == 0) return f->flags&SFIO_FLAGS; - if((oflags = (f->mode&SF_RDWR)) != (int)f->mode) - { /* avoid sfsetbuf() isatty() call if user sets (SF_LINE|SF_WCWIDTH) */ - if(set && (flags & (SF_LINE|SF_WCWIDTH)) && !(f->flags & (SF_LINE|SF_WCWIDTH))) - { tflags = (SF_LINE|SF_WCWIDTH); + if((oflags = (f->mode&SFIO_RDWR)) != (int)f->mode) + { /* avoid sfsetbuf() isatty() call if user sets (SFIO_LINE|SFIO_WCWIDTH) */ + if(set && (flags & (SFIO_LINE|SFIO_WCWIDTH)) && !(f->flags & (SFIO_LINE|SFIO_WCWIDTH))) + { tflags = (SFIO_LINE|SFIO_WCWIDTH); f->flags |= tflags; } else tflags = 0; @@ -54,36 +54,36 @@ /* preserve at least one rd/wr flag */ oflags = f->flags; - if(!(f->bits&SF_BOTH) || (flags&SF_RDWR) == SF_RDWR ) - flags &= ~SF_RDWR; + if(!(f->bits&SFIO_BOTH) || (flags&SFIO_RDWR) == SFIO_RDWR ) + flags &= ~SFIO_RDWR; /* set the flag */ if(set) - f->flags |= (flags&SF_SETS); - else f->flags &= ~(flags&SF_SETS); + f->flags |= (flags&SFIO_SETS); + else f->flags &= ~(flags&SFIO_SETS); /* must have at least one of read/write */ - if(!(f->flags&SF_RDWR)) - f->flags |= (oflags&SF_RDWR); + if(!(f->flags&SFIO_RDWR)) + f->flags |= (oflags&SFIO_RDWR); if(f->extent < 0) - f->flags &= ~SF_APPENDWR; + f->flags &= ~SFIO_APPENDWR; /* turn to appropriate mode as necessary */ - if((flags &= SF_RDWR) ) + if((flags &= SFIO_RDWR) ) { if(!set) - { if(flags == SF_READ) - flags = SF_WRITE; - else flags = SF_READ; + { if(flags == SFIO_READ) + flags = SFIO_WRITE; + else flags = SFIO_READ; } - if((flags == SF_WRITE && !(f->mode&SF_WRITE)) || - (flags == SF_READ && !(f->mode&(SF_READ|SF_SYNCED))) ) + if((flags == SFIO_WRITE && !(f->mode&SFIO_WRITE)) || + (flags == SFIO_READ && !(f->mode&(SFIO_READ|SFIO_SYNCED))) ) (void)_sfmode(f,flags,1); } /* if not shared or unseekable, public means nothing */ - if(!(f->flags&SF_SHARE) || f->extent < 0) - f->flags &= ~SF_PUBLIC; + if(!(f->flags&SFIO_SHARE) || f->extent < 0) + f->flags &= ~SFIO_PUBLIC; SFOPEN(f,0); return oflags&SFIO_FLAGS;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfsetbuf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfsetbuf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -55,9 +55,9 @@ char* endw; static int modes = -1; - static const char sf_line = "SF_LINE"; - static const char sf_maxr = "SF_MAXR="; - static const char sf_wcwidth = "SF_WCWIDTH"; + static const char sf_line = "SFIO_LINE"; + static const char sf_maxr = "SFIO_MAXR="; + static const char sf_wcwidth = "SFIO_WCWIDTH"; #define ISSEPAR(c) ((c) == ',' || (c) == ' ' || (c) == '\t') if (modes < 0) @@ -70,13 +70,13 @@ ; if((endw-astsfio) > (sizeof(sf_line)-1) && strncmp(astsfio,sf_line,sizeof(sf_line)-1) == 0) - modes |= SF_LINE; + modes |= SFIO_LINE; else if((endw-astsfio) > (sizeof(sf_maxr)-1) && strncmp(astsfio,sf_maxr,sizeof(sf_maxr)-1) == 0) _Sfmaxr = (ssize_t)strtonll(astsfio+sizeof(sf_maxr)-1,NULL,NULL,0); else if((endw-astsfio) > (sizeof(sf_wcwidth)-1) && strncmp(astsfio,sf_wcwidth,sizeof(sf_wcwidth)-1) == 0) - modes |= SF_WCWIDTH; + modes |= SFIO_WCWIDTH; } } } @@ -89,13 +89,15 @@ void* buf, /* new buffer */ size_t size) /* buffer size, -1 for default size */ { - int sf_malloc, oflags, init, okmmap, local; + int sf_malloc, oflags, init, local; ssize_t bufsize, blksz; Sfdisc_t* disc; struct stat st; uchar* obuf = NULL; ssize_t osize = 0; - +#ifdef MAP_TYPE + int okmmap; +#endif if(!f) return NULL; @@ -104,31 +106,31 @@ if(size == 0 && buf) { /* special case to get buffer info */ - _Sfi = f->val = (f->bits&SF_MMAP) ? (f->endb-f->data) : f->size; + _Sfi = f->val = (f->bits&SFIO_MMAP) ? (f->endb-f->data) : f->size; return f->data; } /* cleanup actions already done, don't allow write buffering any more */ - if(_Sfexiting && !(f->flags&SF_STRING) && (f->mode&SF_WRITE)) + if(_Sfexiting && !(f->flags&SFIO_STRING) && (f->mode&SFIO_WRITE)) { buf = NULL; size = 0; } - if((init = f->mode&SF_INIT) ) + if((init = f->mode&SFIO_INIT) ) { if(!f->pool && _sfsetpool(f) < 0) return NULL; } - else if((f->mode&SF_RDWR) != SFMODE(f,local) && _sfmode(f,0,local) < 0) + else if((f->mode&SFIO_RDWR) != SFMODE(f,local) && _sfmode(f,0,local) < 0) return NULL; if(init) - f->mode = (f->mode&SF_RDWR)|SF_LOCK; + f->mode = (f->mode&SFIO_RDWR)|SFIO_LOCK; else { int rv; /* make sure there is no hidden read data */ - if(f->proc && (f->flags&SF_READ) && (f->mode&SF_WRITE) && - _sfmode(f,SF_READ,local) < 0) + if(f->proc && (f->flags&SFIO_READ) && (f->mode&SFIO_WRITE) && + _sfmode(f,SFIO_READ,local) < 0) return NULL; /* synchronize first */ @@ -136,8 +138,8 @@ if(rv < 0) return NULL; - /* turn off the SF_SYNCED bit because buffer is changing */ - f->mode &= ~SF_SYNCED; + /* turn off the SFIO_SYNCED bit because buffer is changing */ + f->mode &= ~SFIO_SYNCED; } SFLOCK(f,local); @@ -154,19 +156,19 @@ } else /* initialize stream as if in the default case */ { buf = NULL; - size = (size_t)SF_UNBOUND; + size = (size_t)SFIO_UNBOUND; } } bufsize = 0; oflags = f->flags; - /* see if memory mapping is possible (see sfwrite for SF_BOTH) */ - okmmap = (buf || (f->flags&SF_STRING) || (f->flags&SF_RDWR) == SF_RDWR) ? 0 : 1; +#ifdef MAP_TYPE + /* see if memory mapping is possible (see sfwrite for SFIO_BOTH) */ + okmmap = (buf || (f->flags&SFIO_STRING) || (f->flags&SFIO_RDWR) == SFIO_RDWR) ? 0 : 1; /* save old buffer info */ -#ifdef MAP_TYPE - if(f->bits&SF_MMAP) + if(f->bits&SFIO_MMAP) { if(f->data) { SFMUNMAP(f,f->data,f->endb-f->data); f->data = NULL; @@ -180,12 +182,12 @@ obuf = f->data; osize = f->size; - f->flags &= ~SF_MALLOC; - f->bits &= ~SF_MMAP; + f->flags &= ~SFIO_MALLOC; + f->bits &= ~SFIO_MMAP; /* pure read/string streams must have a valid string */ - if((f->flags&(SF_RDWR|SF_STRING)) == SF_RDSTR && - (size == (size_t)SF_UNBOUND || !buf)) + if((f->flags&(SFIO_RDWR|SFIO_STRING)) == SFIO_RDSTR && + (size == (size_t)SFIO_UNBOUND || !buf)) size = 0; /* set disc to the first discipline with a seekf */ @@ -193,7 +195,7 @@ if(disc->seekf) break; - if((init || local) && !(f->flags&SF_STRING)) + if((init || local) && !(f->flags&SFIO_STRING)) { /* ASSERT(f->file >= 0) */ st.st_mode = 0; @@ -219,17 +221,21 @@ f->blksz = (size_t)st.st_blksize; #endif bufsize = 64 * 1024; - if(S_ISDIR(st.st_mode) || (Sfoff_t)st.st_size < (Sfoff_t)SF_GRAIN) +#ifdef MAP_TYPE + if(S_ISDIR(st.st_mode) || (Sfoff_t)st.st_size < (Sfoff_t)SFIO_GRAIN) okmmap = 0; +#endif if(S_ISREG(st.st_mode) || S_ISDIR(st.st_mode)) f->here = SFSK(f,0,SEEK_CUR,f->disc); else f->here = -1; +#ifdef MAP_TYPE #if O_TEXT /* no memory mapping with O_TEXT because read()/write() alter data stream */ if(okmmap && f->here >= 0 && (fcntl((int)f->file,F_GETFL,0) & O_TEXT) ) okmmap = 0; #endif +#endif } /* set page size, this is also the desired default buffer size */ @@ -238,7 +244,7 @@ #if _lib_getpagesize if((_Sfpage = (size_t)getpagesize()) <= 0) #endif - _Sfpage = SF_PAGE; + _Sfpage = SFIO_PAGE; } #if SFSETLINEMODE @@ -251,7 +257,7 @@ /* seekable std-devices are share-public by default */ if(f == sfstdin || f == sfstdout || f == sfstderr) - f->flags |= SF_SHARE|SF_PUBLIC; + f->flags |= SFIO_SHARE|SFIO_PUBLIC; } else { @@ -263,11 +269,11 @@ { if(S_ISCHR(st.st_mode) ) { int oerrno = errno; - bufsize = SF_GRAIN; + bufsize = SFIO_GRAIN; /* set line mode for terminals */ - if(!(f->flags&(SF_LINE|SF_WCWIDTH)) && isatty(f->file)) - f->flags |= SF_LINE|SF_WCWIDTH; + if(!(f->flags&(SFIO_LINE|SFIO_WCWIDTH)) && isatty(f->file)) + f->flags |= SFIO_LINE|SFIO_WCWIDTH; #if _sys_stat else /* special case /dev/null */ { int dev, ino; @@ -291,25 +297,25 @@ } /* initialize side buffer for r+w unseekable streams */ - if(!f->proc && (f->bits&SF_BOTH) ) + if(!f->proc && (f->bits&SFIO_BOTH) ) (void)_sfpopen(f,-1,-1,1); } } } #ifdef MAP_TYPE - if(okmmap && size && (f->mode&SF_READ) && f->extent >= 0 ) + if(okmmap && size && (f->mode&SFIO_READ) && f->extent >= 0 ) { /* see if we can try memory mapping */ if(!disc) for(disc = f->disc; disc; disc = disc->disc) if(disc->readf) break; if(!disc) - { f->bits |= SF_MMAP; - if(size == (size_t)SF_UNBOUND) + { f->bits |= SFIO_MMAP; + if(size == (size_t)SFIO_UNBOUND) { if(bufsize > _Sfpage) - size = bufsize * SF_NMAP; - else size = _Sfpage * SF_NMAP; + size = bufsize * SFIO_NMAP; + else size = _Sfpage * SFIO_NMAP; if(size > 256*1024) size = 256*1024; } @@ -319,17 +325,17 @@ /* get buffer space */ setbuf: - if(size == (size_t)SF_UNBOUND) + if(size == (size_t)SFIO_UNBOUND) { /* define a default size suitable for block transfer */ if(init && osize > 0) size = osize; - else if(f == sfstderr && (f->mode&SF_WRITE)) + else if(f == sfstderr && (f->mode&SFIO_WRITE)) size = 0; - else if(f->flags&SF_STRING ) - size = SF_GRAIN; - else if((f->flags&SF_READ) && !(f->bits&SF_BOTH) && + else if(f->flags&SFIO_STRING ) + size = SFIO_GRAIN; + else if((f->flags&SFIO_READ) && !(f->bits&SFIO_BOTH) && f->extent > 0 && f->extent < (Sfoff_t)_Sfpage ) - size = (((size_t)f->extent + SF_GRAIN-1)/SF_GRAIN)*SF_GRAIN; + size = (((size_t)f->extent + SFIO_GRAIN-1)/SFIO_GRAIN)*SFIO_GRAIN; else if((ssize_t)(size = _Sfpage) < bufsize) size = bufsize; @@ -337,12 +343,12 @@ } sf_malloc = 0; - if(size > 0 && !buf && !(f->bits&SF_MMAP)) + if(size > 0 && !buf && !(f->bits&SFIO_MMAP)) { /* try to allocate a buffer */ if(obuf && size == (size_t)osize && init) { buf = obuf; obuf = NULL; - sf_malloc = (oflags&SF_MALLOC); + sf_malloc = (oflags&SFIO_MALLOC); } if(!buf) { /* do allocation */ @@ -352,11 +358,11 @@ else size /= 2; } if(size > 0) - sf_malloc = SF_MALLOC; + sf_malloc = SFIO_MALLOC; } } - if(size == 0 && !(f->flags&SF_STRING) && !(f->bits&SF_MMAP) && (f->mode&SF_READ)) + if(size == 0 && !(f->flags&SFIO_STRING) && !(f->bits&SFIO_MMAP) && (f->mode&SFIO_READ)) { /* use the internal buffer */ size = sizeof(f->tiny); buf = f->tiny; @@ -365,21 +371,21 @@ /* set up new buffer */ f->size = size; f->next = f->data = f->endr = f->endw = (uchar*)buf; - f->endb = (f->mode&SF_READ) ? f->data : f->data+size; - if(f->flags&SF_STRING) + f->endb = (f->mode&SFIO_READ) ? f->data : f->data+size; + if(f->flags&SFIO_STRING) { /* these fields are used to test actual size - see sfseek() */ f->extent = (!sf_malloc && - ((f->flags&SF_READ) || (f->bits&SF_BOTH)) ) ? size : 0; + ((f->flags&SFIO_READ) || (f->bits&SFIO_BOTH)) ) ? size : 0; f->here = 0; /* read+string stream should have all data available */ - if((f->mode&SF_READ) && !sf_malloc) + if((f->mode&SFIO_READ) && !sf_malloc) f->endb = f->data+size; } - f->flags = (f->flags & ~SF_MALLOC)|sf_malloc; + f->flags = (f->flags & ~SFIO_MALLOC)|sf_malloc; - if(obuf && obuf != f->data && osize > 0 && (oflags&SF_MALLOC)) + if(obuf && obuf != f->data && osize > 0 && (oflags&SFIO_MALLOC)) { free(obuf); obuf = NULL; } @@ -393,7 +399,7 @@ ** blksz should also be a power-of-2 for optimal disk seeks. */ if(blksz <= 0 || (blksz & (blksz-1)) != 0 ) - blksz = SF_GRAIN; + blksz = SFIO_GRAIN; while(blksz > f->size/2) blksz /= 2; f->blksz = blksz;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfsetfd.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfsetfd.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -53,17 +53,17 @@ if(!f) return -1; - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) return -1; - if((f->mode&SF_INIT) && f->file < 0) + if((f->mode&SFIO_INIT) && f->file < 0) { /* restoring file descriptor after a previous freeze */ if(newfd < 0) return -1; } else { /* change file descriptor */ - if((f->mode&SF_RDWR) != f->mode && _sfmode(f,0,0) < 0) + if((f->mode&SFIO_RDWR) != f->mode && _sfmode(f,0,0) < 0) return -1; SFLOCK(f,0); @@ -78,23 +78,23 @@ } else { /* sync stream if necessary */ - if(((f->mode&SF_WRITE) && f->next > f->data) || - (f->mode&SF_READ) || f->disc == _Sfudisc) + if(((f->mode&SFIO_WRITE) && f->next > f->data) || + (f->mode&SFIO_READ) || f->disc == _Sfudisc) { if(SFSYNC(f) < 0) { SFOPEN(f,0); return -1; } } - if(((f->mode&SF_WRITE) && f->next > f->data) || - ((f->mode&SF_READ) && f->extent < 0 && + if(((f->mode&SFIO_WRITE) && f->next > f->data) || + ((f->mode&SFIO_READ) && f->extent < 0 && f->next < f->endb) ) { SFOPEN(f,0); return -1; } #ifdef MAP_TYPE - if((f->bits&SF_MMAP) && f->data) + if((f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f,f->data,f->endb-f->data); f->data = NULL; } @@ -103,8 +103,8 @@ /* make stream appears uninitialized */ f->endb = f->endr = f->endw = f->data; f->extent = f->here = 0; - f->mode = (f->mode&SF_RDWR)|SF_INIT; - f->bits &= ~SF_NULL; /* off /dev/null handling */ + f->mode = (f->mode&SFIO_RDWR)|SFIO_INIT; + f->bits &= ~SFIO_NULL; /* off /dev/null handling */ } } @@ -113,7 +113,7 @@ /* notify changes */ if(_Sfnotify) - (*_Sfnotify)(f, SF_SETFD, (void*)((long)newfd)); + (*_Sfnotify)(f, SFIO_SETFD, (void*)((long)newfd)); f->file = newfd;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfsize.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfsize.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -28,10 +28,10 @@ int mode; Sfoff_t s; - if(!f || ((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)) + if(!f || ((mode = f->mode&SFIO_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)) return (Sfoff_t)(-1); - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) { SFSTRSIZE(f); return f->extent; } @@ -41,7 +41,7 @@ s = f->here; if(f->extent >= 0) - { if(f->flags&(SF_SHARE|SF_APPENDWR)) + { if(f->flags&(SFIO_SHARE|SFIO_APPENDWR)) { for(disc = f->disc; disc; disc = disc->disc) if(disc->seekf) break; @@ -63,14 +63,14 @@ #endif } - if((f->flags&(SF_SHARE|SF_PUBLIC)) == (SF_SHARE|SF_PUBLIC)) + if((f->flags&(SFIO_SHARE|SFIO_PUBLIC)) == (SFIO_SHARE|SFIO_PUBLIC)) f->here = SFSK(f,0,SEEK_CUR,f->disc); } - if(f->here != s && (f->mode&SF_READ) ) + if(f->here != s && (f->mode&SFIO_READ) ) { /* buffered data is known to be invalid */ #ifdef MAP_TYPE - if((f->bits&SF_MMAP) && f->data) + if((f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f,f->data,f->endb-f->data); f->data = NULL; } @@ -84,9 +84,9 @@ f->extent = f->here; if((s = f->extent) >= 0) - { if(f->flags&SF_APPENDWR) + { if(f->flags&SFIO_APPENDWR) s += (f->next - f->data); - else if(f->mode&SF_WRITE) + else if(f->mode&SFIO_WRITE) { s = f->here + (f->next - f->data); if(s < f->extent) s = f->extent;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfsk.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfsk.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -33,13 +33,13 @@ return (Sfoff_t)(-1); GETLOCAL(f,local); - if(!local && !(f->bits&SF_DCDOWN)) - { if((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0) + if(!local && !(f->bits&SFIO_DCDOWN)) + { if((mode = f->mode&SFIO_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0) return (Sfoff_t)(-1); if(SFSYNC(f) < 0) return (Sfoff_t)(-1); #ifdef MAP_TYPE - if(f->mode == SF_READ && (f->bits&SF_MMAP) && f->data) + if(f->mode == SFIO_READ && (f->bits&SFIO_MMAP) && f->data) { SFMUNMAP(f, f->data, f->endb-f->data); f->data = NULL; } @@ -52,7 +52,7 @@ for(;;) { dc = disc; - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) { SFSTRSIZE(f); if(type == SEEK_SET) s = (ssize_t)addr; @@ -75,11 +75,11 @@ if(local) SETLOCAL(f); - switch(_sfexcept(f,SF_SEEK,s,dc)) + switch(_sfexcept(f,SFIO_SEEK,s,dc)) { - case SF_EDISC: - case SF_ECONT: - if(f->flags&SF_STRING) + case SFIO_EDISC: + case SFIO_ECONT: + if(f->flags&SFIO_STRING) return (Sfoff_t)s; goto do_continue; default:
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfstack.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfstack.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -31,9 +31,9 @@ Sfio_t* rf; Sfrsrv_t* rsrv; - if(f1 && (f1->mode&SF_RDWR) != f1->mode && _sfmode(f1,0,0) < 0) + if(f1 && (f1->mode&SFIO_RDWR) != f1->mode && _sfmode(f1,0,0) < 0) return NULL; - if(f2 && (f2->mode&SF_RDWR) != f2->mode && _sfmode(f2,0,0) < 0) + if(f2 && (f2->mode&SFIO_RDWR) != f2->mode && _sfmode(f2,0,0) < 0) return NULL; if(!f1) return f2; @@ -41,10 +41,10 @@ /* give access to other internal functions */ _Sfstack = sfstack; - if(f2 == SF_POPSTACK) + if(f2 == SFIO_POPSTACK) { if(!(f2 = f1->push)) return NULL; - f2->mode &= ~SF_PUSH; + f2->mode &= ~SFIO_PUSH; } else { if(f2->push) @@ -75,13 +75,13 @@ if(f2->push != f2) { /* freeze the pushed stream */ - f2->mode |= SF_PUSH; + f2->mode |= SFIO_PUSH; f1->push = f2; rf = f1; } else { /* unfreeze the just exposed stream */ - f1->mode &= ~SF_PUSH; + f1->mode &= ~SFIO_PUSH; f2->push = NULL; rf = f2; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfswap.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfswap.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,7 +22,7 @@ /* Swap two streams. If the second argument is NULL, ** a new stream will be created. Always return the second argument ** or the new stream. Note that this function will always work -** unless streams are locked by SF_PUSH. +** unless streams are locked by SFIO_PUSH. ** ** Written by Kiem-Phong Vo. */ @@ -33,27 +33,27 @@ int f1pool, f2pool, f1flags, f2flags; unsigned int f1mode, f2mode; - if(!f1 || (f1->mode&SF_AVAIL) || (SFFROZEN(f1) && (f1->mode&SF_PUSH)) ) + if(!f1 || (f1->mode&SFIO_AVAIL) || (SFFROZEN(f1) && (f1->mode&SFIO_PUSH)) ) return NULL; - if(f2 && SFFROZEN(f2) && (f2->mode&SF_PUSH) ) + if(f2 && SFFROZEN(f2) && (f2->mode&SFIO_PUSH) ) return NULL; if(f1 == f2) return f2; f1mode = f1->mode; SFLOCK(f1,0); - f1->mode |= SF_PUSH; /* make sure there is no recursion on f1 */ + f1->mode |= SFIO_PUSH; /* make sure there is no recursion on f1 */ if(f2) { f2mode = f2->mode; SFLOCK(f2,0); - f2->mode |= SF_PUSH; /* make sure there is no recursion on f2 */ + f2->mode |= SFIO_PUSH; /* make sure there is no recursion on f2 */ } else { f2 = f1->file == 0 ? sfstdin : f1->file == 1 ? sfstdout : f1->file == 2 ? sfstderr : NULL; - if((!f2 || !(f2->mode&SF_AVAIL)) ) + if((!f2 || !(f2->mode&SFIO_AVAIL)) ) { if(!(f2 = (Sfio_t*)malloc(sizeof(Sfio_t))) ) { f1->mode = f1mode; SFOPEN(f1,0); @@ -62,8 +62,8 @@ SFCLEAR(f2); } - f2->mode = SF_AVAIL|SF_LOCK; - f2mode = SF_AVAIL; + f2->mode = SFIO_AVAIL|SFIO_LOCK; + f2mode = SFIO_AVAIL; } if(!f1->pool) @@ -89,16 +89,16 @@ if(f1pool >= 0) f2->pool->sff1pool = f2; - if(f2flags&SF_STATIC) - f2->flags |= SF_STATIC; - else f2->flags &= ~SF_STATIC; + if(f2flags&SFIO_STATIC) + f2->flags |= SFIO_STATIC; + else f2->flags &= ~SFIO_STATIC; - if(f1flags&SF_STATIC) - f1->flags |= SF_STATIC; - else f1->flags &= ~SF_STATIC; + if(f1flags&SFIO_STATIC) + f1->flags |= SFIO_STATIC; + else f1->flags &= ~SFIO_STATIC; - if(f2mode&SF_AVAIL) /* swapping to a closed stream */ - { if(!(f1->flags&SF_STATIC) ) + if(f2mode&SFIO_AVAIL) /* swapping to a closed stream */ + { if(!(f1->flags&SFIO_STATIC) ) free(f1); } else
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfsync.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfsync.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -46,16 +46,16 @@ { count += 1; f = p->sfn; - if(f->flags&SF_STRING ) + if(f->flags&SFIO_STRING ) goto did_sync; if(SFFROZEN(f)) continue; - if((f->mode&SF_READ) && (f->mode&SF_SYNCED) ) + if((f->mode&SFIO_READ) && (f->mode&SFIO_SYNCED) ) goto did_sync; - if((f->mode&SF_READ) && !(f->bits&SF_MMAP) && + if((f->mode&SFIO_READ) && !(f->bits&SFIO_MMAP) && f->next == f->endb) goto did_sync; - if((f->mode&SF_WRITE) && !(f->bits&SF_HOLE) && + if((f->mode&SFIO_WRITE) && !(f->bits&SFIO_HOLE) && f->next == f->data) goto did_sync; @@ -90,11 +90,11 @@ rv = 0; - lock = origf->mode&SF_LOCK; - if(origf->mode == (SF_SYNCED|SF_READ) ) /* already synced */ + lock = origf->mode&SFIO_LOCK; + if(origf->mode == (SFIO_SYNCED|SFIO_READ) ) /* already synced */ goto done; - if((origf->mode&SF_RDWR) != SFMODE(origf,local) && _sfmode(origf,0,local) < 0) + if((origf->mode&SFIO_RDWR) != SFMODE(origf,local) && _sfmode(origf,0,local) < 0) { rv = -1; goto done; } @@ -103,46 +103,46 @@ { unsigned int mode; - if((f->flags&SF_IOCHECK) && f->disc && f->disc->exceptf) - (void)(*f->disc->exceptf)(f,SF_SYNC,(void*)((int)1),f->disc); + if((f->flags&SFIO_IOCHECK) && f->disc && f->disc->exceptf) + (void)(*f->disc->exceptf)(f,SFIO_SYNC,(void*)((int)1),f->disc); SFLOCK(f,local); /* pretend that this stream is not on a stack */ - mode = f->mode&SF_PUSH; - f->mode &= ~SF_PUSH; + mode = f->mode&SFIO_PUSH; + f->mode &= ~SFIO_PUSH; /* these streams do not need synchronization */ - if((f->flags&SF_STRING) || (f->mode&SF_SYNCED)) + if((f->flags&SFIO_STRING) || (f->mode&SFIO_SYNCED)) goto next; - if((f->mode&SF_WRITE) && (f->next > f->data || (f->bits&SF_HOLE)) ) + if((f->mode&SFIO_WRITE) && (f->next > f->data || (f->bits&SFIO_HOLE)) ) { /* sync the buffer, make sure pool doesn't move */ - unsigned int pool = f->mode&SF_POOL; - f->mode &= ~SF_POOL; + unsigned int pool = f->mode&SFIO_POOL; + f->mode &= ~SFIO_POOL; if(f->next > f->data && (SFWRALL(f), SFFLSBUF(f,-1)) < 0) rv = -1; - if(!SFISNULL(f) && (f->bits&SF_HOLE) ) + if(!SFISNULL(f) && (f->bits&SFIO_HOLE) ) { /* realize a previously created hole of 0's */ if(SFSK(f,(Sfoff_t)(-1),SEEK_CUR,f->disc) >= 0) (void)SFWR(f,"",1,f->disc); - f->bits &= ~SF_HOLE; + f->bits &= ~SFIO_HOLE; } f->mode |= pool; } - if((f->mode&SF_READ) && f->extent >= 0 && - ((f->bits&SF_MMAP) || f->next < f->endb) ) + if((f->mode&SFIO_READ) && f->extent >= 0 && + ((f->bits&SFIO_MMAP) || f->next < f->endb) ) { /* make sure the file pointer is at the right place */ f->here -= (f->endb-f->next); f->endr = f->endw = f->data; - f->mode = SF_READ|SF_SYNCED|lock; + f->mode = SFIO_READ|SFIO_SYNCED|lock; (void)SFSK(f,f->here,SEEK_SET,f->disc); - if((f->flags&SF_SHARE) && !(f->flags&SF_PUBLIC) && - !(f->bits&SF_MMAP) ) + if((f->flags&SFIO_SHARE) && !(f->flags&SFIO_PUBLIC) && + !(f->bits&SFIO_MMAP) ) { f->endb = f->next = f->data; - f->mode &= ~SF_SYNCED; + f->mode &= ~SFIO_SYNCED; } } @@ -150,12 +150,12 @@ f->mode |= mode; SFOPEN(f,local); - if((f->flags&SF_IOCHECK) && f->disc && f->disc->exceptf) - (void)(*f->disc->exceptf)(f,SF_SYNC,(void*)((int)0),f->disc); + if((f->flags&SFIO_IOCHECK) && f->disc && f->disc->exceptf) + (void)(*f->disc->exceptf)(f,SFIO_SYNC,(void*)((int)0),f->disc); } done: - if(!local && f && (f->mode&SF_POOL) && f->pool && f != f->pool->sf0) + if(!local && f && (f->mode&SFIO_POOL) && f->pool && f != f->pool->sf0) SFSYNC(f->pool->sf0); return rv;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sftable.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sftable.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -43,10 +43,10 @@ int v, n, skip, dollar, decimal, thousand; Sffmt_t savft; Fmtpos_t* fp; /* position array of arguments */ - int argp, argn, maxp, needFP_INDEX; + int argp, maxp, needFP_INDEX; int nargs; /* the argv index of the last seen sequential % format (% or *) */ int xargs; /* highest (max) argv index see in an indexed format (%x$ *x$) */ - int nextarg; + int nextarg = 0; SFMBDCL(fmbs) if(type < 0) @@ -54,7 +54,7 @@ else if(!(fp = sffmtpos(f,form,args,ft,-1)) ) return NULL; - dollar = decimal = thousand = 0; argn = maxp = -1; + dollar = decimal = thousand = 0; nargs = xargs = -1; SFMBCLR(&fmbs); while((n = *form) ) @@ -482,9 +482,9 @@ static int sfcvinit(void) { int d, l; - for(d = 0; d <= SF_MAXCHAR; ++d) - { _Sfcv36d = SF_RADIX; - _Sfcv64d = SF_RADIX; + for(d = 0; d <= SFIO_MAXCHAR; ++d) + { _Sfcv36d = SFIO_RADIX; + _Sfcv64d = SFIO_RADIX; } /* 0-9 */ @@ -506,7 +506,7 @@ } /* remaining digits */ - for(; d < SF_RADIX; ++d) + for(; d < SFIO_RADIX; ++d) { _Sfcv36(uchar)_Sfdigitsd = d; _Sfcv64(uchar)_Sfdigitsd = d; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sftell.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sftell.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -29,20 +29,20 @@ Sfoff_t p; /* set the stream to the right mode */ - if(!f || ((mode = f->mode&SF_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)) + if(!f || ((mode = f->mode&SFIO_RDWR) != (int)f->mode && _sfmode(f,mode,0) < 0)) return (Sfoff_t)(-1); /* throw away ungetc data */ if(f->disc == _Sfudisc) (void)sfclose((*_Sfstack)(f,NULL)); - if(f->flags&SF_STRING) + if(f->flags&SFIO_STRING) return (Sfoff_t)(f->next-f->data); /* let sfseek() handle the hard case */ - if(f->extent >= 0 && (f->flags&(SF_SHARE|SF_APPENDWR)) ) + if(f->extent >= 0 && (f->flags&(SFIO_SHARE|SFIO_APPENDWR)) ) p = sfseek(f,0,SEEK_CUR); - else p = f->here + ((f->mode&SF_WRITE) ? f->next-f->data : f->next-f->endb); + else p = f->here + ((f->mode&SFIO_WRITE) ? f->next-f->data : f->next-f->endb); return p; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sftmp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sftmp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -62,10 +62,10 @@ NOT_USED(val); - if(type == SF_DPOP) /* don't allow this to pop */ + if(type == SFIO_DPOP) /* don't allow this to pop */ return -1; - if(type == SF_CLOSING) + if(type == SFIO_CLOSING) { for(last = NULL, ff = File; ff; last = ff, ff = ff->next) if(ff->f == f) @@ -76,7 +76,7 @@ else last->next = ff->next; if(_Sfnotify) - (*_Sfnotify)(f,SF_CLOSING,f->file); + (*_Sfnotify)(f,SFIO_CLOSING,f->file); CLOSE(f->file); f->file = -1; while(remove(ff->name) < 0 && errno == EINTR) @@ -94,7 +94,7 @@ for(ff = File; ff; ff = next) { next = ff->next; - _tmprmfile(ff->f, SF_CLOSING, NULL, ff->f->disc); + _tmprmfile(ff->f, SFIO_CLOSING, NULL, ff->f->disc); } } @@ -165,14 +165,14 @@ NOT_USED(val); /* the discipline needs to change only under the following exceptions */ - if(type != SF_WRITE && type != SF_SEEK && - type != SF_DPUSH && type != SF_DPOP && type != SF_DBUFFER) + if(type != SFIO_WRITE && type != SFIO_SEEK && + type != SFIO_DPUSH && type != SFIO_DPOP && type != SFIO_DBUFFER) return 0; /* try to create the temp file */ SFCLEAR(&newf); - newf.flags = SF_STATIC; - newf.mode = SF_AVAIL; + newf.flags = SFIO_STATIC; + newf.mode = SFIO_AVAIL; if((fd = _tmpfd(f)) < 0 ) return -1; @@ -180,15 +180,15 @@ /* make sure that the notify function won't be called here since we are only interested in creating the file, not the stream */ _Sfnotify = 0; - sf = sfnew(&newf,NULL,(size_t)SF_UNBOUND,fd,SF_READ|SF_WRITE); + sf = sfnew(&newf,NULL,(size_t)SFIO_UNBOUND,fd,SFIO_READ|SFIO_WRITE); _Sfnotify = notify; if(!sf) return -1; /* make sure that new stream has the same mode */ - if((m = f->flags&(SF_READ|SF_WRITE)) != (SF_READ|SF_WRITE)) - sfset(sf, ((~m)&(SF_READ|SF_WRITE)), 0); - sfset(sf, (f->mode&(SF_READ|SF_WRITE)), 1); + if((m = f->flags&(SFIO_READ|SFIO_WRITE)) != (SFIO_READ|SFIO_WRITE)) + sfset(sf, ((~m)&(SFIO_READ|SFIO_WRITE)), 0); + sfset(sf, (f->mode&(SFIO_READ|SFIO_WRITE)), 1); /* now remake the old stream into the new image */ memcpy(&savf, f, sizeof(Sfio_t)); @@ -199,25 +199,25 @@ f->proc = savf.proc; f->stdio = savf.stdio; - /* remove the SF_STATIC bit if it was only set above in making newf */ - if(!(savf.flags&SF_STATIC) ) - f->flags &= ~SF_STATIC; + /* remove the SFIO_STATIC bit if it was only set above in making newf */ + if(!(savf.flags&SFIO_STATIC) ) + f->flags &= ~SFIO_STATIC; if(savf.data) { SFSTRSIZE(&savf); - if(!(savf.flags&SF_MALLOC) ) + if(!(savf.flags&SFIO_MALLOC) ) (void)sfsetbuf(f,savf.data,savf.size); if(savf.extent > 0) (void)sfwrite(f,savf.data,(size_t)savf.extent); (void)sfseek(f,(Sfoff_t)(savf.next - savf.data),SEEK_SET); - if((savf.flags&SF_MALLOC) ) + if((savf.flags&SFIO_MALLOC) ) free(savf.data); } /* announce change of status */ f->disc = NULL; if(_Sfnotify) - (*_Sfnotify)(f, SF_SETFD, (void*)((long)f->file)); + (*_Sfnotify)(f, SFIO_SETFD, (void*)((long)f->file)); /* erase all traces of newf */ newf.data = newf.endb = newf.endr = newf.endw = NULL; @@ -245,17 +245,17 @@ /* start with a memory resident stream */ _Sfnotify = 0; /* local computation so no notification */ - f = sfnew(NULL,NULL,s,-1,SF_STRING|SF_READ|SF_WRITE); + f = sfnew(NULL,NULL,s,-1,SFIO_STRING|SFIO_READ|SFIO_WRITE); _Sfnotify = notify; if(!f) return NULL; - if(s != (size_t)SF_UNBOUND) /* set up a discipline for out-of-bound, etc. */ + if(s != (size_t)SFIO_UNBOUND) /* set up a discipline for out-of-bound, etc. */ f->disc = &Tmpdisc; if(s == 0) /* make the file now */ { _Sfnotify = 0; /* local computation so no notification */ - rv = _tmpexcept(f,SF_DPOP,NULL,f->disc); + rv = _tmpexcept(f,SFIO_DPOP,NULL,f->disc); _Sfnotify = notify; if(rv < 0) { sfclose(f); @@ -264,7 +264,7 @@ } if(_Sfnotify) - (*_Sfnotify)(f, SF_NEW, (void*)((long)f->file)); + (*_Sfnotify)(f, SFIO_NEW, (void*)((long)f->file)); return f; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfungetc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfungetc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -19,7 +19,7 @@ ***********************************************************************/ #include "sfhdr.h" -/* Push back one byte to a given SF_READ stream +/* Push back one byte to a given SFIO_READ stream ** ** Written by Kiem-Phong Vo. */ @@ -32,7 +32,7 @@ return -1; /* close the unget stream */ - if(type != SF_CLOSING) + if(type != SFIO_CLOSING) (void)sfclose((*_Sfstack)(f,NULL)); return 1; @@ -43,7 +43,7 @@ { Sfio_t* uf; - if(!f || c < 0 || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || c < 0 || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return -1; SFLOCK(f,0); @@ -55,8 +55,8 @@ /* make a string stream for unget characters */ if(f->disc != _Sfudisc) - { if(!(uf = sfnew(NULL,NULL,(size_t)SF_UNBOUND, - -1,SF_STRING|SF_READ))) + { if(!(uf = sfnew(NULL,NULL,(size_t)SFIO_UNBOUND, + -1,SFIO_STRING|SFIO_READ))) { c = -1; goto done; } @@ -74,7 +74,7 @@ { c = -1; goto done; } - f->flags |= SF_MALLOC; + f->flags |= SFIO_MALLOC; if(f->data) memcpy((char*)(data+16),(char*)f->data,f->size); f->size += 16;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfvprintf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfvprintf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -102,7 +102,7 @@ int xargs; /* highest (max) argv index see in an indexed format (%x$ *x$) */ #define SLACK 1024 - char bufSF_MAXDIGITS+SLACK, tmpSF_MAXDIGITS+1, dataSF_GRAIN; + char bufSFIO_MAXDIGITS+SLACK, tmpSFIO_MAXDIGITS+1, dataSFIO_GRAIN; int decimal = 0, thousand = 0; #if _has_multibyte @@ -154,12 +154,12 @@ return -1; /* make sure stream is in write mode and buffer is not NULL */ - if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0) + if(f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0) return -1; SFLOCK(f,0); - if(!f->data && !(f->flags&SF_STRING)) + if(!f->data && !(f->flags&SFIO_STRING)) { f->data = f->next = (uchar*)data; f->endb = f->data+sizeof(data); } @@ -212,6 +212,9 @@ case '%' : SFputc(f,'%'); continue; + case 'Z' : + SFputc(f,0); + continue; case LEFTP : /* get the type enclosed in balanced parens */ t_str = (char*)form; @@ -627,7 +630,7 @@ goto pop_fmt; if(!argv.ft->form && ft ) /* change extension functions */ { if(ft->eventf && - (*ft->eventf)(f,SF_DPOP,(void*)form,ft) < 0) + (*ft->eventf)(f,SFIO_DPOP,(void*)form,ft) < 0) continue; fmstk->ft = ft = argv.ft; } @@ -965,7 +968,7 @@ { flags &= ~SFFMT_ALTER; scale = 1000; } - if(base < 2 || base > SF_RADIX) + if(base < 2 || base > SFIO_RADIX) base = 10; if((base&(n_s = base-1)) == 0) { if(base < 8) @@ -1157,13 +1160,13 @@ if(fmt == 'e' || fmt == 'E' && (v |= SFFMT_UPPER)) { v |= SFFMT_EFORMAT; n = (precis = precis < 0 ? FPRECIS : precis)+1; - ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS), + ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SFIO_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(valp,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS), + ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(precis,SFIO_FDIGITS), &decpt, &sign, &n_s, v); goto f_format; } @@ -1175,7 +1178,7 @@ else precis = 2*(sizeof(double) - 2); } n = precis + 1; - ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SF_FDIGITS), + ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(n,SFIO_FDIGITS), &decpt, &sign, &n_s, v); sp = endsp = buf+1; /* reserve space for sign */ @@ -1192,7 +1195,7 @@ if(fmt == 'G') v |= SFFMT_UPPER; v |= SFFMT_EFORMAT; - ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(precis,SF_FDIGITS), + ep = _sfcvt(valp,tmp+1,sizeof(tmp)-1, min(precis,SFIO_FDIGITS), &decpt, &sign, &n_s, v); if(dval == 0.) decpt = 1; @@ -1382,8 +1385,8 @@ while((fm = fmstk) ) /* pop the format stack and continue */ { if(fm->eventf) { if(!form || !form0) - (*fm->eventf)(f,SF_FINAL,NULL,ft); - else if((*fm->eventf)(f,SF_DPOP,(void*)form,ft) < 0) + (*fm->eventf)(f,SFIO_FINAL,NULL,ft); + else if((*fm->eventf)(f,SFIO_DPOP,(void*)form,ft) < 0) goto loop_fmt; } @@ -1407,7 +1410,7 @@ free(fp); while((fm = fmstk) ) { if(fm->eventf) - (*fm->eventf)(f,SF_FINAL,NULL,fm->ft); + (*fm->eventf)(f,SFIO_FINAL,NULL,fm->ft); fmstk = fm->next; free(fm); } @@ -1419,8 +1422,8 @@ f->endw = f->endr = f->endb = f->data = NULL; f->next = f->data; - if((((flags = f->flags)&SF_SHARE) && !(flags&SF_PUBLIC) ) || - (n > 0 && (sp == data || (flags&SF_LINE) ) ) ) + if((((flags = f->flags)&SFIO_SHARE) && !(flags&SFIO_PUBLIC) ) || + (n > 0 && (sp == data || (flags&SFIO_LINE) ) ) ) (void)SFWRITE(f,sp,n); else f->next += n;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfvscanf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfvscanf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -37,9 +37,9 @@ { if(f->next >= f->endb) { if(*peek) /* try peeking for a share stream if possible */ - { f->mode |= SF_RV; + { f->mode |= SFIO_RV; if(SFFILBUF(f,-1) > 0) - { f->mode |= SF_PEEK; + { f->mode |= SFIO_PEEK; return; } *peek = 0; /* can't peek, back to normal reads */ @@ -108,7 +108,7 @@ /* structure to match characters in a character class */ typedef struct _accept_s -{ char okSF_MAXCHAR+1; +{ char okSFIO_MAXCHAR+1; int yes; char *form, *endf; #if _has_multibyte @@ -129,11 +129,11 @@ } else ac->yes = 1; - for(c = 0; c <= SF_MAXCHAR; ++c) + for(c = 0; c <= SFIO_MAXCHAR; ++c) ac->okc = !ac->yes; if(*form == '' || *form == '-') /* special first char */ - { ac->ok*form = ac->yes; + { ac->ok*((unsigned char*)form) = ac->yes; form += 1; } ac->form = (char*)form; @@ -211,8 +211,8 @@ Accept_t* ac, /* accept handle for % */ void* mbs) /* multibyte parsing state */ { - int n, v; - char b16; /* assuming that SFMBMAX <= 16! */ + int n, v; + unsigned char b16; /* assuming that SFMBMAX <= 16! */ /* shift left data so that there will be more room to back up on error. this won't help streams with small buffers - c'est la vie! */ @@ -233,7 +233,7 @@ goto no_match; else bn++ = v; - if(mbrtowc(wc, b, n, (mbstate_t*)mbs) == (size_t)(-1)) + if(mbrtowc(wc, (char*)b, n, (mbstate_t*)mbs) == (size_t)(-1)) goto no_match; /* malformed multi-byte char */ else { /* multi-byte char converted successfully */ @@ -304,7 +304,7 @@ int peek; #define SFbuf(f) (_sfbuf(f,&peek), (data = d = f->next), (endd = f->endb) ) #define SFlen(f) (d - data) -#define SFinit(f) ((peek = f->extent < 0 && (f->flags&SF_SHARE)), SFbuf(f) ) +#define SFinit(f) ((peek = f->extent < 0 && (f->flags&SFIO_SHARE)), SFbuf(f) ) #define SFend(f) ((n_input += SFlen(f)), \ (peek ? SFREAD(f,data,SFlen(f)) : ((f->next = d),0)) ) #define SFgetc(f,c) ((c) = (d < endd || (SFend(f), SFbuf(f), d < endd)) ? \ @@ -314,7 +314,7 @@ SFCVINIT(); /* initialize conversion tables */ - if(!f || !form || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || !form || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return -1; SFLOCK(f,0); @@ -337,7 +337,7 @@ while((fmt = *form++)) { if(fmt != '%') { if(isspace(fmt)) - { if(fmt != '\n' || !(f->flags&SF_LINE)) + { if(fmt != '\n' || !(f->flags&SFIO_LINE)) fmt = -1; for(;;) { if(SFgetc(f,inp) < 0 || inp == fmt) @@ -674,7 +674,7 @@ continue; if(!argv.ft->form && ft ) /* change extension functions */ { if(ft->eventf && - (*ft->eventf)(f,SF_DPOP,(void*)form,ft) < 0) + (*ft->eventf)(f,SFIO_DPOP,(void*)form,ft) < 0) continue; fmstk->ft = ft = argv.ft; } @@ -846,7 +846,7 @@ if(fmt == 'i' && inp == '#' && !(flags&SFFMT_ALTER) ) { base = (int)argv.lu; - if(base < 2 || base > SF_RADIX) + if(base < 2 || base > SFIO_RADIX) goto pop_fmt; argv.lu = 0; sp = (char*)(base <= 36 ? _Sfcv36 : _Sfcv64); @@ -858,7 +858,7 @@ else { /* other bases */ sp = (char*)(base <= 36 ? _Sfcv36 : _Sfcv64); - if(base < 2 || base > SF_RADIX || spinp >= base) + if(base < 2 || base > SFIO_RADIX || spinp >= base) { SFungetc(f,inp); goto pop_fmt; } @@ -1018,8 +1018,8 @@ while((fm = fmstk) ) /* pop the format stack and continue */ { if(fm->eventf) { if(!form || !form0) - (*fm->eventf)(f,SF_FINAL,NULL,ft); - else if((*fm->eventf)(f,SF_DPOP,(void*)form,ft) < 0) + (*fm->eventf)(f,SFIO_FINAL,NULL,ft); + else if((*fm->eventf)(f,SFIO_DPOP,(void*)form,ft) < 0) goto loop_fmt; } @@ -1043,7 +1043,7 @@ free(fp); while((fm = fmstk) ) { if(fm->eventf) - (*fm->eventf)(f,SF_FINAL,NULL,fm->ft); + (*fm->eventf)(f,SFIO_FINAL,NULL,fm->ft); fmstk = fm->next; free(fm); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfwalk.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfwalk.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,12 +32,12 @@ int n, rv; /* truly initializing std-streams before walking */ - if(sfstdin->mode & SF_INIT) - _sfmode(sfstdin, (sfstdin->mode & SF_RDWR), 0); - if(sfstdout->mode & SF_INIT) - _sfmode(sfstdout, (sfstdout->mode & SF_RDWR), 0); - if(sfstderr->mode & SF_INIT) - _sfmode(sfstderr, (sfstderr->mode & SF_RDWR), 0); + if(sfstdin->mode & SFIO_INIT) + _sfmode(sfstdin, (sfstdin->mode & SFIO_RDWR), 0); + if(sfstdout->mode & SFIO_INIT) + _sfmode(sfstdout, (sfstdout->mode & SFIO_RDWR), 0); + if(sfstderr->mode & SFIO_INIT) + _sfmode(sfstderr, (sfstderr->mode & SFIO_RDWR), 0); for(rv = 0, p = &_Sfpool; p; p = p->next) { for(n = 0; n < p->n_sf; )
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfwr.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfwr.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -86,7 +86,7 @@ } if((wr = write(f->file,wbuf,buf-wbuf)) > 0) { w += wr; - f->bits &= ~SF_HOLE; + f->bits &= ~SFIO_HOLE; } if(wr != (buf-wbuf)) break; @@ -101,7 +101,7 @@ w += s; n -= s; wbuf = (buf += s); - f->bits |= SF_HOLE; + f->bits |= SFIO_HOLE; if(n > 0) { /* next page must be dirty */ @@ -125,8 +125,8 @@ return (ssize_t)(-1); GETLOCAL(f,local); - if(!local && !(f->bits&SF_DCDOWN)) /* an external user's call */ - { if(f->mode != SF_WRITE && _sfmode(f,SF_WRITE,0) < 0 ) + if(!local && !(f->bits&SFIO_DCDOWN)) /* an external user's call */ + { if(f->mode != SFIO_WRITE && _sfmode(f,SFIO_WRITE,0) < 0 ) return (ssize_t)(-1); if(f->next > f->data && SFSYNC(f) < 0 ) return (ssize_t)(-1); @@ -134,39 +134,39 @@ for(;;) { /* stream locked by sfsetfd() */ - if(!(f->flags&SF_STRING) && f->file < 0) + if(!(f->flags&SFIO_STRING) && f->file < 0) return 0; /* clear current error states */ - f->flags &= ~(SF_EOF|SF_ERROR); + f->flags &= ~(SFIO_EOF|SFIO_ERROR); dc = disc; - if(f->flags&SF_STRING) /* just asking to extend buffer */ + if(f->flags&SFIO_STRING) /* just asking to extend buffer */ w = n + (f->next - f->data); else { /* warn that a write is about to happen */ SFDISC(f,dc,writef); - if(dc && dc->exceptf && (f->flags&SF_IOCHECK) ) + if(dc && dc->exceptf && (f->flags&SFIO_IOCHECK) ) { int rv; if(local) SETLOCAL(f); - if((rv = _sfexcept(f,SF_WRITE,n,dc)) > 0) + if((rv = _sfexcept(f,SFIO_WRITE,n,dc)) > 0) n = rv; else if(rv < 0) - { f->flags |= SF_ERROR; + { f->flags |= SFIO_ERROR; return rv; } } if(f->extent >= 0) { /* make sure we are at the right place to write */ - if(f->flags&SF_APPENDWR) - { if(f->here != f->extent || (f->flags&SF_SHARE)) + if(f->flags&SFIO_APPENDWR) + { if(f->here != f->extent || (f->flags&SFIO_SHARE)) { f->here = SFSK(f,0,SEEK_END,dc); f->extent = f->here; } } - else if((f->flags&SF_SHARE) && !(f->flags&SF_PUBLIC)) + else if((f->flags&SFIO_SHARE) && !(f->flags&SFIO_PUBLIC)) f->here = SFSK(f,f->here,SEEK_SET,dc); } @@ -178,10 +178,10 @@ } else if(SFISNULL(f)) w = n; - else if(f->flags&SF_WHOLE) + else if(f->flags&SFIO_WHOLE) goto do_write; else if((ssize_t)n >= _Sfpage && - !(f->flags&(SF_SHARE|SF_APPENDWR)) && + !(f->flags&(SFIO_SHARE|SFIO_APPENDWR)) && f->here == f->extent && (f->here%_Sfpage) == 0) { if((w = sfoutput(f,(char*)buf,n)) <= 0) goto do_write; @@ -190,15 +190,15 @@ { do_write: if((w = write(f->file,buf,n)) > 0) - f->bits &= ~SF_HOLE; + f->bits &= ~SFIO_HOLE; } if(errno == 0) errno = oerrno; if(w > 0) - { if(!(f->bits&SF_DCDOWN) ) - { if((f->flags&(SF_APPENDWR|SF_PUBLIC)) && f->extent >= 0 ) + { if(!(f->bits&SFIO_DCDOWN) ) + { if((f->flags&(SFIO_APPENDWR|SFIO_PUBLIC)) && f->extent >= 0 ) f->here = SFSK(f,0,SEEK_CUR,dc); else f->here += w; if(f->extent >= 0 && f->here > f->extent) @@ -211,18 +211,18 @@ if(local) SETLOCAL(f); - switch(_sfexcept(f,SF_WRITE,w,dc)) + switch(_sfexcept(f,SFIO_WRITE,w,dc)) { - case SF_ECONT : + case SFIO_ECONT : goto do_continue; - case SF_EDONE : + case SFIO_EDONE : w = local ? 0 : w; return (ssize_t)w; - case SF_EDISC : - if(!local && !(f->flags&SF_STRING)) + case SFIO_EDISC : + if(!local && !(f->flags&SFIO_STRING)) goto do_continue; /* FALLTHROUGH */ - case SF_ESTACK : + case SFIO_ESTACK : return (ssize_t)(-1); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/sfio/sfwrite.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/sfio/sfwrite.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -40,17 +40,17 @@ return (ssize_t)(n == 0 ? 0 : -1) ; /* release peek lock */ - if(f->mode&SF_PEEK) - { if(!(f->mode&SF_WRITE) && (f->flags&SF_RDWR) != SF_RDWR) + if(f->mode&SFIO_PEEK) + { if(!(f->mode&SFIO_WRITE) && (f->flags&SFIO_RDWR) != SFIO_RDWR) return (ssize_t)(-1); if((uchar*)buf != f->next && (!f->rsrv || f->rsrv->data != (uchar*)buf) ) return (ssize_t)(-1); - f->mode &= ~SF_PEEK; + f->mode &= ~SFIO_PEEK; - if(f->mode&SF_PKRD) + if(f->mode&SFIO_PKRD) { /* read past peeked data */ char buf16; ssize_t r; @@ -65,19 +65,19 @@ else w -= r; } - f->mode &= ~SF_PKRD; + f->mode &= ~SFIO_PKRD; f->endb = f->data + n; f->here += n; } - if((f->mode&SF_READ) && f->proc) + if((f->mode&SFIO_READ) && f->proc) f->next += n; } s = begs = (uchar*)buf; - for(;; f->mode &= ~SF_LOCK) + for(;; f->mode &= ~SFIO_LOCK) { /* check stream mode */ - if(SFMODE(f,local) != SF_WRITE && _sfmode(f,SF_WRITE,local) < 0 ) + if(SFMODE(f,local) != SFIO_WRITE && _sfmode(f,SFIO_WRITE,local) < 0 ) { w = s > begs ? s-begs : -1; return w; } @@ -95,11 +95,11 @@ } /* attempt to create space in buffer */ - if(w == 0 || ((f->flags&SF_WHOLE) && w < (ssize_t)n) ) - { if(f->flags&SF_STRING) /* extend buffer */ + if(w == 0 || ((f->flags&SFIO_WHOLE) && w < (ssize_t)n) ) + { if(f->flags&SFIO_STRING) /* extend buffer */ { (void)SFWR(f, s, n-w, f->disc); if((w = f->endb - f->next) < (ssize_t)n) - { if(!(f->flags&SF_STRING)) /* maybe sftmp */ + { if(!(f->flags&SFIO_STRING)) /* maybe sftmp */ { if(f->next > f->data) goto fls_buf; } @@ -111,13 +111,13 @@ { fls_buf: (void)SFFLSBUF(f, -1); if((w = f->endb - f->next) < (ssize_t)n && - (f->flags&SF_WHOLE) && f->next > f->data ) + (f->flags&SFIO_WHOLE) && f->next > f->data ) break; } } - if(!(f->flags&SF_STRING) && f->next == f->data && - (((f->flags&SF_WHOLE) && w <= n) || SFDIRECT(f,n)) ) + if(!(f->flags&SFIO_STRING) && f->next == f->data && + (((f->flags&SFIO_WHOLE) && w <= n) || SFDIRECT(f,n)) ) { /* bypass buffering */ if((w = SFWR(f,s,n,f->disc)) <= 0 ) break; @@ -137,11 +137,11 @@ } /* always flush buffer for share streams */ - if(f->extent < 0 && (f->flags&SF_SHARE) && !(f->flags&SF_PUBLIC) ) + if(f->extent < 0 && (f->flags&SFIO_SHARE) && !(f->flags&SFIO_PUBLIC) ) (void)SFFLSBUF(f,-1); /* check to see if buffer should be flushed */ - else if(n == 0 && (f->flags&SF_LINE) && !(f->flags&SF_STRING)) + else if(n == 0 && (f->flags&SFIO_LINE) && !(f->flags&SFIO_STRING)) { if((ssize_t)(n = f->next-f->data) > (w = s-begs)) n = w; if(n > 0 && n < HIFORLINE)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/_stdsprnt.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/_stdsprnt.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -28,7 +28,7 @@ int v; va_start(args, fmt); - v = s ? sfvsprintf(s, SF_BUFSIZE, fmt, args) : -1; + v = s ? sfvsprintf(s, SFIO_BUFSIZE, fmt, args) : -1; va_end(args); return v; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fdopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fdopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -26,5 +26,5 @@ if (fd < 0 || !(flags = _sftype(mode, NULL, NULL))) return NULL; - return sfnew(NULL, NULL, (size_t)SF_UNBOUND, fd, flags); + return sfnew(NULL, NULL, (size_t)SFIO_UNBOUND, fd, flags); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fflush.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fflush.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -30,6 +30,6 @@ return fcloseall(); if (f->extent > 0) - sfseek(f, 0, SEEK_CUR|SF_PUBLIC); + sfseek(f, 0, SEEK_CUR|SFIO_PUBLIC); return (sfsync(f) < 0 || sfpurge(f) < 0) ? -1 : 0; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fgets.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fgets.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -26,7 +26,7 @@ unsigned char* is; unsigned char* ps; - if(n <= 0 || !us || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(n <= 0 || !us || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return NULL; SFLOCK(f,0); @@ -38,7 +38,7 @@ { /* peek the read buffer for data */ if((p = f->endb - (ps = f->next)) <= 0 ) { f->getr = '\n'; - f->mode |= SF_RC; + f->mode |= SFIO_RC; if(SFRPEEK(f,ps,p) <= 0) break; } @@ -52,7 +52,7 @@ is += p; ps = f->next+p; #else - if(!(f->flags&(SF_BOTH|SF_MALLOC))) + if(!(f->flags&(SFIO_BOTH|SFIO_MALLOC))) { while(p-- && (*is++ = *ps++) != '\n') ; p = ps-f->next;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fmemopen.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fmemopen.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,5 +22,5 @@ Sfio_t* fmemopen(void* buf, size_t size, const char* mode) { - return sfnew(NULL, buf, size, -1, SF_STRING|_sftype(mode, NULL, NULL)); + return sfnew(NULL, buf, size, -1, SFIO_STRING|_sftype(mode, NULL, NULL)); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fseek.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fseek.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,5 +22,5 @@ int fseek(Sfio_t* f, long off, int op) { - return sfseek(f, (Sfoff_t)off, op|SF_SHARE) >= 0 ? 0 : -1; + return sfseek(f, (Sfoff_t)off, op|SFIO_SHARE) >= 0 ? 0 : -1; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fseeko.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fseeko.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,5 +22,5 @@ int fseeko(Sfio_t* f, off_t off, int op) { - return sfseek(f, (Sfoff_t)off, op|SF_SHARE) >= 0 ? 0 : -1; + return sfseek(f, (Sfoff_t)off, op|SFIO_SHARE) >= 0 ? 0 : -1; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fsetpos.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fsetpos.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,5 +22,5 @@ int fsetpos(Sfio_t* f, const fpos_t* pos) { - return sfseek(f, (Sfoff_t)pos->_sf_offset, SF_PUBLIC) == (Sfoff_t)pos->_sf_offset ? 0 : -1; + return sfseek(f, (Sfoff_t)pos->_sf_offset, SFIO_PUBLIC) == (Sfoff_t)pos->_sf_offset ? 0 : -1; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/fwide.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/fwide.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -30,21 +30,21 @@ { if (mode > 0) { - f->bits &= ~SF_MB; - f->bits |= SF_WC; + f->bits &= ~SFIO_MB; + f->bits |= SFIO_WC; } else if (mode < 0) { - f->bits &= ~SF_WC; - f->bits |= SF_MB; + f->bits &= ~SFIO_WC; + f->bits |= SFIO_MB; } - if (f->bits & SF_MB) + if (f->bits & SFIO_MB) return -1; - if (f->bits & SF_WC) + if (f->bits & SFIO_WC) return 1; - if ((f->flags & SF_SYNCED) || f->next > f->data) + if ((f->flags & SFIO_SYNCED) || f->next > f->data) { - f->bits |= SF_MB; + f->bits |= SFIO_MB; return -1; } return 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/getdelim.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/getdelim.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -32,7 +32,7 @@ if(delim < 0 || delim > 255 || !sp || !np) /* bad parameters */ return -1; - if(!f || (f->mode != SF_READ && _sfmode(f,SF_READ,0) < 0)) + if(!f || (f->mode != SFIO_READ && _sfmode(f,SFIO_READ,0) < 0)) return -1; SFLOCK(f,0); @@ -43,7 +43,7 @@ { /* read new data */ if((p = f->endb - (ps = f->next)) <= 0 ) { f->getr = delim; - f->mode |= SF_RC; + f->mode |= SFIO_RC; if(SFRPEEK(f,ps,p) <= 0) { m = -1; break;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/rewind.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/rewind.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,6 +22,6 @@ void rewind(Sfio_t* f) { - sfseek(f, 0, SEEK_SET|SF_PUBLIC); + sfseek(f, 0, SEEK_SET|SFIO_PUBLIC); sfclrlock(f); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/setlinebuf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/setlinebuf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,6 +22,6 @@ int setlinebuf(Sfio_t* f) { - sfset(f, SF_LINE, 1); + sfset(f, SFIO_LINE, 1); return 0; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/setvbuf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/setvbuf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,8 +23,8 @@ setvbuf(Sfio_t* f, char* buf, int type, size_t size) { if (type == _IOLBF) - sfset(f, SF_LINE, 1); - else if (f->flags & SF_STRING) + sfset(f, SFIO_LINE, 1); + else if (f->flags & SFIO_STRING) return -1; else if (type == _IONBF) { @@ -34,7 +34,7 @@ else if (type == _IOFBF) { if (size == 0) - size = SF_BUFSIZE; + size = SFIO_BUFSIZE; sfsync(f); sfsetbuf(f, buf, size); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/stdhdr.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/stdhdr.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -30,15 +30,15 @@ #include "stdio.h" -#define SF_MB 010000 -#define SF_WC 020000 +#define SFIO_MB 010000 +#define SFIO_WC 020000 #define FWIDE(f,r) \ do \ { \ if (fwide(f, 0) < 0) \ return r; \ - f->bits |= SF_WC; \ + f->bits |= SFIO_WC; \ } while (0) extern int sfdcwide(Sfio_t*);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/vfwscanf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/vfwscanf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -45,13 +45,13 @@ return -1; switch (op) { - case SF_ATEXIT: - sfdisc(f, SF_POPDISC); + case SFIO_ATEXIT: + sfdisc(f, SFIO_POPDISC); break; - case SF_CLOSING: - case SF_DPOP: - case SF_FINAL: - if (op != SF_CLOSING) + case SFIO_CLOSING: + case SFIO_DPOP: + case SFIO_FINAL: + if (op != SFIO_CLOSING) free(dp); break; } @@ -92,7 +92,7 @@ n = wcstombs(NULL, fmt, 0); if (w = newof(0, Wide_t, 1, n)) { - if (t = sfnew(NULL, buf, sizeof(buf), (int)astconf_long(CONF_OPEN_MAX)+1, SF_READ)) + if (t = sfnew(NULL, buf, sizeof(buf), (int)astconf_long(CONF_OPEN_MAX)+1, SFIO_READ)) { w->sfdisc.exceptf = wideexcept; w->sfdisc.readf = wideread;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/vsnprintf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/vsnprintf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -26,8 +26,8 @@ ssize_t rv; /* make a temp stream */ - if(!(f = sfnew(NULL,NULL,(size_t)SF_UNBOUND, - -1,SF_WRITE|SF_STRING)) ) + if(!(f = sfnew(NULL,NULL,(size_t)SFIO_UNBOUND, + -1,SFIO_WRITE|SFIO_STRING)) ) return -1; if((rv = sfvprintf(f,form,args)) >= 0 )
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/vsprintf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/vsprintf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,5 +22,5 @@ int vsprintf(char* s, const char* fmt, va_list args) { - return vsnprintf(s, 4 * SF_BUFSIZE, fmt, args); + return vsnprintf(s, 4 * SFIO_BUFSIZE, fmt, args); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/vswprintf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/vswprintf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -39,9 +39,9 @@ */ SFCLEAR(&f); - f.flags = SF_STRING|SF_WRITE; - f.bits = SF_PRIVATE; - f.mode = SF_WRITE; + f.flags = SFIO_STRING|SFIO_WRITE; + f.bits = SFIO_PRIVATE; + f.mode = SFIO_WRITE; f.size = n - 1; f.data = f.next = f.endr = (uchar*)s; f.endb = f.endw = f.data + f.size;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/stdio/vswscanf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/stdio/vswscanf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2022 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -38,9 +38,9 @@ */ SFCLEAR(&f); - f.flags = SF_STRING|SF_READ; - f.bits = SF_PRIVATE; - f.mode = SF_READ; + f.flags = SFIO_STRING|SFIO_READ; + f.bits = SFIO_PRIVATE; + f.mode = SFIO_READ; f.size = wcslen(s) * sizeof(wchar_t); f.data = f.next = f.endw = (uchar*)s; f.endb = f.endr = f.data + f.size;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/string/strlcat.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/string/strlcat.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -14,18 +14,15 @@ * David Korn <dgk@research.att.com> * * Phong Vo <kpv@research.att.com> * * Martijn Dekker <martijn@inlv.org> * +* Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ /* * strlcat implementation */ -#define strlcat ______strlcat - #include <ast.h> -#undef strlcat - #undef _def_map_ast #include <ast_map.h>
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/string/strlcpy.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/string/strlcpy.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -14,18 +14,15 @@ * David Korn <dgk@research.att.com> * * Phong Vo <kpv@research.att.com> * * Martijn Dekker <martijn@inlv.org> * +* Johnothan King <johnothanking@protonmail.com> * * * ***********************************************************************/ /* * strlcpy implementation */ -#define strlcpy ______strlcpy - #include <ast.h> -#undef strlcpy - #undef _def_map_ast #include <ast_map.h>
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/string/strtoi.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/string/strtoi.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -222,7 +222,7 @@ #if S2I_multiplier base = basep ? *((unsigned char*)basep) : 0; #else - if (base > 36 && base <= SF_RADIX) + if (base > 36 && base <= SFIO_RADIX) { static int conformance = -1; @@ -232,7 +232,7 @@ base = 1; } #endif - if (base && (base < 2 || base > SF_RADIX)) + if (base && (base < 2 || base > SFIO_RADIX)) { errno = EINVAL; return 0; @@ -280,7 +280,7 @@ } if (!base) base = 10; - else if (base < 2 || base > SF_RADIX) + else if (base < 2 || base > SFIO_RADIX) { errno = EINVAL; return 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/string/tokline.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/string/tokline.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -66,13 +66,13 @@ NoP(val); switch (op) { - case SF_CLOSING: + case SFIO_CLOSING: sfclose(d->sp); return 0; - case SF_DPOP: + case SFIO_DPOP: free(d); return 0; - case SF_READ: + case SFIO_READ: do { if (!(buf = sfgetr(d->sp, '\n', 0)) && !(buf = sfgetr(d->sp, '\n', -1))) @@ -125,7 +125,7 @@ } if (n > 0) { - if (!j && bufn - 1 != '\n' && (s->_flags & SF_STRING)) + if (!j && bufn - 1 != '\n' && (s->_flags & SFIO_STRING)) bufn++ = '\n'; if (q && bufn - 1 == '\n') bufn - 1 = '\r'; @@ -144,8 +144,8 @@ * open a stream to parse lines * * flags: 0 arg: open Sfio_t* - * flags: SF_READ arg: file name - * flags: SF_STRING arg: null-terminated char* + * flags: SFIO_READ arg: file name + * flags: SFIO_STRING arg: null-terminated char* * * if line!=0 then it points to a line count that starts at 0 * and is incremented for each input line @@ -169,9 +169,9 @@ free(d); return NULL; } - if (!(flags & (SF_STRING|SF_READ))) + if (!(flags & (SFIO_STRING|SFIO_READ))) f = (Sfio_t*)arg; - else if (!(f = sfopen(NULL, arg, (flags & SF_STRING) ? "s" : "r"))) + else if (!(f = sfopen(NULL, arg, (flags & SFIO_STRING) ? "s" : "r"))) { free(d); sfclose(s);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/tm/tminit.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/tm/tminit.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -81,7 +81,7 @@ _tm_localtime(const time_t* t) { struct tm* r; - char* e; + char* e = NULL; char** v = environ; if (TZ0) @@ -198,7 +198,7 @@ Tm_zone_t* zp; int n; char* s; - char* e; + char* e = NULL; int i; int m; int isdst;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/tm/tmlocale.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/tm/tmlocale.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -580,7 +580,7 @@ if (tp = sfstropen()) { sfread(sp, u, 3); - n = iconv_move(cvt, sp, tp, SF_UNBOUND, NULL); + n = iconv_move(cvt, sp, tp, SFIO_UNBOUND, NULL); } iconv_close(cvt); }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/tm/tmxdate.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/tm/tmxdate.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -157,7 +157,7 @@ { Tm_t* tm; long n; - int w; + int w = 0; unsigned long set; unsigned long state; unsigned long flags; @@ -176,7 +176,7 @@ int f; int i; int j; - int k; + int k = 0; int l; long m; unsigned long p; @@ -252,7 +252,7 @@ break; } } - else if (!skip*s) + else if (!skip*((unsigned char*)s)) break; s++; } @@ -805,7 +805,7 @@ break; goto save; } - else if (f == -1 && isalpha(*t) && tmlex(t, &t, tm_info.format + TM_ORDINAL, TM_ORDINALS - TM_ORDINAL, NULL, 0) >= 0) + else if ((f == -1 || f == 1) && isalpha(*t) && tmlex(t, &t, tm_info.format + TM_ORDINAL, TM_ORDINALS - TM_ORDINAL, NULL, 0) >= 0) { message((-1, "AHA#%d n=%d", __LINE__, n)); ordinal: @@ -815,7 +815,7 @@ state |= ((f = n) ? NEXT : THIS)|ORDINAL; set &= ~(EXACT|LAST|NEXT|THIS); set |= state & (EXACT|LAST|NEXT|THIS); - for (s = t; skip*s; s++); + for (s = t; skip*((unsigned char*)s); s++); if (isdigit(*s)) { if (n = strtol(s, &t, 10)) @@ -974,7 +974,7 @@ } continue; } - for (s = t; skip*s; s++) + for (s = t; skip*((unsigned char*)s); s++) ; message((-1, "AHA#%d s=\"%s\"", __LINE__, s)); if (*s == ':' || *s == '.' && ((set|state) & (YEAR|MONTH|DAY|HOUR)) == (YEAR|MONTH|DAY)) @@ -1086,7 +1086,7 @@ /* +/- handled on top of loop */ if (*s == '-' || *s == '+') break; - else if (skip*s) + else if (skip*((unsigned char*)s)) s++; else break; @@ -1262,7 +1262,7 @@ message((-1, "AHA#%d n=%d", __LINE__, n)); /* look ahead for TM_PARTS, in k used in ordinal: */ u = t; - while (skip*u) + while (skip*((unsigned char*)u)) u++; k = tmlex(u, &u, tm_info.format, TM_NFORM, @@ -1311,7 +1311,7 @@ { /* look ahead for TM_PARTS, k used in ordinal: */ u = t; - while (skip*u) + while (skip*((unsigned char*)u)) u++; k = tmlex(u, &u, tm_info.format, TM_NFORM, @@ -1326,7 +1326,7 @@ for (;;) { - while (skip*s) + while (skip*((unsigned char*)s)) s++; if ((k = tmlex(s, &t, tm_info.format + TM_LAST, TM_NOISE - TM_LAST, NULL, 0)) >= 0) { @@ -1536,7 +1536,7 @@ tm->tm_mon = j - TM_MONTH; if (n < 0) { - while (skip*s) + while (skip*((unsigned char*)s)) s++; if (isdigit(*s)) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vmalloc/vmbest.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/vmalloc/vmbest.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -1172,7 +1172,7 @@ } #endif /* _mem_map_anon || _mem_mmap_zero */ -#if _std_malloc /* using native malloc as a last resource */ +#if _std_malloc /* using native malloc as a last resort */ static void* mallocmem(void* caddr, size_t csize, size_t nsize) { /**/ASSERT(csize > 0 || nsize > 0); @@ -1180,6 +1180,10 @@ return malloc(nsize); else if(nsize == 0) { free(caddr); +#if !__clang__ && __GNUC__ >= 12 +/* ...one hopes the AT&T guys knew what they were doing here... */ +#pragma GCC diagnostic ignored "-Wuse-after-free" +#endif return caddr; } else return NULL; @@ -1250,10 +1254,10 @@ VM_MTBEST|VM_SHARE, /* mode */ 0, /* incr */ 0, /* pool */ - NULL, /* seg */ - NULL, /* free */ - NULL, /* wild */ - NULL /* root */ + NULL, /* seg */ + NULL, /* free */ + NULL, /* wild */ + NULL /* root */ /* tiny */ /* cache */ }; @@ -1268,12 +1272,12 @@ bestalign, VM_MTBEST }, - NULL, /* file */ + NULL, /* file */ 0, /* line */ 0, /* func */ (Vmdisc_t*)(&_Vmdcsystem), /* disc */ &_Vmdata, /* data */ - NULL /* next */ + NULL /* next */ }; Vmalloc_t* Vmheap = &_Vmheap;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libast/vmalloc/vmhdr.h -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libast/vmalloc/vmhdr.h
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1985-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -35,6 +35,7 @@ #define _npt_sbrk 1 #include <ast.h> +#include <sig.h> #if _npt_getpagesize #undef getpagesize
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/Mamfile
Changed
@@ -1,668 +1,530 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} setv CC cc -setv mam_cc_FLAGS ${mam_cc_DLL} -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} -setv COTEMP $$ +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} ${mam_cc_NOSTRICTALIASING} -DERROR_CATALOG=\""libcmd"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -D_BLD_cmd +setv CCFLAGS setv IFFEFLAGS -setv LDFLAGS "" -make install - make cmd - make cmd.req - prev ${INSTALLROOT}/bin/mkreq - exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} : ${LDFLAGS} : cmd fsg md util ast - done cmd.req generated - make libcmd.a archive - prev cmd.req - make cmdinit.o - make cmdinit.c - prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit - make cmd.h implicit - prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit dontcare - make cmdext.h implicit - prev cmdinit.c - make basename.c - prev cmd.h - done basename.c - make cat.c - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/bytesex.h - done ${PACKAGE_ast_INCLUDE}/endian.h - prev cmd.h - done cat.c - make chgrp.c - make FEATURE/symlink implicit - prev features/symlink - bind -lutil - bind -last - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/symlink - done FEATURE/symlink generated - make ${PACKAGE_ast_INCLUDE}/fts.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - done ${PACKAGE_ast_INCLUDE}/wchar.h - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h - done ${PACKAGE_ast_INCLUDE}/wctype.h - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h - done ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/ast_map.h - prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_sys.h - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/fts.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/ls.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_mode.h - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ls.h - make ${PACKAGE_ast_INCLUDE}/cdt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/cdt.h - prev cmd.h - done chgrp.c - make chmod.c - prev FEATURE/symlink - prev ${PACKAGE_ast_INCLUDE}/fts.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done chmod.c - make chown.c - prev cmd.h - done chown.c - make cksum.c - make ${PACKAGE_ast_INCLUDE}/error.h implicit - make ${PACKAGE_ast_INCLUDE}/option.h implicit - make ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h - make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/vmalloc.h - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/option.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/fts.h - make ${PACKAGE_ast_INCLUDE}/modex.h implicit - prev ${PACKAGE_ast_INCLUDE}/modecanon.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h - done ${PACKAGE_ast_INCLUDE}/modex.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - make ${PACKAGE_ast_INCLUDE}/sum.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/sum.h - prev cmd.h - done cksum.c - make cmp.c - make ${PACKAGE_ast_INCLUDE}/ccode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ccode.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done cmp.c - make comm.c - prev cmd.h - done comm.c - make cp.c - make ${PACKAGE_ast_INCLUDE}/tmx.h implicit - make ${PACKAGE_ast_INCLUDE}/tv.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/tv.h - make ${PACKAGE_ast_INCLUDE}/tm.h implicit - make ${PACKAGE_ast_INCLUDE}/times.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/times.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/tm.h - done ${PACKAGE_ast_INCLUDE}/tmx.h - make ${PACKAGE_ast_INCLUDE}/stk.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio.h - done ${PACKAGE_ast_INCLUDE}/stk.h - prev ${PACKAGE_ast_INCLUDE}/hashkey.h implicit - prev ${PACKAGE_ast_INCLUDE}/fts.h - prev ${PACKAGE_ast_INCLUDE}/times.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done cp.c - make cut.c - prev cmd.h - done cut.c - make dirname.c - prev cmd.h - done dirname.c - make date.c - prev ${PACKAGE_ast_INCLUDE}/times.h - prev ${PACKAGE_ast_INCLUDE}/tmx.h - make ${PACKAGE_ast_INCLUDE}/proc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/proc.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done date.c - make expr.c - prev ${PACKAGE_ast_INCLUDE}/regex.h - prev cmd.h - done expr.c - make fds.c - prev ${PACKAGE_ast_INCLUDE}/endian.h - make FEATURE/sockets implicit - prev features/sockets - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/sockets - done FEATURE/sockets generated - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done fds.c - make fmt.c - prev cmd.h - done fmt.c - make fold.c - prev cmd.h - done fold.c - make getconf.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev ${PACKAGE_ast_INCLUDE}/proc.h - prev cmd.h - done getconf.c - make head.c - prev cmd.h - done head.c - make id.c - prev fsg.h implicit dontcare virtual - prev ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/stdio.h - make FEATURE/ids implicit - prev features/ids - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/ids - done FEATURE/ids generated - prev cmd.h - done id.c - make join.c - prev ${PACKAGE_ast_INCLUDE}/wctype.h - prev ${PACKAGE_ast_INCLUDE}/wchar.h - make ${PACKAGE_ast_INCLUDE}/sfdisc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/sfdisc.h - prev cmd.h - done join.c - make ln.c - prev cmd.h - done ln.c - make logname.c - prev cmd.h - done logname.c - make md5sum.c - prev cmd.h - done md5sum.c - make mkdir.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done mkdir.c - make mkfifo.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done mkfifo.c - make mktemp.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done mktemp.c - make mv.c - prev cmd.h - done mv.c - make paste.c - prev cmd.h - done paste.c - make pathchk.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done pathchk.c - make pids.c - prev ${PACKAGE_ast_INCLUDE}/sfdisc.h - prev ${PACKAGE_ast_INCLUDE}/ast_tty.h implicit - prev cmd.h - done pids.c - make rev.c - prev rev.h implicit - prev cmd.h - done rev.c - make rm.c - prev ${PACKAGE_ast_INCLUDE}/fts.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done rm.c - make rmdir.c - prev cmd.h - done rmdir.c - make stty.c - prev ${PACKAGE_ast_INCLUDE}/ast_tty.h - prev ${PACKAGE_ast_INCLUDE}/ccode.h - prev cmd.h - done stty.c - make sum.c - prev cmd.h - done sum.c - make sync.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done sync.c - make tail.c - prev rev.h - prev ${PACKAGE_ast_INCLUDE}/tv.h - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done tail.c - make tee.c - prev ${PACKAGE_ast_INCLUDE}/sig.h implicit - prev ${PACKAGE_ast_INCLUDE}/ls.h - prev cmd.h - done tee.c - make tty.c - prev cmd.h - done tty.c - make uname.c - make FEATURE/utsname implicit - prev features/utsname - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run features/utsname - done FEATURE/utsname generated - prev ${PACKAGE_ast_INCLUDE}/proc.h - prev cmd.h - done uname.c - make uniq.c - prev cmd.h - done uniq.c - make vmstate.c - prev ${PACKAGE_ast_INCLUDE}/sfdisc.h - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - prev cmd.h - done vmstate.c - make wc.c - prev ${PACKAGE_ast_INCLUDE}/ls.h - make wc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done wc.h - prev cmd.h - done wc.c - make revlib.c - prev rev.h - prev cmd.h - done revlib.c - make wclib.c - make ${PACKAGE_ast_INCLUDE}/lc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/lc.h - prev ${PACKAGE_ast_INCLUDE}/wctype.h - prev ${PACKAGE_ast_INCLUDE}/wchar.h - prev wc.h - prev cmd.h - done wclib.c - make lib.c - prev cmd.h - done lib.c - exec - { - exec - ${STDCAT} <<! - exec - /* - exec - * -lcmd extern function prototypes - exec - */ - exec - - exec - #include <shcmd.h> - exec - - exec - ! - exec - sed \ - exec - -e '/^b_a-z_a-z_0-9*(/!d' \ - exec - -e 's/^b_//' \ - exec - -e 's/(.*//' \ - exec - -e 's/.*/extern int b_&(int, char**, Shbltin_t*);/' \ - exec - ${PACKAGEROOT}/src/lib/libcmd/cmdinit.c ${PACKAGEROOT}/src/lib/libcmd/basename.c ${PACKAGEROOT}/src/lib/libcmd/cat.c ${PACKAGEROOT}/src/lib/libcmd/chgrp.c ${PACKAGEROOT}/src/lib/libcmd/chmod.c ${PACKAGEROOT}/src/lib/libcmd/chown.c ${PACKAGEROOT}/src/lib/libcmd/cksum.c ${PACKAGEROOT}/src/lib/libcmd/cmp.c ${PACKAGEROOT}/src/lib/libcmd/comm.c ${PACKAGEROOT}/src/lib/libcmd/cp.c ${PACKAGEROOT}/src/lib/libcmd/cut.c ${PACKAGEROOT}/src/lib/libcmd/dirname.c ${PACKAGEROOT}/src/lib/libcmd/date.c ${PACKAGEROOT}/src/lib/libcmd/expr.c ${PACKAGEROOT}/src/lib/libcmd/fds.c ${PACKAGEROOT}/src/lib/libcmd/fmt.c ${PACKAGEROOT}/src/lib/libcmd/fold.c ${PACKAGEROOT}/src/lib/libcmd/getconf.c ${PACKAGEROOT}/src/lib/libcmd/head.c ${PACKAGEROOT}/src/lib/libcmd/id.c ${PACKAGEROOT}/src/lib/libcmd/join.c ${PACKAGEROOT}/src/lib/libcmd/ln.c ${PACKAGEROOT}/src/lib/libcmd/logname.c ${PACKAGEROOT}/src/lib/libcmd/md5sum.c ${PACKAGEROOT}/src/lib/libcmd/mkdir.c ${PACKAGEROOT}/src/lib/libcmd/mkfifo.c ${PACKAGEROOT}/src/lib/libcmd/mktemp.c ${PACKAGEROOT}/src/lib/libcmd/mv.c ${PACKAGEROOT}/src/lib/libcmd/paste.c ${PACKAGEROOT}/src/lib/libcmd/pathchk.c ${PACKAGEROOT}/src/lib/libcmd/pids.c ${PACKAGEROOT}/src/lib/libcmd/rev.c ${PACKAGEROOT}/src/lib/libcmd/rm.c ${PACKAGEROOT}/src/lib/libcmd/rmdir.c ${PACKAGEROOT}/src/lib/libcmd/stty.c ${PACKAGEROOT}/src/lib/libcmd/sum.c ${PACKAGEROOT}/src/lib/libcmd/sync.c ${PACKAGEROOT}/src/lib/libcmd/tail.c ${PACKAGEROOT}/src/lib/libcmd/tee.c ${PACKAGEROOT}/src/lib/libcmd/tty.c ${PACKAGEROOT}/src/lib/libcmd/uname.c ${PACKAGEROOT}/src/lib/libcmd/uniq.c ${PACKAGEROOT}/src/lib/libcmd/vmstate.c ${PACKAGEROOT}/src/lib/libcmd/wc.c ${PACKAGEROOT}/src/lib/libcmd/revlib.c ${PACKAGEROOT}/src/lib/libcmd/wclib.c ${PACKAGEROOT}/src/lib/libcmd/lib.c | - exec - sort -u - exec - } > 1.${COTEMP}.h - exec - if ${STDCMP} -s 1.${COTEMP}.h cmdext.h - exec - then ${STDRM} -f 1.${COTEMP}.h - exec - else ${STDMV} 1.${COTEMP}.h cmdext.h - exec - fi - prev ${PACKAGE_ast_INCLUDE}/shcmd.h - done cmdext.h dontcare generated - prev ${PACKAGE_ast_INCLUDE}/shcmd.h - prev ${PACKAGE_ast_INCLUDE}/stk.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done cmd.h - done cmdinit.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c cmdinit.c - done cmdinit.o generated - make basename.o - prev basename.c - prev basename.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c basename.c - done basename.o generated - make cat.o - prev cat.c - prev cat.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c cat.c - done cat.o generated - make chgrp.o - prev chgrp.c - prev chgrp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c chgrp.c - done chgrp.o generated - make chmod.o - prev chmod.c - prev chmod.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c chmod.c - done chmod.o generated - make chown.o - prev chown.c - prev chown.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c chown.c - done chown.o generated - make cksum.o - prev cksum.c - prev cksum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c cksum.c - done cksum.o generated - make cmp.o - prev cmp.c - prev cmp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c cmp.c - done cmp.o generated - make comm.o - prev comm.c - prev comm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c comm.c - done comm.o generated - make cp.o - prev cp.c - prev cp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c cp.c - done cp.o generated - make cut.o - prev cut.c - prev cut.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c cut.c - done cut.o generated - make dirname.o - prev dirname.c - prev dirname.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c dirname.c - done dirname.o generated - make date.o - prev date.c - prev date.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c date.c - done date.o generated - make expr.o - prev expr.c - prev expr.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c expr.c - done expr.o generated - make fds.o - prev fds.c - prev fds.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c fds.c - done fds.o generated - make fmt.o - prev fmt.c - prev fmt.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c fmt.c - done fmt.o generated - make fold.o - prev fold.c - prev fold.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c fold.c - done fold.o generated - make getconf.o - prev getconf.c - prev getconf.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c getconf.c - done getconf.o generated - make head.o - prev head.c - prev head.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c head.c - done head.o generated - make id.o - prev id.c - prev id.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c id.c - done id.o generated - make join.o - prev join.c - prev join.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c join.c - done join.o generated - make ln.o - prev ln.c - prev ln.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c ln.c - done ln.o generated - make logname.o - prev logname.c - prev logname.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c logname.c - done logname.o generated - make md5sum.o - prev md5sum.c - prev md5sum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c md5sum.c - done md5sum.o generated - make mkdir.o - prev mkdir.c - prev mkdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c mkdir.c - done mkdir.o generated - make mkfifo.o - prev mkfifo.c - prev mkfifo.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c mkfifo.c - done mkfifo.o generated - make mktemp.o - prev mktemp.c - prev mktemp.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c mktemp.c - done mktemp.o generated - make mv.o - prev mv.c - prev mv.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c mv.c - done mv.o generated - make paste.o - prev paste.c - prev paste.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c paste.c - done paste.o generated - make pathchk.o - prev pathchk.c - prev pathchk.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c pathchk.c - done pathchk.o generated - make pids.o - prev pids.c - prev pids.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c pids.c - done pids.o generated - make rev.o - prev rev.c - prev rev.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c rev.c - done rev.o generated - make rm.o - prev rm.c - prev rm.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c rm.c - done rm.o generated - make rmdir.o - prev rmdir.c - prev rmdir.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c rmdir.c - done rmdir.o generated - make stty.o - prev stty.c - prev stty.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c stty.c - done stty.o generated - make sum.o - prev sum.c - prev sum.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c sum.c - done sum.o generated - make sync.o - prev sync.c - prev sync.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c sync.c - done sync.o generated - make tail.o - prev tail.c - prev tail.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c tail.c - done tail.o generated - make tee.o - prev tee.c - prev tee.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c tee.c - done tee.o generated - make tty.o - prev tty.c - prev tty.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c tty.c - done tty.o generated - make uname.o - prev uname.c - prev uname.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -D_BLD_cmd -c uname.c - done uname.o generated - make uniq.o - prev uniq.c - prev uniq.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c uniq.c - done uniq.o generated - make vmstate.o - prev vmstate.c - prev vmstate.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c vmstate.c - done vmstate.o generated - make wc.o - prev wc.c - prev wc.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -c wc.c - done wc.o generated - make revlib.o - prev revlib.c - prev revlib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c revlib.c - done revlib.o generated - make wclib.o - prev wclib.c - prev wclib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c wclib.c - done wclib.o generated - make sumlib.o - bind -lsum - exec - ${AR} x ${mam_libsum} sumlib.o - done sumlib.o generated - make lib.o - prev lib.c - prev lib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_cmd -c lib.c - done lib.o generated - exec - ${AR} rc libcmd.a cmdinit.o basename.o cat.o chgrp.o chmod.o chown.o cksum.o cmp.o comm.o cp.o cut.o dirname.o date.o expr.o fds.o fmt.o fold.o getconf.o head.o id.o join.o ln.o logname.o md5sum.o mkdir.o mkfifo.o mktemp.o mv.o paste.o pathchk.o - exec - ${AR} rc libcmd.a pids.o rev.o rm.o rmdir.o stty.o sum.o sync.o tail.o tee.o tty.o uname.o uniq.o vmstate.o wc.o revlib.o wclib.o sumlib.o lib.o - exec - (ranlib libcmd.a) >/dev/null 2>&1 || true - done libcmd.a generated - done cmd virtual - prev libcmd.a - make ${INSTALLROOT}/lib - exec - if test ! -d ${INSTALLROOT}/lib - exec - then mkdir -p ${INSTALLROOT}/lib - exec - fi - done ${INSTALLROOT}/lib generated - make ${INSTALLROOT}/lib/libcmd.a archive - prev ${INSTALLROOT}/lib +setv LDFLAGS +setv CCLDFLAGS +setv DYLIB_VERSION 2.0 + +make install virtual + note * + note * AST header dependencies + note * TODO: verify and centralise + note * + + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + done + done + done + make ${PACKAGE_ast_INCLUDE}/fts.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + note * TODO * circular depencency + note # prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_map.h + prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + make ${PACKAGE_ast_INCLUDE}/ls.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_mode.h + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/option.h implicit + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/modex.h implicit + prev ${PACKAGE_ast_INCLUDE}/modecanon.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h + done + make ${PACKAGE_ast_INCLUDE}/sum.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/tmx.h implicit + make ${PACKAGE_ast_INCLUDE}/tv.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/tm.h implicit + make ${PACKAGE_ast_INCLUDE}/times.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_time.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + done + make ${PACKAGE_ast_INCLUDE}/stk.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio.h + done + make ${PACKAGE_ast_INCLUDE}/proc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/sfdisc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/lc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit + prev ${PACKAGE_ast_INCLUDE}/hashkey.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_tty.h implicit + prev ${PACKAGE_ast_INCLUDE}/sig.h implicit + + note * + note * Library dependencies + note * + + bind -lutil + bind -last + bind -lsum + make cmd.req + prev ${INSTALLROOT}/bin/mkreq + exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} : ${LDFLAGS} : cmd fsg md util ast + done + + note * + note * Header dependencies and feature tests + note * + + setv run_iffe iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libutil} ${mam_libast} : run + + make deps virtual + make cmdinit.c + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + make cmd.h implicit + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + prev ${PACKAGE_ast_INCLUDE}/stk.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done cmd.h + done cmdinit.c + make basename.c + prev cmd.h + done + make cat.c + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev cmd.h + done + make chgrp.c + make FEATURE/symlink implicit + prev features/symlink + exec - ${run_iffe} ${<} + done + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev cmd.h + done + make chmod.c + prev FEATURE/symlink + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make chown.c + prev cmd.h + done + make cksum.c + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/modex.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/sum.h + prev cmd.h + done + make cmp.c + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make comm.c + prev cmd.h + done + make cp.c + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev ${PACKAGE_ast_INCLUDE}/stk.h + prev ${PACKAGE_ast_INCLUDE}/hashkey.h + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/times.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make cut.c + prev cmd.h + done + make dirname.c + prev cmd.h + done + make date.c + prev ${PACKAGE_ast_INCLUDE}/times.h + prev ${PACKAGE_ast_INCLUDE}/tmx.h + prev ${PACKAGE_ast_INCLUDE}/proc.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make expr.c + prev ${PACKAGE_ast_INCLUDE}/regex.h + prev cmd.h + done + make fds.c + prev ${PACKAGE_ast_INCLUDE}/endian.h + make FEATURE/sockets implicit + prev features/sockets + exec - ${run_iffe} ${<} + done + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make fmt.c + prev cmd.h + done + make fold.c + prev cmd.h + done + make getconf.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev ${PACKAGE_ast_INCLUDE}/proc.h + prev cmd.h + done + make head.c + prev cmd.h + done + make id.c + prev ${PACKAGE_ast_INCLUDE}/stdio.h + make FEATURE/ids implicit + prev features/ids + exec - ${run_iffe} ${<} + done + prev cmd.h + done + make join.c + prev ${PACKAGE_ast_INCLUDE}/wctype.h + prev ${PACKAGE_ast_INCLUDE}/wchar.h + prev ${PACKAGE_ast_INCLUDE}/sfdisc.h + prev cmd.h + done + make ln.c + prev cmd.h + done + make logname.c + prev cmd.h + done + make md5sum.c + prev cmd.h + done + make mkdir.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make mkfifo.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make mktemp.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make mv.c + prev cmd.h + done + make paste.c + prev cmd.h + done + make pathchk.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make pids.c + prev ${PACKAGE_ast_INCLUDE}/sfdisc.h + prev ${PACKAGE_ast_INCLUDE}/ast_tty.h + prev cmd.h + done + make rev.c + prev rev.h implicit + prev cmd.h + done + make rm.c + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make rmdir.c + prev cmd.h + done + make stty.c + prev ${PACKAGE_ast_INCLUDE}/ast_tty.h + prev ${PACKAGE_ast_INCLUDE}/ccode.h + prev cmd.h + done + make sum.c + prev cmd.h + done + make sync.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make tail.c + prev rev.h + prev ${PACKAGE_ast_INCLUDE}/tv.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make tee.c + prev ${PACKAGE_ast_INCLUDE}/sig.h + prev ${PACKAGE_ast_INCLUDE}/ls.h + prev cmd.h + done + make tty.c + prev cmd.h + done + make uname.c + make FEATURE/utsname implicit + prev features/utsname + exec - ${run_iffe} ${<} + done + prev ${PACKAGE_ast_INCLUDE}/proc.h + prev cmd.h + done + make uniq.c + prev cmd.h + done + make vmstate.c + prev ${PACKAGE_ast_INCLUDE}/sfdisc.h + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + prev cmd.h + done + make wc.c + prev ${PACKAGE_ast_INCLUDE}/ls.h + make wc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + prev cmd.h + done + make revlib.c + prev rev.h + prev cmd.h + done + make wclib.c + prev ${PACKAGE_ast_INCLUDE}/lc.h + prev ${PACKAGE_ast_INCLUDE}/wctype.h + prev ${PACKAGE_ast_INCLUDE}/wchar.h + prev wc.h + prev cmd.h + done + make lib.c + prev cmd.h + done + done deps + + make cmdext.h implicit + prev cmdinit.c + prev basename.c + prev cat.c + prev chgrp.c + prev chmod.c + prev chown.c + prev cksum.c + prev cmp.c + prev comm.c + prev cp.c + prev cut.c + prev dirname.c + prev date.c + prev expr.c + prev fds.c + prev fmt.c + prev fold.c + prev getconf.c + prev head.c + prev id.c + prev join.c + prev ln.c + prev logname.c + prev md5sum.c + prev mkdir.c + prev mkfifo.c + prev mktemp.c + prev mv.c + prev paste.c + prev pathchk.c + prev pids.c + prev rev.c + prev rm.c + prev rmdir.c + prev stty.c + prev sum.c + prev sync.c + prev tail.c + prev tee.c + prev tty.c + prev uname.c + prev uniq.c + prev wc.c + prev revlib.c + prev wclib.c + prev lib.c + exec - { + exec - cat <<! + exec - /* + exec - * -lcmd extern function prototypes + exec - */ + exec - + exec - #include <shcmd.h> + exec - + exec - ! + exec - sed \ + exec - -e '/^b_a-z_a-z_0-9*(/!d' \ + exec - -e 's/^b_//' \ + exec - -e 's/(.*//' \ + exec - -e 's/.*/extern int b_&(int, char**, Shbltin_t*);/' \ + exec - ${^} | + exec - sort -u + exec - } > cmdext.h + prev vmstate.c + exec - { + exec - cat <<! + exec - #if _AST_vmalloc + exec - extern int b_vmstate(int, char**, Shbltin_t*); + exec - #endif + exec - ! + exec - } >> cmdext.h + prev ${PACKAGE_ast_INCLUDE}/shcmd.h + done + + note * + note * Build the library + note * + + make libcmd.a + loop OBJ cmdinit basename cat chgrp chmod chown cksum cmp comm cp cut dirname date expr fds fmt fold getconf head id join ln logname md5sum mkdir mkfifo mktemp mv paste pathchk pids rev rm rmdir stty sum sync tail tee tty uname uniq vmstate wc revlib wclib lib + make ${OBJ}.o + prev ${OBJ}.c + exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DHOSTTYPE=\""${mam_cc_HOSTTYPE}"\" -D_BLD_cmd -c ${<} + done + done + make sumlib.o + bind -lsum + exec - set -- ${mam_libsum} + exec - ${AR} x "$1" sumlib.o + done + exec - if test -f ${@} + exec - then ${AR} rc ${@} ${?} # add changed *.o + exec - else ${AR} rc ${@} ${^} # add all *.o + exec - fi || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + + note * save for dylink + setv _libcmd_object_files_ ${^} + done libcmd.a + + note * + note * Dynamically linked version, if supported + note * + + make ${INSTALLROOT}/dyn/lib/libcmd${mam_cc_SUFFIX_SHARED} dontcare + prev libcmd.a + prev cmd.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED}' + exec - dylink -m cmd -v ${DYLIB_VERSION} -s ${mam_cc_SUFFIX_SHARED} $(sed 1d cmd.req) ${_libcmd_object_files_} + done + + note * + note * pre-install + note * + + loop DIR make ${INSTALLROOT}/lib/lib ${PACKAGE_ast_INCLUDE} + make ${DIR} + exec - mkdir -p ${@} + done + done + make ${INSTALLROOT}/lib/libcmd.a prev libcmd.a - exec - ${STDCMP} 2>/dev/null -s libcmd.a ${INSTALLROOT}/lib/libcmd.a || { ${STDMV} ${INSTALLROOT}/lib/libcmd.a ${INSTALLROOT}/lib/libcmd.a.old 2>/dev/null || true; ${STDCP} libcmd.a ${INSTALLROOT}/lib/libcmd.a ;} - exec - (ranlib ${INSTALLROOT}/lib/libcmd.a) >/dev/null 2>&1 || true - done ${INSTALLROOT}/lib/libcmd.a generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + exec - cp -f ${<} ${@} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done make ${INSTALLROOT}/lib/lib/cmd - prev ${INSTALLROOT}/lib/lib prev cmd.req - exec - ${STDCMP} 2>/dev/null -s cmd.req ${INSTALLROOT}/lib/lib/cmd || { ${STDMV} ${INSTALLROOT}/lib/lib/cmd ${INSTALLROOT}/lib/lib/cmd.old 2>/dev/null || true; ${STDCP} cmd.req ${INSTALLROOT}/lib/lib/cmd ;} - done ${INSTALLROOT}/lib/lib/cmd generated - make ${PACKAGE_ast_INCLUDE} - exec - if test ! -d ${PACKAGE_ast_INCLUDE} - exec - then mkdir -p ${PACKAGE_ast_INCLUDE} - exec - fi - done ${PACKAGE_ast_INCLUDE} generated + exec - cp -f ${<} ${@} + done make ${PACKAGE_ast_INCLUDE}/cmd.h - prev ${PACKAGE_ast_INCLUDE} prev cmd.h - exec - if ! ${STDCMP} -s cmd.h ${PACKAGE_ast_INCLUDE}/cmd.h - exec - then ${STDCP} cmd.h ${PACKAGE_ast_INCLUDE}/cmd.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/cmd.h generated + exec - cp -f ${<} ${@} + done make ${PACKAGE_ast_INCLUDE}/cmdext.h prev cmdext.h - exec - if ! ${STDCMP} -s cmdext.h ${PACKAGE_ast_INCLUDE}/cmdext.h - exec - then ${STDCP} cmdext.h ${PACKAGE_ast_INCLUDE}/cmdext.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/cmdext.h generated + exec - cp -f ${<} ${@} + done make ${PACKAGE_ast_INCLUDE}/cmdlist.h make cmdlist.h prev cmdinit.c @@ -707,35 +569,37 @@ prev tty.c prev uname.c prev uniq.c - prev vmstate.c prev wc.c prev revlib.c prev wclib.c prev lib.c exec - { - exec - ${STDCAT} <<! + exec - cat <<! exec - /* exec - * -lcmd function list -- define your own CMDLIST() exec - */ exec - exec - ! exec - sed \ - exec - -e '/^b_a-z_a-z_0-9*(/!d' \ - exec - -e 's/^b_//' \ - exec - -e 's/(.*//' \ - exec - -e 's/.*/CMDLIST(&)/' \ - exec - | + exec - -e '/^b_a-z_a-z_0-9*(/!d' \ + exec - -e 's/^b_//' \ + exec - -e 's/(.*//' \ + exec - -e 's/.*/CMDLIST(&)/' \ + exec - ${^} | exec - sort -u - exec - } > 1.${COTEMP}.h - exec - if ${STDCMP} -s 1.${COTEMP}.h cmdlist.h - exec - then ${STDRM} -f 1.${COTEMP}.h - exec - else ${STDMV} 1.${COTEMP}.h cmdlist.h - exec - fi - done cmdlist.h generated - exec - if ! ${STDCMP} -s cmdlist.h ${PACKAGE_ast_INCLUDE}/cmdlist.h - exec - then ${STDCP} cmdlist.h ${PACKAGE_ast_INCLUDE}/cmdlist.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/cmdlist.h generated -done install virtual -make test -done test dontcare virtual + exec - } > ${@} + prev vmstate.c + exec - { + exec - cat <<! + exec - #if _AST_vmalloc + exec - CMDLIST(vmstate) + exec - #endif + exec - ! + exec - } >> ${@} + done cmdlist.h + exec - cp -f ${<} ${@} + done ${PACKAGE_ast_INCLUDE}/cmdlist.h +done install + +make test dontcare virtual +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/cat.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/cat.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -184,7 +184,7 @@ else { memcpy(tmp, pp, c); - if (!(nxt = (unsigned char*)(*reserve)(ip, SF_UNBOUND, 0))) + if (!(nxt = (unsigned char*)(*reserve)(ip, SFIO_UNBOUND, 0))) { states0 = sfvalue(ip) ? T_ERROR : T_EOF; *(cp = end = tmp + sizeof(tmp) - 1) = 0; @@ -268,7 +268,7 @@ goto flush; } c = last; - if (!(nxt = (unsigned char*)(*reserve)(ip, SF_UNBOUND, 0))) + if (!(nxt = (unsigned char*)(*reserve)(ip, SFIO_UNBOUND, 0))) { *(cp = end = tmp + sizeof(tmp) - 1) = 0; states0 = (m = sfvalue(ip)) ? T_ERROR : T_EOF; @@ -345,7 +345,7 @@ { if (cp < end || last != '\n') break; - if (!(nxt = (unsigned char*)(*reserve)(ip, SF_UNBOUND, 0))) + if (!(nxt = (unsigned char*)(*reserve)(ip, SFIO_UNBOUND, 0))) { states0 = sfvalue(ip) ? T_ERROR : T_EOF; cp = end = tmp; @@ -533,7 +533,7 @@ sfsetbuf(fp, fp, -1); if (dovcat) n = vcat(states, fp, sfstdout, reserve, flags); - else if (sfmove(fp, sfstdout, SF_UNBOUND, -1) >= 0 && sfeof(fp)) + else if (sfmove(fp, sfstdout, SFIO_UNBOUND, -1) >= 0 && sfeof(fp)) n = 0; else n = -1;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/chgrp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/chgrp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -217,8 +217,8 @@ Dt_t* map = 0; int logical = 1; int flags; - int uid; - int gid; + int uid = -1; + int gid = -1; char* op; char* usage; char* t; @@ -367,7 +367,7 @@ getids(s, &t, &key, options); if (!(m = (Map_t*)dtmatch(map, &key))) { - if (!(m = (Map_t*)stkalloc(stkstd, sizeof(Map_t)))) + if (!(m = stkalloc(stkstd, sizeof(Map_t)))) { error(ERROR_SYSTEM|ERROR_PANIC, "out of memory id dictionary"); UNREACHABLE();
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/chmod.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/chmod.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -144,7 +144,7 @@ int b_chmod(int argc, char** argv, Shbltin_t* context) { - int mode; + int mode = 0; int force = 0; int flags; char* amode = 0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/cksum.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/cksum.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -194,7 +194,7 @@ if (state->text) { peek = 0; - while (p = sfreserve(ip, SF_UNBOUND, 0)) + while (p = sfreserve(ip, SFIO_UNBOUND, 0)) { e = p + sfvalue(ip); if (peek) @@ -220,7 +220,7 @@ sumblock(state->sum, "\r", 1); } else - while (p = sfreserve(ip, SF_UNBOUND, 0)) + while (p = sfreserve(ip, SFIO_UNBOUND, 0)) sumblock(state->sum, p, sfvalue(ip)); if (sfvalue(ip)) error(ERROR_SYSTEM|2, "%s: read error", file); @@ -259,8 +259,8 @@ char* file; int attr; int mode; - int uid; - int gid; + int uid = -1; + int gid = -1; Sfio_t* sp; struct stat st;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/cmp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/cmp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -159,14 +159,14 @@ { if (count > 0 && !(count -= n1)) return ret; - if (!(p1 = (unsigned char*)sfreserve(f1, SF_UNBOUND, 0)) || (c1 = sfvalue(f1)) <= 0) + if (!(p1 = (unsigned char*)sfreserve(f1, SFIO_UNBOUND, 0)) || (c1 = sfvalue(f1)) <= 0) { if (sferror(f1)) { error(ERROR_exit(2), "read error on %s", file1); UNREACHABLE(); } - if ((e2 - p2) > 0 || sfreserve(f2, SF_UNBOUND, 0) && sfvalue(f2) > 0) + if ((e2 - p2) > 0 || sfreserve(f2, SFIO_UNBOUND, 0) && sfvalue(f2) > 0) { ret = 1; if (!(flags & CMP_SILENT)) @@ -189,7 +189,7 @@ } if ((c2 = e2 - p2) <= 0) { - if (!(p2 = (unsigned char*)sfreserve(f2, SF_UNBOUND, 0)) || (c2 = sfvalue(f2)) <= 0) + if (!(p2 = (unsigned char*)sfreserve(f2, SFIO_UNBOUND, 0)) || (c2 = sfvalue(f2)) <= 0) { if (sferror(f2)) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/comm.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/comm.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -63,7 +63,7 @@ static int comm(Sfio_t *in1, Sfio_t *in2, Sfio_t *out,int mode) { char *cp1, *cp2; - int n1, n2, n, comp; + int n1 = 0, n2 = 0, n, comp; if(cp1 = sfgetr(in1,'\n',0)) n1 = sfvalue(in1); if(cp2 = sfgetr(in2,'\n',0)) @@ -138,7 +138,7 @@ return 0; n1 = sfvalue(in1); } - /* NOT REACHED */ + UNREACHABLE(); } int
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/cp.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/cp.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -232,9 +232,7 @@ char* base; int n; int len; - int rm; - int rfd; - int wfd; + int rm = state->remove || ent->fts_info == FTS_SL; int m; int v; char* s; @@ -430,7 +428,6 @@ } if (state->verbose) sfputr(sfstdout, state->path, '\n'); - rm = state->remove || ent->fts_info == FTS_SL; if (!rm || !state->force) { if (S_ISLNK(st.st_mode) && (n = -1) || (n = open(state->path, O_RDWR|O_BINARY|O_cloexec)) >= 0) @@ -576,6 +573,8 @@ } else if (state->op == CP || S_ISREG(ent->fts_statp->st_mode) || S_ISDIR(ent->fts_statp->st_mode)) { + int rfd = -1; + int wfd = -1; if (ent->fts_statp->st_size > 0 && (rfd = open(ent->fts_path, O_RDONLY|O_BINARY|O_cloexec)) < 0) { error(ERROR_SYSTEM|2, "%s: cannot read", ent->fts_path); @@ -590,14 +589,14 @@ } else if (ent->fts_statp->st_size > 0) { - if (!(ip = sfnew(NULL, NULL, SF_UNBOUND, rfd, SF_READ))) + if (!(ip = sfnew(NULL, NULL, SFIO_UNBOUND, rfd, SFIO_READ))) { error(ERROR_SYSTEM|2, "%s: %s read stream error", ent->fts_path, state->path); close(rfd); close(wfd); return 0; } - if (!(op = sfnew(NULL, NULL, SF_UNBOUND, wfd, SF_WRITE))) + if (!(op = sfnew(NULL, NULL, SFIO_UNBOUND, wfd, SFIO_WRITE))) { error(ERROR_SYSTEM|2, "%s: %s write stream error", ent->fts_path, state->path); close(wfd); @@ -605,7 +604,7 @@ return 0; } n = 0; - if (sfmove(ip, op, (Sfoff_t)SF_UNBOUND, -1) < 0) + if (sfmove(ip, op, (Sfoff_t)SFIO_UNBOUND, -1) < 0) n |= 3; if (!sfeof(ip)) n |= 1; @@ -671,7 +670,7 @@ FTS* fts; FTSENT* ent; const char* usage; - int path_resolve; + int path_resolve = 0; int standard; struct stat st; State_t* state; @@ -873,7 +872,7 @@ argc--; argv++; } - if (!(v = (char**)stkalloc(stkstd, (argc + 2) * sizeof(char*)))) + if (!(v = stkalloc(stkstd, (argc + 2) * sizeof(char*)))) { error(ERROR_SYSTEM|ERROR_PANIC, "out of memory"); UNREACHABLE();
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/cut.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/cut.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -134,7 +134,7 @@ char* cp = str; Cut_t* cut; - if (!(cut = (Cut_t*)stkalloc(stkstd, sizeof(Cut_t) + strlen(cp) * sizeof(int)))) + if (!(cut = stkalloc(stkstd, sizeof(Cut_t) + strlen(cp) * sizeof(int)))) { error(ERROR_SYSTEM|ERROR_PANIC, "out of memory"); UNREACHABLE(); @@ -275,7 +275,7 @@ bp = sfreserve(fdin, len, -1); else bp = sfgetr(fdin, '\n', 0); - if (!bp && !(bp = sfgetr(fdin, 0, SF_LASTR))) + if (!bp && !(bp = sfgetr(fdin, 0, SFIO_LASTR))) break; len = sfvalue(fdin); xx = 0; @@ -375,19 +375,19 @@ unsigned char *sp = cut->space; unsigned char *cp; unsigned char *wp; - int c, nfields; + int c, nfields=0; const int *lp = cut->list; unsigned char *copy; - int nodelim, empty, inword=0; + int nodelim=0, empty=0, inword=0; unsigned char *ep; - unsigned char *bp, *first; + unsigned char *bp, *first=NULL; int lastchar; wchar_t w; Sfio_t *fdtmp = 0; long offset = 0; unsigned char mb8; /* process each buffer */ - while ((bp = (unsigned char*)sfreserve(fdin, SF_UNBOUND, -1)) && (c = sfvalue(fdin)) > 0) + while ((bp = (unsigned char*)sfreserve(fdin, SFIO_UNBOUND, -1)) && (c = sfvalue(fdin)) > 0) { cp = bp; ep = cp + --c; @@ -444,7 +444,7 @@ } for (i = 0; i <= (ep - cp); i++) mbi = cpi; - if (!(bp = (unsigned char*)sfreserve(fdin, SF_UNBOUND, -1)) || (c = sfvalue(fdin)) <= 0) + if (!(bp = (unsigned char*)sfreserve(fdin, SFIO_UNBOUND, -1)) || (c = sfvalue(fdin)) <= 0) goto failed; cp = bp; ep = cp + --c;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/expr.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/expr.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -434,7 +434,7 @@ while ((tok&~T_OP)==T_CMP) { Node_t rp; - char *left,*right; + char *left = NULL, *right = NULL; char buff136,buff236; int op = (tok&T_OP); tok = expr_add(state, &rp);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/fds.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/fds.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -39,6 +39,10 @@ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> +#if __ANDROID_API__ +/* Android declares ntohs(3) here, not in arpa/inet.h as POSIX mandates */ +#include <sys/endian.h> +#endif /* __ANDROID_API__ */ #else #undef S_IFSOCK #endif @@ -217,7 +221,7 @@ } if (unit == 1) sp = sfstdout; - else if (fstat(unit, &st) || !(sp = sfnew(NULL, NULL, SF_UNBOUND, unit, SF_WRITE))) + else if (fstat(unit, &st) || !(sp = sfnew(NULL, NULL, SFIO_UNBOUND, unit, SFIO_WRITE))) { error(ERROR_SYSTEM|3, "%d: cannot write to file descriptor"); UNREACHABLE();
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/fmt.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/fmt.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -239,7 +239,7 @@ char buf8192; cp = 0; - while (cp || (cp = sfgetr(fp->in, '\n', 0)) && !(splice = 0) && (lp = cp + sfvalue(fp->in) - 1) || (cp = sfgetr(fp->in, '\n', SF_LASTR)) && (splice = 1) && (lp = cp + sfvalue(fp->in))) + while (cp || (cp = sfgetr(fp->in, '\n', 0)) && !(splice = 0) && (lp = cp + sfvalue(fp->in) - 1) || (cp = sfgetr(fp->in, '\n', SFIO_LASTR)) && (splice = 1) && (lp = cp + sfvalue(fp->in))) { if (isoption(fp, 'o')) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/getconf.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/getconf.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -24,7 +24,7 @@ */ static const char usage = -"-?\n@(#)$Id: getconf (ksh 93u+m) 2021-04-20 $\n" +"-?\n@(#)$Id: getconf (ksh 93u+m) 2024-02-09 $\n" "--catalog?" ERROR_CATALOG "" "+NAME?getconf - get configuration values" "+DESCRIPTION?\bgetconf\b displays the system configuration value for" @@ -131,7 +131,7 @@ b_getconf(int argc, char** argv, Shbltin_t* context) { char* name; - char* path; + char* path = NULL; char* value; const char* s; char* pattern; @@ -139,6 +139,7 @@ int flags; int n; char** oargv; + char** new_argv; static const char empty = "-"; cmdinit(argc, argv, context, ERROR_CATALOG, 0); @@ -208,9 +209,8 @@ break; } argv += opt_info.index; - if (!(name = *argv)) - path = 0; - else if (streq(name, empty)) + name = *argv; + if (name && streq(name, empty)) { name = 0; if (path = *++argv) @@ -275,8 +275,12 @@ /* * Run the external getconf command */ - oargv0 = native; - if ((n = sh_run(context, argc, oargv)) >= EXIT_NOEXEC) + new_argv = stkalloc(stkstd, (argc + 3) * sizeof(char*)); + new_argv0 = "command"; + new_argv1 = "-x"; + new_argv2 = native; + memcpy(new_argv + 3, oargv + 1, argc * sizeof(char*)); + if ((n = sh_run(context, argc + 2, new_argv)) >= EXIT_NOEXEC) error(ERROR_SYSTEM|2, "%s: exec error %d", native, n); return n; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/head.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/head.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -131,7 +131,7 @@ { cp = "/dev/stdin"; fp = sfstdin; - sfset(fp, SF_SHARE, 1); + sfset(fp, SFIO_SHARE, 1); } else if (!(fp = sfopen(NULL, cp, "r"))) { @@ -149,7 +149,7 @@ goto next; } if ((moved = sfmove(fp, sfstdout, keep, delim)) < 0 && !ERROR_PIPE(errno) && errno != EINTR || - delim >= 0 && moved < keep && sfmove(fp, sfstdout, SF_UNBOUND, -1) < 0 && !ERROR_PIPE(errno) && errno != EINTR) + delim >= 0 && moved < keep && sfmove(fp, sfstdout, SFIO_UNBOUND, -1) < 0 && !ERROR_PIPE(errno) && errno != EINTR) error(ERROR_system(0), "%s: read error", cp); next: if (fp != sfstdin)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/id.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/id.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -204,10 +204,10 @@ char* s; int lastchar; int ngroups = 0; - const char* gname; - uid_t user; + const char* gname = NULL; + uid_t user = 0; uid_t euid; - gid_t group; + gid_t group = 0; gid_t egid; static gid_t* groups;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/join.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/join.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -468,7 +468,7 @@ cpmax = fp->fieldsn.end + 1; } else - cp = 0; + cp = cpmax = NULL; if ((n = jp->delim) == -1) { if (cp && fp->spaces) @@ -970,8 +970,8 @@ } if (jp->buffered) { - sfsetbuf(jp->file0.iop, jp->file0.iop, SF_UNBOUND); - sfsetbuf(jp->file1.iop, jp->file1.iop, SF_UNBOUND); + sfsetbuf(jp->file0.iop, jp->file0.iop, SFIO_UNBOUND); + sfsetbuf(jp->file1.iop, jp->file1.iop, SFIO_UNBOUND); } jp->outfile = sfstdout; if (!jp->outlist)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/mkdir.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/mkdir.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -70,7 +70,7 @@ int vflag = 0; int made; char* part; - mode_t dmode; + mode_t dmode = 0; struct stat st; cmdinit(argc, argv, context, ERROR_CATALOG, 0);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/paste.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/paste.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -172,7 +172,7 @@ b_paste(int argc, char** argv, Shbltin_t* context) { int n, sflag=0; - Sfio_t *fp, **streams; + Sfio_t *fp, **streams = NULL; char *cp, *delim; char *ep; Delim_t *mp; @@ -257,7 +257,7 @@ n = 1; if(!sflag) { - if (!(streams = (Sfio_t**)stkalloc(stkstd,n*sizeof(Sfio_t*)))) + if (!(streams = stkalloc(stkstd,n*sizeof(Sfio_t*)))) { error(ERROR_SYSTEM|ERROR_PANIC, "out of memory"); UNREACHABLE();
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/pathchk.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/pathchk.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -74,6 +74,13 @@ #include <cmd.h> #include <ls.h> +#ifndef _POSIX_NAME_MAX +#define _POSIX_NAME_MAX 14 +#endif +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX 256 +#endif + #define COMPONENTS 0x1 #define PATH 0x2
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/revlib.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/revlib.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,7 +22,7 @@ #include <cmd.h> #include <rev.h> -#define BUFSIZE SF_BUFSIZE +#define BUFSIZE SFIO_BUFSIZE #define rounddown(n,size) (((n)-1)&~((size)-1)) /* @@ -37,12 +37,12 @@ off_t offset; if(sfseek(in,0,SEEK_CUR) < 0) { - Sfio_t *tmp = sftmp(4*SF_BUFSIZE); + Sfio_t *tmp = sftmp(4*SFIO_BUFSIZE); if(!tmp) return -1; if(start>0 && sfmove(in, NULL, start, -1) != start) return -1; - if(sfmove(in, tmp, SF_UNBOUND, -1) < 0 || !sfeof(in) || sferror(tmp)) + if(sfmove(in, tmp, SFIO_UNBOUND, -1) < 0 || !sfeof(in) || sferror(tmp)) return -1; in = tmp; start=0;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/rm.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/rm.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -87,7 +87,7 @@ int unconditional; /* enable dir rwx on preorder */ int verbose; /* display each file */ #if _lib_fsync - char bufSF_BUFSIZE;/* clobber buffer */ + char bufSFIO_BUFSIZE;/* clobber buffer */ #endif } State_t;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/stty.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/stty.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -928,15 +928,6 @@ 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, Shbltin_t* context) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/tail.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/tail.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2013 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -176,11 +176,11 @@ incomplete = 1; for (;;) { - if ((offset = last - SF_BUFSIZE) < first) + if ((offset = last - SFIO_BUFSIZE) < first) offset = first; sfseek(fp, offset, SEEK_SET); n = last - offset; - if (!(s = sfreserve(fp, n, SF_LOCKR))) + if (!(s = sfreserve(fp, n, SFIO_LOCKR))) return -1; t = s + n; if (incomplete) @@ -216,7 +216,7 @@ Sfio_t* out; Sfoff_t n; Sfoff_t nleft = number; - size_t a = 2 * SF_BUFSIZE; + size_t a = 2 * SFIO_BUFSIZE; int fno = 0; Sfoff_t offset2; Sfio_t* tmp2; @@ -292,12 +292,12 @@ error(ERROR_system(0), "%s: cannot open", tp->name); return -1; } - sfset(tp->sp, SF_SHARE, 0); + sfset(tp->sp, SFIO_SHARE, 0); if (offset) { if (number < 0 || !number && (flags & POSITIVE)) { - sfset(tp->sp, SF_SHARE, !(flags & FOLLOW)); + sfset(tp->sp, SFIO_SHARE, !(flags & FOLLOW)); if (number < -1) { sfmove(tp->sp, NULL, -number - 1, delim); @@ -326,7 +326,7 @@ sfprintf(sfstdout, *format, tp->name); *format = header_fmt; } - op = (flags & REVERSE) ? sftmp(4*SF_BUFSIZE) : sfstdout; + op = (flags & REVERSE) ? sftmp(4*SFIO_BUFSIZE) : sfstdout; pipetail(tp->sp ? tp->sp : sfstdin, op, number, delim); if (flags & REVERSE) { @@ -629,7 +629,7 @@ } if (flags & FOLLOW) { - if (!(fp = (Tail_t*)stkalloc(stkstd, argc * sizeof(Tail_t)))) + if (!(fp = stkalloc(stkstd, argc * sizeof(Tail_t)))) { error(ERROR_SYSTEM|ERROR_PANIC, "out of memory"); UNREACHABLE(); @@ -677,9 +677,9 @@ n = 1; if (timeout) fp->expire = NOW + timeout; - z = fp->fifo ? SF_UNBOUND : st.st_size - fp->cur; + z = fp->fifo ? SFIO_UNBOUND : st.st_size - fp->cur; i = 0; - if ((s = sfreserve(fp->sp, z, SF_LOCKR)) || (z = sfvalue(fp->sp)) && (s = sfreserve(fp->sp, z, SF_LOCKR)) && (i = 1)) + if ((s = sfreserve(fp->sp, z, SFIO_LOCKR)) || (z = sfvalue(fp->sp)) && (s = sfreserve(fp->sp, z, SFIO_LOCKR)) && (i = 1)) { z = sfvalue(fp->sp); for (r = s + z; r > s && *(r - 1) != '\n'; r--); @@ -773,17 +773,17 @@ } if (number < 0 || !number && (flags & POSITIVE)) { - sfset(ip, SF_SHARE, 1); + sfset(ip, SFIO_SHARE, 1); if (number < -1 && (moved = sfmove(ip, NULL, -(number + 1), delim)) >= 0 && delim >= 0 && moved < -(number + 1)) - (void)sfgetr(ip, delim, SF_LASTR); + (void)sfgetr(ip, delim, SFIO_LASTR); if (flags & REVERSE) rev_line(ip, sfstdout, sfseek(ip, 0, SEEK_CUR)); else - sfmove(ip, sfstdout, SF_UNBOUND, -1); + sfmove(ip, sfstdout, SFIO_UNBOUND, -1); } else { - sfset(ip, SF_SHARE, 0); + sfset(ip, SFIO_SHARE, 0); if ((offset = tailpos(ip, number, delim)) >= 0) { if (flags & REVERSE) @@ -791,12 +791,12 @@ else { sfseek(ip, offset, SEEK_SET); - sfmove(ip, sfstdout, SF_UNBOUND, -1); + sfmove(ip, sfstdout, SFIO_UNBOUND, -1); } } else { - op = (flags & REVERSE) ? sftmp(4*SF_BUFSIZE) : sfstdout; + op = (flags & REVERSE) ? sftmp(4*SFIO_BUFSIZE) : sfstdout; pipetail(ip, op, number, delim); if (flags & REVERSE) {
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/tee.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/tee.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -97,7 +97,7 @@ { sfdisc(sfstdout, NULL); if (tp->line >= 0) - sfset(sfstdout, SF_LINE, tp->line); + sfset(sfstdout, SFIO_LINE, tp->line); for (hp = tp->fd; (n = *hp) >= 0; hp++) close(n); } @@ -135,11 +135,11 @@ signal(SIGINT, SIG_IGN); continue; case 'l': - line = sfset(sfstdout, 0, 0) & SF_LINE; + line = sfset(sfstdout, 0, 0) & SFIO_LINE; if ((line == 0) == (opt_info.num == 0)) line = -1; else - sfset(sfstdout, SF_LINE, !!opt_info.num); + sfset(sfstdout, SFIO_LINE, !!opt_info.num); continue; case ':': error(2, "%s", opt_info.arg); @@ -167,7 +167,7 @@ #endif if (argc > 0) { - if (tp = (Tee_t*)stkalloc(stkstd, sizeof(Tee_t) + argc * sizeof(int))) + if (tp = stkalloc(stkstd, sizeof(Tee_t) + argc * sizeof(int))) { memset(&tp->disc, 0, sizeof(tp->disc)); tp->disc.writef = tee_write; @@ -198,7 +198,7 @@ UNREACHABLE(); } } - if ((sfmove(sfstdin, sfstdout, SF_UNBOUND, -1) < 0 || !sfeof(sfstdin)) && !ERROR_PIPE(errno) && errno != EINTR) + if ((sfmove(sfstdin, sfstdout, SFIO_UNBOUND, -1) < 0 || !sfeof(sfstdin)) && !ERROR_PIPE(errno) && errno != EINTR) error(ERROR_system(0), "read error"); if (sfsync(sfstdout)) error(ERROR_system(0), "write error");
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/uname.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/uname.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -66,11 +66,6 @@ " \bsysconf\b(3), \bsysinfo\b(2)" ; -#define getdomainname ______getdomainname -#define gethostid ______gethostid -#define gethostname ______gethostname -#define sethostname ______sethostname - #include <cmd.h> #include <ctype.h> #include <stdio.h> @@ -84,24 +79,6 @@ # include <sys/utsname.h> #endif -#undef getdomainname -#undef gethostid -#undef gethostname -#undef sethostname - -#if _lib_getdomainname -extern int getdomainname(char*, size_t); -#endif -#if _lib_gethostid -extern long gethostid(void); -#endif -#if _lib_gethostname -extern int gethostname(char*, size_t); -#endif -#if _lib_sethostname -extern int sethostname(const char*, size_t); -#endif - #ifndef HOSTTYPE #define HOSTTYPE "unknown" #endif @@ -142,7 +119,7 @@ sys = 0; } #endif -#ifdef _lib_gethostname +#if _lib_gethostname if (gethostname(ut->nodename, sizeof(ut->nodename) - 1)) return -1; #else @@ -297,7 +274,7 @@ continue; case ':': { - char **new_argv = (char **)stkalloc(stkstd, (argc + 3) * sizeof(char*)); + char **new_argv = stkalloc(stkstd, (argc + 3) * sizeof(char*)); new_argv0 = "command"; new_argv1 = "-px"; for (n = 0; n <= argc; n++)
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/uniq.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/uniq.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -82,8 +82,8 @@ static int uniq(Sfio_t *fdin, Sfio_t *fdout, int fields, int chars, int width, int mode, int* all, Compare_f compare) { int n, f, outsize=0, mb = mbwide(); - char *cp, *ep, *mp, *bufp, *outp; - char *orecp, *sbufp=0, *outbuff; + char *cp=NULL, *ep, *mp, *bufp, *outp=NULL; + char *orecp=NULL, *sbufp=0, *outbuff; int reclen,oreclen= -1,count=0,cwidth=0,sep,next; if(mode&C_FLAG) cwidth = CWIDTH+1; @@ -91,7 +91,7 @@ { if(bufp = sfgetr(fdin,'\n',0)) n = sfvalue(fdin); - else if(bufp = sfgetr(fdin,'\n',SF_LASTR)) + else if(bufp = sfgetr(fdin,'\n',SFIO_LASTR)) { n = sfvalue(fdin); bufp = memcpy(fmtbuf(n + 1), bufp, n);
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libcmd/wclib.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libcmd/wclib.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1992-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -56,7 +56,7 @@ int w; Wc_t* wp; - if (!(wp = (Wc_t*)stkalloc(stkstd,sizeof(Wc_t)))) + if (!(wp = stkalloc(stkstd,sizeof(Wc_t)))) return NULL; if (!mbwide()) wp->mb = 0; @@ -175,7 +175,7 @@ wchar_t x; unsigned char side32; - sfset(fd,SF_WRITE,1); + sfset(fd,SFIO_WRITE,1); nlines = nwords = nchars = nbytes = 0; wp->longest = 0; if (wp->mb < 0 && (wp->mode & (WC_MBYTE|WC_WORDS))) @@ -196,7 +196,7 @@ else o = 0; cp = side + o; - if (!(buff = (unsigned char*)sfreserve(fd, SF_UNBOUND, 0)) || (n = sfvalue(fd)) <= 0) + if (!(buff = (unsigned char*)sfreserve(fd, SFIO_UNBOUND, 0)) || (n = sfvalue(fd)) <= 0) { if ((nchars - longest) > wp->longest) wp->longest = nchars - longest; @@ -252,7 +252,7 @@ { if (!(wp->mode & (WC_MBYTE|WC_WORDS|WC_LONGEST))) { - while ((cp = (unsigned char*)sfreserve(fd, SF_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) + while ((cp = (unsigned char*)sfreserve(fd, SFIO_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) { nchars += c; endbuff = cp + c; @@ -271,7 +271,7 @@ } else { - while ((cp = buff = (unsigned char*)sfreserve(fd, SF_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) + while ((cp = buff = (unsigned char*)sfreserve(fd, SFIO_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) { nchars += c; /* check to see whether first character terminates word */ @@ -333,7 +333,7 @@ int skip=0; int adjust=0; int state=0; - int oldc; + int oldc=0; int xspace; int wasspace = 1; unsigned char* start; @@ -342,7 +342,7 @@ lastchar = 0; start = (endbuff = side) + 1; xspace = iswspace(0xa0) || iswspace(0x85); - while ((cp = buff = (unsigned char*)sfreserve(fd, SF_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) + while ((cp = buff = (unsigned char*)sfreserve(fd, SFIO_UNBOUND, 0)) && (c = sfvalue(fd)) > 0) { nbytes += c; nchars += c;
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libdll/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libdll/Mamfile
Changed
@@ -1,227 +1,230 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} setv CC cc -setv mam_cc_FLAGS ${mam_cc_DLL} -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} -setv COTEMP $$ +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCFLAGS setv IFFEFLAGS setv LDFLAGS -make install - make dll - make dll.req - prev ${INSTALLROOT}/bin/mkreq - exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} : ${LDFLAGS} : dll dl dld ast - done dll.req generated - make libdll.a archive - prev dll.req - make dlfcn.o - make dlfcn.c - prev dll.h implicit dontcare virtual - prev xcoff.h implicit dontcare virtual - prev dl.h implicit dontcare virtual - make ${PACKAGE_ast_INCLUDE}/error.h implicit - make ${PACKAGE_ast_INCLUDE}/option.h implicit - make ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/bytesex.h - done ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_common.h - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - done ${PACKAGE_ast_INCLUDE}/wchar.h - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h - done ${PACKAGE_ast_INCLUDE}/wctype.h - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h - done ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/ast_map.h - prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_sys.h - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/vmalloc.h - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/option.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done ${PACKAGE_ast_INCLUDE}/error.h - make dlldefs.h implicit - make FEATURE/dll - prev features/dll - bind -ldl dontcare - bind -last - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll - done FEATURE/dll generated - exec - ${STDCMP} -s FEATURE/dll dlldefs.h || { ${STDRM} -f dlldefs.h; ${STDCP} FEATURE/dll dlldefs.h; } - done dlldefs.h generated - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dlfcn.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dlfcn.c - done dlfcn.o generated - make dllopen.o - make dllopen.c - make dlllib.h implicit - prev ${PACKAGE_ast_INCLUDE}/error.h - prev dlldefs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dlllib.h - done dllopen.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllopen.c - done dllopen.o generated - make dllfind.o - make dllfind.c - prev ${PACKAGE_ast_INCLUDE}/error.h - prev dlldefs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dllfind.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllfind.c - done dllfind.o generated - make dllplug.o - make dllplug.c - prev dlllib.h - done dllplug.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllplug.c - done dllplug.o generated - make dll_lib.o - make dll_lib.c - prev dlllib.h - done dll_lib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dll_lib.c - done dll_lib.o generated - make dllnext.o - make dllnext.c - prev rld_interface.h implicit dontcare virtual - prev dlldefs.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dllnext.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllnext.c - done dllnext.o generated - make dlllook.o - make dlllook.c - prev dlldefs.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dlllook.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dlllook.c - done dlllook.o generated - make dllscan.o - make dllscan.c - prev dlldefs.h - prev ${PACKAGE_ast_INCLUDE}/vmalloc.h - make ${PACKAGE_ast_INCLUDE}/fts.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/fts.h - prev ${PACKAGE_ast_INCLUDE}/error.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/cdt.h implicit +setv CCLDFLAGS +setv DYLIB_VERSION 2.0 + +make install virtual + note * + note * AST header dependencies + note * TODO: verify and centralise + note * + + make ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/option.h implicit + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_map.h + prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/cdt.h - prev ${PACKAGE_ast_INCLUDE}/ast.h - done dllscan.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllscan.c - done dllscan.o generated - make dllcheck.o - make dllcheck.c - prev dlllib.h - done dllcheck.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllcheck.c - done dllcheck.o generated - make dllerror.o - make dllerror.c - prev dlllib.h - done dllerror.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c dllerror.c - done dllerror.o generated - exec - ${AR} rc libdll.a dlfcn.o dllopen.o dllfind.o dllplug.o dll_lib.o dllnext.o dlllook.o dllscan.o dllcheck.o dllerror.o - exec - (ranlib libdll.a) >/dev/null 2>&1 || true - done libdll.a generated - done dll virtual - prev libdll.a - make ${INSTALLROOT}/lib - exec - if test ! -d ${INSTALLROOT}/lib - exec - then mkdir -p ${INSTALLROOT}/lib - exec - fi - done ${INSTALLROOT}/lib generated - make ${INSTALLROOT}/lib/libdll.a archive - prev ${INSTALLROOT}/lib + done + done + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make ${PACKAGE_ast_INCLUDE}/fts.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + make ${PACKAGE_ast_INCLUDE}/cdt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + + note * + note * Library dependencies + note * + + bind -ldl dontcare + bind -last + make dll.req + prev ${INSTALLROOT}/bin/mkreq + exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} : ${LDFLAGS} : dll dl dld ast + done + + note * + note * Header dependencies and feature tests + note * + + make dlfcn.c + prev ${PACKAGE_ast_INCLUDE}/error.h + make dlldefs.h implicit + make FEATURE/dll + prev features/dll + exec - iffe ${IFFEFLAGS} -v -c \ + exec - '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS}' \ + exec - ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} \ + exec - -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include \ + exec - ${mam_libdl} ${mam_libast} : run ${<} + done + exec - cp -f ${<} ${@} + done + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make dllopen.c + make dlllib.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h + prev dlldefs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + done + make dllfind.c + prev ${PACKAGE_ast_INCLUDE}/error.h + prev dlldefs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make dllplug.c + prev dlllib.h + done + make dll_lib.c + prev dlllib.h + done + make dllnext.c + prev dlldefs.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make dlllook.c + prev dlldefs.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make dllscan.c + prev dlldefs.h + prev ${PACKAGE_ast_INCLUDE}/vmalloc.h + prev ${PACKAGE_ast_INCLUDE}/fts.h + prev ${PACKAGE_ast_INCLUDE}/error.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + prev ${PACKAGE_ast_INCLUDE}/cdt.h + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make dllcheck.c + prev dlllib.h + done + make dllerror.c + prev dlllib.h + done + + note * + note * Make the library + note * + + make libdll.a + loop OBJ dlfcn dllopen dllfind dllplug dll_lib dllnext dlllook dllscan dllcheck dllerror + make ${OBJ}.o + prev ${OBJ}.c + exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -c ${<} + done + done + exec - if test -f ${@} + exec - then ${AR} rc ${@} ${?} # add changed *.o + exec - else ${AR} rc ${@} ${^} # add all *.o + exec - fi || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + + note * save for dylink + setv _libdll_object_files_ ${^} + done libdll.a + + note * + note * Dynamically linked version, if supported + note * + + make ${INSTALLROOT}/dyn/lib/libdll${mam_cc_SUFFIX_SHARED} dontcare + prev libdll.a + prev dll.req + exec - export LDFLAGS='${LDFLAGS} ${CCLDFLAGS} ${mam_cc_LD_NOASNEEDED}' + exec - dylink -m dll -v ${DYLIB_VERSION} -s ${mam_cc_SUFFIX_SHARED} $(sed 1d dll.req) ${_libdll_object_files_} + done + + note * + note * pre-install + note * + + loop DIR ${INSTALLROOT}/lib/lib ${PACKAGE_ast_INCLUDE} + make ${DIR} + exec - mkdir -p ${@} + done + done + make ${INSTALLROOT}/lib/libdll.a prev libdll.a - exec - ${STDCMP} 2>/dev/null -s libdll.a ${INSTALLROOT}/lib/libdll.a || { ${STDMV} ${INSTALLROOT}/lib/libdll.a ${INSTALLROOT}/lib/libdll.a.old 2>/dev/null || true; ${STDCP} libdll.a ${INSTALLROOT}/lib/libdll.a ;} - exec - (ranlib ${INSTALLROOT}/lib/libdll.a) >/dev/null 2>&1 || true - done ${INSTALLROOT}/lib/libdll.a generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + exec - cp -f ${<} ${@} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done make ${INSTALLROOT}/lib/lib/dll - prev ${INSTALLROOT}/lib/lib prev dll.req - exec - ${STDCMP} 2>/dev/null -s dll.req ${INSTALLROOT}/lib/lib/dll || { ${STDMV} ${INSTALLROOT}/lib/lib/dll ${INSTALLROOT}/lib/lib/dll.old 2>/dev/null || true; ${STDCP} dll.req ${INSTALLROOT}/lib/lib/dll ;} - done ${INSTALLROOT}/lib/lib/dll generated - make ${PACKAGE_ast_INCLUDE} - exec - if test ! -d ${PACKAGE_ast_INCLUDE} - exec - then mkdir -p ${PACKAGE_ast_INCLUDE} - exec - fi - done ${PACKAGE_ast_INCLUDE} generated + exec - cp -f ${<} ${@} + done make ${PACKAGE_ast_INCLUDE}/dlldefs.h - prev ${PACKAGE_ast_INCLUDE} prev dlldefs.h - exec - if ! ${STDCMP} -s dlldefs.h ${PACKAGE_ast_INCLUDE}/dlldefs.h - exec - then ${STDCP} dlldefs.h ${PACKAGE_ast_INCLUDE}/dlldefs.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/dlldefs.h generated -done install virtual -make test -done test dontcare virtual + exec - cp -f ${<} ${@} + done +done install + +make test dontcare virtual +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libdll/dlfcn.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libdll/dlfcn.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1997-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -23,8 +23,6 @@ * AT&T Research */ -static const char id = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\n"; - #include <ast.h> #include <dlldefs.h> #include <error.h>
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libdll/dllscan.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libdll/dllscan.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1997-2012 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -103,7 +103,8 @@ s++; if (*s) { - h = 0; + h = NULL; + vn = 0; for (;;) { for (d = s; *s && *s != ':' && *s != ','; s++); @@ -145,6 +146,8 @@ } if (v && vn < sizeof(info.envbuf)) { + if(vn <= 0) + abort(); memcpy(info.envbuf, v, vn); info.env = info.envbuf; }
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libsum/Mamfile -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libsum/Mamfile
Changed
@@ -1,168 +1,169 @@ note * -note * This build file is in the Make Abstract Machine (MAM) language. It was -note * first generated by nmake, but in the ksh 93u+m distribution we maintain -note * it manually because nmake had too many problems to keep using. The -note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added -note * indentation to improve readability. The language is documented in -note * src/cmd/INIT/README-mamake.md. +note * This build script is in an extended Make Abstract Machine (MAM) +note * language. Documentation is at: src/cmd/INIT/README-mamake.md note * -setv MAMAKE_STRICT + +setv MAMAKE_STRICT 3 setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} setv CC cc -setv mam_cc_FLAGS ${mam_cc_PIC} -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} -setv COTEMP $$ +setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} +setv mam_cc_FLAGS ${mam_cc_TARGET} ${mam_cc_DLL} ${mam_cc_PIC} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} +setv CCFLAGS setv IFFEFLAGS setv LDFLAGS -make install - make sum - make sum.req - prev ${INSTALLROOT}/bin/mkreq - exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} : ${LDFLAGS} : sum md ast - done sum.req generated - make libsum.a archive - prev sum.req - make sumlib.o - make sumlib.c - make sum-sha2.c implicit - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/bytesex.h - done ${PACKAGE_ast_INCLUDE}/endian.h - done sum-sha2.c dontcare - prev sum-sha1.c implicit dontcare - prev sum-md5.c implicit dontcare - make sum-lmd.c implicit - prev sha2.h implicit dontcare virtual - prev sha1.h implicit dontcare virtual - prev md5.h implicit dontcare virtual - prev md4.h implicit dontcare virtual - done sum-lmd.c dontcare - make sum-prng.c implicit - make ${PACKAGE_ast_INCLUDE}/fnv.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/fnv.h - done sum-prng.c - prev sum-bsd.c implicit - prev sum-ast4.c implicit - make FEATURE/sum implicit - prev features/sum - bind -last - exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} : run features/sum - done FEATURE/sum generated - prev ${PACKAGE_ast_INCLUDE}/hashpart.h implicit - make ${PACKAGE_ast_INCLUDE}/swap.h implicit + +make install virtual + note * + note * AST header dependencies + note * TODO: verify and centralise + note * + + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + done + done + done + make ${PACKAGE_ast_INCLUDE}/fnv.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/swap.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/ast.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_api.h + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h + done + done + done + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + note * TODO * circular dependency + note # prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + done prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/swap.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_map.h + prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + done + done + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h + prev ${PACKAGE_ast_INCLUDE}/ast_common.h + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/ast_std.h + done + prev ${PACKAGE_ast_INCLUDE}/hashpart.h implicit + + note * + note * Library dependencies + note * + + bind -last + make sum.req + prev ${INSTALLROOT}/bin/mkreq + exec - mkreq ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} : ${LDFLAGS} : sum md ast + done + + note * + note * Build the library + note * + + make libsum.a + make sumlib.o + make sumlib.c + make sum-sha2.c implicit prev ${PACKAGE_ast_INCLUDE}/endian.h - make sum.h implicit - make ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_api.h - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h - done ${PACKAGE_ast_INCLUDE}/wchar.h - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h - done ${PACKAGE_ast_INCLUDE}/wctype.h - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h - done ${PACKAGE_ast_INCLUDE}/stdio.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/regex.h - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/ast_map.h - prev ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - prev ${PACKAGE_ast_INCLUDE}/endian.h - done ${PACKAGE_ast_INCLUDE}/ast_sys.h - prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - done ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/vmalloc.h - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h - prev ${PACKAGE_ast_INCLUDE}/ast_common.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/sfio.h - prev ${PACKAGE_ast_INCLUDE}/ast_std.h - done ${PACKAGE_ast_INCLUDE}/ast.h - done sum.h - make sum-att.c implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done sum-att.c - make sum-crc.c implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h - done sum-crc.c - done sumlib.c - exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -c sumlib.c - done sumlib.o generated - exec - ${AR} rc libsum.a sumlib.o - exec - (ranlib libsum.a) >/dev/null 2>&1 || true - done libsum.a generated - done sum virtual - prev libsum.a - make ${INSTALLROOT}/lib - exec - if test ! -d ${INSTALLROOT}/lib - exec - then mkdir -p ${INSTALLROOT}/lib - exec - fi - done ${INSTALLROOT}/lib generated - make ${INSTALLROOT}/lib/libsum.a archive - prev ${INSTALLROOT}/lib + done + prev sum-sha1.c implicit + prev sum-md5.c implicit + prev sum-lmd.c implicit + make sum-prng.c implicit + prev ${PACKAGE_ast_INCLUDE}/fnv.h + done + prev sum-bsd.c implicit + prev sum-ast4.c implicit + make FEATURE/sum implicit + prev features/sum + exec - iffe ${IFFEFLAGS} -v -c \ + exec - '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} ${LDFLAGS}' \ + exec - ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} \ + exec - -I${INSTALLROOT}/include ${mam_libast} : run ${<} + done + prev ${PACKAGE_ast_INCLUDE}/hashpart.h + prev ${PACKAGE_ast_INCLUDE}/swap.h + prev ${PACKAGE_ast_INCLUDE}/endian.h + make sum.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make sum-att.c implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + make sum-crc.c implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h + done + done + exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${mam_cc_NOSTRICTALIASING} -I. -I${PACKAGE_ast_INCLUDE} -c ${<} + done sumlib.o + exec - ${AR} rc ${@} ${<} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done libsum.a + + note * + note * pre-install + note * + + loop DIR ${INSTALLROOT}/lib/lib ${PACKAGE_ast_INCLUDE} + make ${DIR} + exec - mkdir -p ${@} + done + done + make ${INSTALLROOT}/lib/libsum.a prev libsum.a - exec - ${STDCMP} 2>/dev/null -s libsum.a ${INSTALLROOT}/lib/libsum.a || { ${STDMV} ${INSTALLROOT}/lib/libsum.a ${INSTALLROOT}/lib/libsum.a.old 2>/dev/null || true; ${STDCP} libsum.a ${INSTALLROOT}/lib/libsum.a ;} - exec - (ranlib ${INSTALLROOT}/lib/libsum.a) >/dev/null 2>&1 || true - done ${INSTALLROOT}/lib/libsum.a generated - make ${INSTALLROOT}/lib/lib - exec - if test ! -d ${INSTALLROOT}/lib/lib - exec - then mkdir -p ${INSTALLROOT}/lib/lib - exec - fi - done ${INSTALLROOT}/lib/lib generated + exec - cp -f ${<} ${@} || exit + exec - ranlib ${@} >/dev/null 2>&1 || true + done make ${INSTALLROOT}/lib/lib/sum - prev ${INSTALLROOT}/lib/lib prev sum.req - exec - ${STDCMP} 2>/dev/null -s sum.req ${INSTALLROOT}/lib/lib/sum || { ${STDMV} ${INSTALLROOT}/lib/lib/sum ${INSTALLROOT}/lib/lib/sum.old 2>/dev/null || true; ${STDCP} sum.req ${INSTALLROOT}/lib/lib/sum ;} - done ${INSTALLROOT}/lib/lib/sum generated - make ${PACKAGE_ast_INCLUDE} - exec - if test ! -d ${PACKAGE_ast_INCLUDE} - exec - then mkdir -p ${PACKAGE_ast_INCLUDE} - exec - fi - done ${PACKAGE_ast_INCLUDE} generated + exec - cp -f ${<} ${@} + done make ${PACKAGE_ast_INCLUDE}/sum.h - prev ${PACKAGE_ast_INCLUDE} prev sum.h - exec - if ! ${STDCMP} -s sum.h ${PACKAGE_ast_INCLUDE}/sum.h - exec - then ${STDCP} sum.h ${PACKAGE_ast_INCLUDE}/sum.h - exec - fi - done ${PACKAGE_ast_INCLUDE}/sum.h generated -done install virtual -make test -done test dontcare virtual + exec - cp -f ${<} ${@} + done +done install + +make test dontcare virtual +done test
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libsum/sum-att.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libsum/sum-att.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1996-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -45,7 +45,7 @@ #endif #define CBLOCK_SIZE (64) -#if !defined(__clang__) +#if !__clang__ && !__GNUC__ #pragma unroll(16) #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libsum/sum-crc.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libsum/sum-crc.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1996-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -226,7 +226,7 @@ #endif #define CBLOCK_SIZE (64) -#if !defined(__clang__) +#if !__clang__ && !__GNUC__ #pragma unroll(16) #endif
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libsum/sum-sha2.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libsum/sum-sha2.c
Changed
@@ -166,8 +166,8 @@ * * 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. + * uses this same "backwards" definition: + * https://web.archive.org/web/20050907174740/http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */
View file
_service:tar_scm:ksh-1.0.8.tar.gz/src/lib/libsum/sumlib.c -> _service:tar_scm:ksh-1.0.9.tar.gz/src/lib/libsum/sumlib.c
Changed
@@ -2,7 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1996-2011 AT&T Intellectual Property * -* Copyright (c) 2020-2023 Contributors to ksh 93u+m * +* Copyright (c) 2020-2024 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 2.0 * * * @@ -22,8 +22,6 @@ * man this is sum library */ -static const char id = "\n@(#)$Id: sumlib (AT&T Research) 2009-09-28 $\0\n"; - #define _SUM_PRIVATE_ \ struct Method_s* method; \ uintmax_t total_count; \
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2