mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Remove AT&T UWIN support code
UWIN was David Korn's UNIX emulation layer for Microsoft Windows. It was never very well known, certainly not like Cygwin or Microsoft SFU/Interix. It was a very interesting system that exposed the Windows registry to the file system, making it UNIX-like, and that natively used ksh and all the AST utilities. Regrettably, it appears to be dead and buried. Only 32-bit binaries can still be found in the wild, as well as the source code at: https://github.com/att/uwin The latter does not seem to be usable since (as far as I can tell) it requires a UWIN environment with a compiler to build, and UWIN binaries with a compiler are simply nowhere to be found. The activity level on that repo (which is zero) also shows how much interest there still is in this project. And of course the supporting code in this repo is almost certainly broken by now as we've never been able to test it on a UWIN system. The AST team clearly cared about it since roughly 8k lines of code are dedicated to its support, disabled (directly or indirectly) on non-UWIN systems via the _UWIN macro. This removes all that.
This commit is contained in:
parent
7ba2c68525
commit
d9a85caf22
149 changed files with 108 additions and 8676 deletions
58
bin/package
58
bin/package
|
@ -682,64 +682,6 @@ use) case $1 in
|
|||
32|64) bit=$1 ;;
|
||||
esac
|
||||
shift
|
||||
|
||||
# HOSTTYPE specific setup
|
||||
|
||||
case $HOSTTYPE in
|
||||
win32.*)sys=uwin
|
||||
wow=$(uname -i)
|
||||
case $bit in
|
||||
32) case $HOSTTYPE in
|
||||
*-64) HOSTTYPE=${HOSTTYPE%-64} ;;
|
||||
esac
|
||||
;;
|
||||
64) case $HOSTTYPE in
|
||||
*-64) ;;
|
||||
*) HOSTTYPE=$HOSTTYPE-64 ;;
|
||||
esac
|
||||
case $wow in
|
||||
*/32) err_out "cannot build $bit-bit on $wow $sys" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case $bit in
|
||||
'') PS1="($sys) " ;;
|
||||
*) PS1="($sys-$bit) " ;;
|
||||
esac
|
||||
|
||||
$exec umask 002
|
||||
$exec unset MAKESKIP
|
||||
|
||||
P=$PWD
|
||||
A=$P/arch/$HOSTTYPE
|
||||
|
||||
$exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package
|
||||
$exec export INSTALLROOT=$A
|
||||
$exec export PACKAGEROOT=$P
|
||||
$exec export PATH=$A/bin:$P/bin:$PATH
|
||||
$exec export PS1="$PS1"
|
||||
$exec export VPATH=$A:$P
|
||||
$exec export nativepp=/usr/lib
|
||||
|
||||
if test -n "$INSTALLROOT" && test -d "$INSTALLROOT/include/ast"
|
||||
then $exec export PACKAGE_ast=$INSTALLROOT
|
||||
elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE
|
||||
then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE
|
||||
fi
|
||||
|
||||
# run the command
|
||||
|
||||
case $# in
|
||||
0) case $show in
|
||||
':') $exec exec $SHELL ;;
|
||||
esac
|
||||
;;
|
||||
*) $exec exec $SHELL -c "$@"
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
PACKAGEROOT=$PWD
|
||||
$show export PACKAGEROOT
|
||||
esac
|
||||
|
|
|
@ -682,64 +682,6 @@ use) case $1 in
|
|||
32|64) bit=$1 ;;
|
||||
esac
|
||||
shift
|
||||
|
||||
# HOSTTYPE specific setup
|
||||
|
||||
case $HOSTTYPE in
|
||||
win32.*)sys=uwin
|
||||
wow=$(uname -i)
|
||||
case $bit in
|
||||
32) case $HOSTTYPE in
|
||||
*-64) HOSTTYPE=${HOSTTYPE%-64} ;;
|
||||
esac
|
||||
;;
|
||||
64) case $HOSTTYPE in
|
||||
*-64) ;;
|
||||
*) HOSTTYPE=$HOSTTYPE-64 ;;
|
||||
esac
|
||||
case $wow in
|
||||
*/32) err_out "cannot build $bit-bit on $wow $sys" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case $bit in
|
||||
'') PS1="($sys) " ;;
|
||||
*) PS1="($sys-$bit) " ;;
|
||||
esac
|
||||
|
||||
$exec umask 002
|
||||
$exec unset MAKESKIP
|
||||
|
||||
P=$PWD
|
||||
A=$P/arch/$HOSTTYPE
|
||||
|
||||
$exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package
|
||||
$exec export INSTALLROOT=$A
|
||||
$exec export PACKAGEROOT=$P
|
||||
$exec export PATH=$A/bin:$P/bin:$PATH
|
||||
$exec export PS1="$PS1"
|
||||
$exec export VPATH=$A:$P
|
||||
$exec export nativepp=/usr/lib
|
||||
|
||||
if test -n "$INSTALLROOT" && test -d "$INSTALLROOT/include/ast"
|
||||
then $exec export PACKAGE_ast=$INSTALLROOT
|
||||
elif test -d ${PWD%/*}/ast/arch/$HOSTTYPE
|
||||
then $exec export PACKAGE_ast=${PWD%/*}/ast/arch/$HOSTTYPE
|
||||
fi
|
||||
|
||||
# run the command
|
||||
|
||||
case $# in
|
||||
0) case $show in
|
||||
':') $exec exec $SHELL ;;
|
||||
esac
|
||||
;;
|
||||
*) $exec exec $SHELL -c "$@"
|
||||
;;
|
||||
esac
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
PACKAGEROOT=$PWD
|
||||
$show export PACKAGEROOT
|
||||
esac
|
||||
|
|
|
@ -37,9 +37,6 @@ done
|
|||
for i in $probe_header
|
||||
do echo "#include <$i>"
|
||||
done
|
||||
echo '#ifdef _UWIN'
|
||||
echo "int _Pr0b3_uwin=_UWIN;"
|
||||
echo '#endif'
|
||||
echo '#ifdef __BORLANDC__'
|
||||
echo "int _Pr0b3_version_BORLAND=__BORLANDC__;"
|
||||
echo '#endif'
|
||||
|
@ -67,7 +64,6 @@ echo '#endif'
|
|||
} > easy.c
|
||||
|
||||
include=
|
||||
uwin=
|
||||
|
||||
$cc -E easy.c 2>&1 |
|
||||
egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' |
|
||||
|
@ -213,18 +209,10 @@ CC.STATIC = -Bstatic
|
|||
then stdlib="$stdlib $d"
|
||||
fi
|
||||
done
|
||||
case $uwin in
|
||||
[0-9]*) cat <<!
|
||||
CC.STDINCLUDE = /usr/include $stdinc
|
||||
CC.STDLIB = /usr/lib$lib $stdlib
|
||||
!
|
||||
;;
|
||||
*) cat <<!
|
||||
cat <<!
|
||||
CC.STDINCLUDE = $stdinc
|
||||
CC.STDLIB = $stdlib
|
||||
!
|
||||
;;
|
||||
esac
|
||||
cat <<!
|
||||
CC.STRICT =
|
||||
CC.STRIP = strip
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
hdr nc,exec_attr
|
||||
mem exception.name,_exception.name math.h
|
||||
lib setreuid,setregid,nice,fork,spawnveg,fchdir
|
||||
lib pathnative,pathposix,uwin_path,uwin_unpath,fts_notify
|
||||
lib pathnative,pathposix,fts_notify
|
||||
lib memcntl sys/mman.h
|
||||
lib getexecuser,free_execattr exec_attr.h -lsecdb
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "defs.h"
|
||||
|
||||
#if !defined(SHOPT_SPAWN)
|
||||
# if _UWIN || _use_spawnveg
|
||||
# if _use_spawnveg
|
||||
# define SHOPT_SPAWN 1
|
||||
# endif
|
||||
#endif /* !SHOPT_SPAWN */
|
||||
|
|
|
@ -44,20 +44,6 @@ static Dtdisc_t _Refdisc =
|
|||
offsetof(struct Namref,np),sizeof(struct Namval_t*),sizeof(struct Namref)
|
||||
};
|
||||
|
||||
#if !_lib_pathnative && _lib_uwin_path
|
||||
|
||||
#define _lib_pathnative 1
|
||||
|
||||
extern int uwin_path(const char*, char*, int);
|
||||
|
||||
size_t
|
||||
pathnative(const char* path, char* buf, size_t siz)
|
||||
{
|
||||
return uwin_path(path, buf, siz);
|
||||
}
|
||||
|
||||
#endif /* _lib_pathnative */
|
||||
|
||||
static void attstore(Namval_t*,void*);
|
||||
static void pushnam(Namval_t*,void*);
|
||||
static char *staknam(Namval_t*, char*);
|
||||
|
|
|
@ -1033,8 +1033,6 @@ make install
|
|||
done pathnative.o generated
|
||||
make pathposix.o
|
||||
make path/pathposix.c
|
||||
make uwin.h implicit
|
||||
done uwin.h dontcare virtual
|
||||
prev include/ast.h implicit
|
||||
done path/pathposix.c
|
||||
prev path/pathposix.c
|
||||
|
@ -2752,33 +2750,6 @@ make install
|
|||
prev comp/killpg.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D_PACKAGE_ast -c comp/killpg.c
|
||||
done killpg.o generated
|
||||
make hsearch.o
|
||||
make comp/hsearch.c
|
||||
make cdt/dthdr.h implicit
|
||||
make cdt/cdtlib.h implicit
|
||||
prev include/debug.h implicit
|
||||
make include/aso.h implicit
|
||||
prev ast_common.h implicit
|
||||
done include/aso.h dontcare
|
||||
prev include/cdt.h implicit
|
||||
make ${INSTALLROOT}/include/ast/dlldefs.h implicit
|
||||
done ${INSTALLROOT}/include/ast/dlldefs.h dontcare
|
||||
prev include/ast.h implicit
|
||||
done cdt/cdtlib.h dontcare
|
||||
done cdt/dthdr.h dontcare
|
||||
prev include/ast.h implicit
|
||||
done comp/hsearch.c
|
||||
prev comp/hsearch.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c comp/hsearch.c
|
||||
done hsearch.o generated
|
||||
make tsearch.o
|
||||
make comp/tsearch.c
|
||||
prev cdt/dthdr.h implicit
|
||||
prev include/ast.h implicit
|
||||
done comp/tsearch.c
|
||||
prev comp/tsearch.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c comp/tsearch.c
|
||||
done tsearch.o generated
|
||||
make getlogin.o
|
||||
make comp/getlogin.c
|
||||
prev include/ast.h implicit
|
||||
|
@ -3542,7 +3513,18 @@ make install
|
|||
done regstat.o generated
|
||||
make dtclose.o
|
||||
make cdt/dtclose.c
|
||||
prev cdt/dthdr.h implicit
|
||||
make cdt/dthdr.h implicit
|
||||
make cdt/cdtlib.h implicit
|
||||
prev include/debug.h implicit
|
||||
make include/aso.h implicit
|
||||
prev ast_common.h implicit
|
||||
done include/aso.h dontcare
|
||||
prev include/cdt.h implicit
|
||||
make ${INSTALLROOT}/include/ast/dlldefs.h implicit
|
||||
done ${INSTALLROOT}/include/ast/dlldefs.h dontcare
|
||||
prev include/ast.h implicit
|
||||
done cdt/cdtlib.h dontcare
|
||||
done cdt/dthdr.h dontcare
|
||||
done cdt/dtclose.c
|
||||
prev cdt/dtclose.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icdt -Icomp -Iinclude -Istd -I${INSTALLROOT}/include/ast -D_PACKAGE_ast -c cdt/dtclose.c
|
||||
|
@ -4251,20 +4233,6 @@ make install
|
|||
prev stdio/fdopen.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fdopen.c
|
||||
done fdopen.o generated
|
||||
make feof.o
|
||||
make stdio/feof.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/feof.c
|
||||
prev stdio/feof.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/feof.c
|
||||
done feof.o generated
|
||||
make ferror.o
|
||||
make stdio/ferror.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/ferror.c
|
||||
prev stdio/ferror.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/ferror.c
|
||||
done ferror.o generated
|
||||
make fflush.o
|
||||
make stdio/fflush.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -4293,13 +4261,6 @@ make install
|
|||
prev stdio/fgets.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fgets.c
|
||||
done fgets.o generated
|
||||
make fileno.o
|
||||
make stdio/fileno.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/fileno.c
|
||||
prev stdio/fileno.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fileno.c
|
||||
done fileno.o generated
|
||||
make fopen.o
|
||||
make stdio/fopen.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -4321,13 +4282,6 @@ make install
|
|||
prev stdio/fpurge.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fpurge.c
|
||||
done fpurge.o generated
|
||||
make fputc.o
|
||||
make stdio/fputc.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/fputc.c
|
||||
prev stdio/fputc.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fputc.c
|
||||
done fputc.o generated
|
||||
make fputs.o
|
||||
make stdio/fputs.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -4398,41 +4352,6 @@ make install
|
|||
prev stdio/fwrite.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/fwrite.c
|
||||
done fwrite.o generated
|
||||
make flockfile.o
|
||||
make stdio/flockfile.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/flockfile.c
|
||||
prev stdio/flockfile.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/flockfile.c
|
||||
done flockfile.o generated
|
||||
make ftrylockfile.o
|
||||
make stdio/ftrylockfile.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/ftrylockfile.c
|
||||
prev stdio/ftrylockfile.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/ftrylockfile.c
|
||||
done ftrylockfile.o generated
|
||||
make funlockfile.o
|
||||
make stdio/funlockfile.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/funlockfile.c
|
||||
prev stdio/funlockfile.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/funlockfile.c
|
||||
done funlockfile.o generated
|
||||
make getc.o
|
||||
make stdio/getc.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/getc.c
|
||||
prev stdio/getc.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/getc.c
|
||||
done getc.o generated
|
||||
make getchar.o
|
||||
make stdio/getchar.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/getchar.c
|
||||
prev stdio/getchar.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/getchar.c
|
||||
done getchar.o generated
|
||||
make getw.o
|
||||
make stdio/getw.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -4461,13 +4380,6 @@ make install
|
|||
prev stdio/printf.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/printf.c
|
||||
done printf.o generated
|
||||
make putc.o
|
||||
make stdio/putc.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
done stdio/putc.c
|
||||
prev stdio/putc.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/putc.c
|
||||
done putc.o generated
|
||||
make putchar.o
|
||||
make stdio/putchar.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -4657,21 +4569,6 @@ make install
|
|||
prev stdio/_flsbuf.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/_flsbuf.c
|
||||
done _flsbuf.o generated
|
||||
make _stdfun.o
|
||||
make stdio/_stdfun.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
make FEATURE/uwin implicit
|
||||
make features/uwin
|
||||
done features/uwin
|
||||
exec - iffe ${IFFEFLAGS} -v -X ast -X std -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" run features/uwin
|
||||
done FEATURE/uwin dontcare generated
|
||||
prev uwin.h implicit
|
||||
prev include/ast_windows.h implicit
|
||||
prev include/ast.h implicit
|
||||
done stdio/_stdfun.c
|
||||
prev stdio/_stdfun.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Istdio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c stdio/_stdfun.c
|
||||
done _stdfun.o generated
|
||||
make _stdopen.o
|
||||
make stdio/_stdopen.c
|
||||
prev stdio/stdhdr.h implicit
|
||||
|
@ -5257,196 +5154,13 @@ make install
|
|||
prev vmalloc/vmgetmem.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D_PACKAGE_ast -c vmalloc/vmgetmem.c
|
||||
done vmgetmem.o generated
|
||||
make a64l.o
|
||||
make uwin/a64l.c
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/a64l.c
|
||||
prev uwin/a64l.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd -c uwin/a64l.c
|
||||
done a64l.o generated
|
||||
make acosh.o
|
||||
make uwin/acosh.c
|
||||
make uwin/mathimpl.h implicit
|
||||
done uwin/mathimpl.h dontcare
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/acosh.c
|
||||
prev uwin/acosh.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/acosh.c
|
||||
done acosh.o generated
|
||||
make asinh.o
|
||||
make uwin/asinh.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/asinh.c
|
||||
prev uwin/asinh.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/asinh.c
|
||||
done asinh.o generated
|
||||
make atanh.o
|
||||
make uwin/atanh.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/atanh.c
|
||||
prev uwin/atanh.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/atanh.c
|
||||
done atanh.o generated
|
||||
make cbrt.o
|
||||
make uwin/cbrt.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/cbrt.c
|
||||
prev uwin/cbrt.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/cbrt.c
|
||||
done cbrt.o generated
|
||||
make crypt.o
|
||||
make uwin/crypt.c
|
||||
prev std/stdio.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/crypt.c
|
||||
prev uwin/crypt.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -c uwin/crypt.c
|
||||
done crypt.o generated
|
||||
make erf.o
|
||||
make uwin/erf.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
make ieee_libm.h implicit
|
||||
done ieee_libm.h dontcare virtual
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/erf.c
|
||||
prev uwin/erf.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/erf.c
|
||||
done erf.o generated
|
||||
make err.o
|
||||
make uwin/err.c
|
||||
prev windows.h implicit
|
||||
prev include/error.h implicit
|
||||
prev include/ast.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/err.c
|
||||
prev uwin/err.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D_PACKAGE_ast -c uwin/err.c
|
||||
done err.o generated
|
||||
make exp.o
|
||||
make uwin/exp.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/exp.c
|
||||
prev uwin/exp.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/exp.c
|
||||
done exp.o generated
|
||||
make exp__E.o
|
||||
make uwin/exp__E.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/exp__E.c
|
||||
prev uwin/exp__E.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/exp__E.c
|
||||
done exp__E.o generated
|
||||
make expm1.o
|
||||
make uwin/expm1.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/expm1.c
|
||||
prev uwin/expm1.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/expm1.c
|
||||
done expm1.o generated
|
||||
make gamma.o
|
||||
make uwin/gamma.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/gamma.c
|
||||
prev uwin/gamma.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/gamma.c
|
||||
done gamma.o generated
|
||||
make getpass.o
|
||||
make uwin/getpass.c
|
||||
prev include/ast.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/getpass.c
|
||||
prev uwin/getpass.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D_PACKAGE_ast -c uwin/getpass.c
|
||||
done getpass.o generated
|
||||
make lgamma.o
|
||||
make uwin/lgamma.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/lgamma.c
|
||||
prev uwin/lgamma.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/lgamma.c
|
||||
done lgamma.o generated
|
||||
make log.o
|
||||
make uwin/log.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/log.c
|
||||
prev uwin/log.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/log.c
|
||||
done log.o generated
|
||||
make log1p.o
|
||||
make uwin/log1p.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/log1p.c
|
||||
prev uwin/log1p.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/log1p.c
|
||||
done log1p.o generated
|
||||
make log__L.o
|
||||
make uwin/log__L.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/log__L.c
|
||||
prev uwin/log__L.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/log__L.c
|
||||
done log__L.o generated
|
||||
make rand48.o
|
||||
make uwin/rand48.c
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/rand48.c
|
||||
prev uwin/rand48.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd -c uwin/rand48.c
|
||||
done rand48.o generated
|
||||
make random.o
|
||||
make uwin/random.c
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/random.c
|
||||
prev uwin/random.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd -c uwin/random.c
|
||||
done random.o generated
|
||||
make rcmd.o
|
||||
make uwin/rcmd.c
|
||||
prev std/nl_types.h implicit
|
||||
make uwin/rlib.h implicit
|
||||
prev std/endian.h implicit
|
||||
prev std/stdio.h implicit
|
||||
prev std/stdio.h implicit
|
||||
prev include/ast_std.h implicit
|
||||
done uwin/rlib.h dontcare
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/rcmd.c
|
||||
prev uwin/rcmd.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iuwin -Iinclude -Istd -c uwin/rcmd.c
|
||||
done rcmd.o generated
|
||||
make rint.o
|
||||
make uwin/rint.c
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/rint.c
|
||||
prev uwin/rint.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Istd -c uwin/rint.c
|
||||
done rint.o generated
|
||||
make support.o
|
||||
make uwin/support.c
|
||||
prev uwin/mathimpl.h implicit
|
||||
prev FEATURE/uwin implicit
|
||||
done uwin/support.c
|
||||
prev uwin/support.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iuwin -Istd -c uwin/support.c
|
||||
done support.o generated
|
||||
exec - ${AR} rc libast.a state.o transition.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 vfork.o killpg.o hsearch.o tsearch.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 waitpid.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.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 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 vfork.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 waitpid.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.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 feof.o ferror.o fflush.o fgetc.o fgetpos.o fgets.o fileno.o fopen.o fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o flockfile.o ftrylockfile.o funlockfile.o getc.o getchar.o getw.o pclose.o popen.o printf.o putc.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 _stdfun.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 vmexit.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 a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.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 vmexit.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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "asohdr.h"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast) || !_aso_fcntl
|
||||
#if !_aso_fcntl
|
||||
|
||||
NoN(aso_meth_fcntl)
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "asohdr.h"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast) || !_aso_semaphore
|
||||
#if !_aso_semaphore
|
||||
|
||||
NoN(aso_meth_semaphore)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -24,12 +24,6 @@
|
|||
#include "asohdr.h"
|
||||
#include "FEATURE/aso"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast)
|
||||
|
||||
NoN(aso)
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* AST atomic scalar operations
|
||||
* AT&T Research
|
||||
|
@ -45,20 +39,12 @@ NoN(aso)
|
|||
|
||||
#if !_PACKAGE_ast
|
||||
|
||||
#if _UWIN
|
||||
|
||||
extern ssize_t sfsprintf(char*, size_t, const char*, ...);
|
||||
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define sfsprintf snprintf
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_aso_casptr) && (defined(_aso_cas32) || defined(_aso_cas64))
|
||||
#define ASO_METHOD (&_aso_meth_intrinsic)
|
||||
#define ASO_LOCKF 0
|
||||
|
@ -863,5 +849,3 @@ asocasptr(void volatile* p, void* o, void* n)
|
|||
lock(state.data, k, p);
|
||||
return o;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -56,11 +56,6 @@
|
|||
|
||||
#include "FEATURE/asometh"
|
||||
|
||||
#if _UWIN
|
||||
#undef _aso_fcntl
|
||||
#undef _aso_semaphore
|
||||
#endif
|
||||
|
||||
#include "aso.h"
|
||||
|
||||
#define HASH(p,z) ((integralof(p)*FNV_MULT)%(z))
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,12 +23,6 @@
|
|||
|
||||
#include "asohdr.h"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast)
|
||||
|
||||
NoN(asolock)
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
asolock(unsigned int volatile* lock, unsigned int key, int type)
|
||||
{
|
||||
|
@ -51,5 +45,3 @@ asolock(unsigned int volatile* lock, unsigned int key, int type)
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,12 +23,6 @@
|
|||
|
||||
#include "asohdr.h"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast)
|
||||
|
||||
NoN(asometh)
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* this is the default user visible asometh()
|
||||
* -ltaso intercepts asometh() to prepend ASO_THREAD methods
|
||||
|
@ -39,5 +33,3 @@ asometh(int type, void* data)
|
|||
{
|
||||
return _asometh(type, data);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,12 +23,6 @@
|
|||
|
||||
#include "asohdr.h"
|
||||
|
||||
#if defined(_UWIN) && defined(_BLD_ast)
|
||||
|
||||
NoN(asorelax)
|
||||
|
||||
#else
|
||||
|
||||
#if _PACKAGE_ast
|
||||
#include <tv.h>
|
||||
#else
|
||||
|
@ -52,5 +46,3 @@ asorelax(long nsec)
|
|||
return nanosleep(&ts, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -636,15 +636,6 @@ static int treeevent(Dt_t* dt, int event, void* arg)
|
|||
else return 0;
|
||||
}
|
||||
|
||||
#if _UWIN
|
||||
|
||||
void* dtfinger(Dt_t* dt)
|
||||
{
|
||||
return (dt && dt->meth && (dt->meth->type & DT_ORDERED)) ? (void*)((Dttree_t*)dt->data)->root : NIL(void*);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* make this method available */
|
||||
static Dtmethod_t _Dtoset = { dttree, DT_OSET, treeevent, "Dtoset" };
|
||||
static Dtmethod_t _Dtobag = { dttree, DT_OBAG, treeevent, "Dtobag" };
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* hsearch() for systems that have <search.h> but no hsearch()
|
||||
* why would such a system provide the interface but not the
|
||||
* implementation? that's what happens when one slimes their
|
||||
* way through standards compliance
|
||||
*
|
||||
* NOTE: please excuse the crude feature test
|
||||
*/
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
void _STUB_hsearch(){}
|
||||
|
||||
#else
|
||||
|
||||
#if _PACKAGE_ast
|
||||
#include <ast.h>
|
||||
#endif
|
||||
|
||||
#define hcreate ______hcreate
|
||||
#define hdestroy ______hdestroy
|
||||
#define hsearch ______hsearch
|
||||
|
||||
#include <search.h>
|
||||
|
||||
#undef hcreate
|
||||
#undef hdestroy
|
||||
#undef hsearch
|
||||
|
||||
#include "dthdr.h"
|
||||
|
||||
#if defined(__EXPORT__)
|
||||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
/* POSIX hsearch library based on libdt
|
||||
** Written by Kiem-Phong Vo (AT&T Research, 07/19/95)
|
||||
*/
|
||||
|
||||
/* type of objects in hash table */
|
||||
typedef struct _hash_s
|
||||
{ Dtlink_t link;
|
||||
ENTRY item;
|
||||
} Hash_t;
|
||||
|
||||
/* object delete function */
|
||||
static void hashfree(Dt_t* dt, void* obj, Dtdisc_t* disc)
|
||||
{
|
||||
free(((Hash_t*)obj)->item.key);
|
||||
free(obj);
|
||||
}
|
||||
|
||||
static Dt_t* Hashtab; /* object dictionary */
|
||||
static Dtdisc_t Hashdisc = /* discipline */
|
||||
{ sizeof(Dtlink_t), -1,
|
||||
0,
|
||||
NIL(Dtmake_f), hashfree,
|
||||
NIL(Dtcompar_f), /* always use strcmp */
|
||||
NIL(Dthash_f),
|
||||
NIL(Dtmemory_f),
|
||||
NIL(Dtevent_f)
|
||||
};
|
||||
|
||||
extern
|
||||
int hcreate(size_t nel)
|
||||
{
|
||||
if(Hashtab) /* already opened */
|
||||
return 0;
|
||||
|
||||
if(!(Hashtab = dtopen(&Hashdisc,Dtset)) )
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern void hdestroy()
|
||||
{ if(Hashtab)
|
||||
dtclose(Hashtab);
|
||||
Hashtab = NIL(Dt_t*);
|
||||
}
|
||||
|
||||
extern
|
||||
ENTRY* hsearch(ENTRY item, ACTION action)
|
||||
{
|
||||
reg Hash_t* o;
|
||||
|
||||
if(!Hashtab)
|
||||
return NIL(ENTRY*);
|
||||
|
||||
if(!(o = (Hash_t*)dtmatch(Hashtab,item.key)) && action == ENTER &&
|
||||
(o = (Hash_t*)malloc(sizeof(Hash_t)) ) )
|
||||
{ o->item = item;
|
||||
o = (Hash_t*)dtinsert(Hashtab,o);
|
||||
}
|
||||
|
||||
return o ? &(o->item) : NIL(ENTRY*);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -144,263 +144,6 @@ static const _ast_iconv_list_t codes[] =
|
|||
{ 0 },
|
||||
};
|
||||
|
||||
#if _UWIN
|
||||
|
||||
#include <ast_windows.h>
|
||||
|
||||
#ifndef CP_UCS2
|
||||
#define CP_UCS2 0x0000
|
||||
#endif
|
||||
|
||||
static char _win_maps[] = "/reg/local_machine/SOFTWARE/Classes/MIME/Database/Charset";
|
||||
|
||||
/*
|
||||
* return the codeset index given its name or alias
|
||||
* the map is in the what? oh, the registry
|
||||
*/
|
||||
|
||||
static int
|
||||
_win_codeset(const char* name)
|
||||
{
|
||||
register char* s;
|
||||
char* e;
|
||||
int n;
|
||||
Sfio_t* sp;
|
||||
char aka[128];
|
||||
char tmp[128];
|
||||
|
||||
#if DEBUG_TRACE
|
||||
error(DEBUG_TRACE, "AHA#%d _win_codeset name=%s", __LINE__, name);
|
||||
#endif
|
||||
if (name == name_native)
|
||||
return CP_ACP;
|
||||
if (!strcasecmp(name, "utf") || !strcasecmp(name, "utf8") || !strcasecmp(name, "utf-8"))
|
||||
return CP_UTF8;
|
||||
if (!strcasecmp(name, "ucs") || !strcasecmp(name, "ucs2") || !strcasecmp(name, "ucs-2"))
|
||||
return CP_UCS2;
|
||||
if (name[0] == '0' && name[1] == 'x' && (n = strtol(name, &e, 0)) > 0 && !*e)
|
||||
return n;
|
||||
for (;;)
|
||||
{
|
||||
sfsprintf(tmp, sizeof(tmp), "%s/%s", _win_maps, name);
|
||||
if (!(sp = sfopen(0, tmp, "r")))
|
||||
{
|
||||
s = (char*)name;
|
||||
if ((s[0] == 'c' || s[0] == 'C') && (s[1] == 'p' || s[1] == 'P'))
|
||||
s += 2;
|
||||
if (!isdigit(s[0]))
|
||||
break;
|
||||
sfsprintf(tmp, sizeof(tmp), "%s/windows-%s", _win_maps, s);
|
||||
if (!(sp = sfopen(0, tmp, "r")))
|
||||
break;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
if (!(s = sfgetr(sp, '\n', 0)))
|
||||
{
|
||||
sfclose(sp);
|
||||
return -1;
|
||||
}
|
||||
if (!strncasecmp(s, "AliasForCharSet=", 16))
|
||||
{
|
||||
n = sfvalue(sp) - 17;
|
||||
s += 16;
|
||||
if (n >= sizeof(aka))
|
||||
n = sizeof(aka) - 1;
|
||||
memcpy(aka, s, n);
|
||||
aka[n] = 0;
|
||||
sfclose(sp);
|
||||
name = (const char*)aka;
|
||||
break;
|
||||
}
|
||||
if (!strncasecmp(s, "CodePage=", 9))
|
||||
{
|
||||
s += 9;
|
||||
n = strtol(s, 0, 0);
|
||||
sfclose(sp);
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get and check the codeset indices
|
||||
*/
|
||||
|
||||
static _ast_iconv_t
|
||||
_win_iconv_open(register Conv_t* cc, const char* t, const char* f)
|
||||
{
|
||||
#if DEBUG_TRACE
|
||||
error(DEBUG_TRACE, "AHA#%d _win_iconv_open f=%s t=%s\n", __LINE__, f, t);
|
||||
#endif
|
||||
if ((cc->from.index = _win_codeset(f)) < 0)
|
||||
return (_ast_iconv_t)(-1);
|
||||
if ((cc->to.index = _win_codeset(t)) < 0)
|
||||
return (_ast_iconv_t)(-1);
|
||||
#if DEBUG_TRACE
|
||||
error(DEBUG_TRACE, "AHA#%d _win_iconv_open f=0x%04x t=0x%04x\n", __LINE__, cc->from.index, cc->to.index);
|
||||
#endif
|
||||
return (_ast_iconv_t)cc;
|
||||
}
|
||||
|
||||
/*
|
||||
* even though the indices already check out
|
||||
* they could still be rejected
|
||||
*/
|
||||
|
||||
static size_t
|
||||
_win_iconv(_ast_iconv_t cd, char** fb, size_t* fn, char** tb, size_t* tn)
|
||||
{
|
||||
Conv_t* cc = (Conv_t*)cd;
|
||||
size_t un;
|
||||
size_t tz;
|
||||
size_t fz;
|
||||
size_t bz;
|
||||
size_t pz;
|
||||
size_t oz;
|
||||
LPWSTR ub;
|
||||
|
||||
#if DEBUG_TRACE
|
||||
error(DEBUG_TRACE, "AHA#%d _win_iconv from=0x%04x to=0x%04x\n", __LINE__, cc->from.index, cc->to.index);
|
||||
#endif
|
||||
if (cc->from.index == cc->to.index || cc->from.index != CP_UCS2 && cc->to.index == 0)
|
||||
{
|
||||
/*
|
||||
* easy
|
||||
*/
|
||||
|
||||
fz = tz = (*fn < *tn) ? *fn : *tn;
|
||||
memcpy(*tb, *fb, fz);
|
||||
}
|
||||
else
|
||||
{
|
||||
ub = 0;
|
||||
un = *fn;
|
||||
|
||||
/*
|
||||
* from => UCS-2
|
||||
*/
|
||||
|
||||
if (cc->to.index == CP_UCS2)
|
||||
{
|
||||
if ((tz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, *tn)) && tz <= *tn)
|
||||
{
|
||||
fz = *fn;
|
||||
tz *= sizeof(WCHAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* target too small
|
||||
* binary search on input size to make it fit
|
||||
*/
|
||||
|
||||
oz = 0;
|
||||
pz = *fn / 2;
|
||||
fz = *fn - pz;
|
||||
for (;;)
|
||||
{
|
||||
while (!(tz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)fz, (LPWSTR)*tb, 0)))
|
||||
if (++fz >= *fn)
|
||||
goto nope;
|
||||
tz *= sizeof(WCHAR);
|
||||
if (tz == *tn)
|
||||
break;
|
||||
if (!(pz /= 2))
|
||||
{
|
||||
if (!(fz = oz))
|
||||
goto nope;
|
||||
break;
|
||||
}
|
||||
if (tz > *tn)
|
||||
fz -= pz;
|
||||
else
|
||||
{
|
||||
oz = fz;
|
||||
fz += pz;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cc->from.index == CP_UCS2)
|
||||
{
|
||||
un = *fn / sizeof(WCHAR);
|
||||
ub = (LPWSTR)*fb;
|
||||
}
|
||||
else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)*tb, 0)))
|
||||
goto nope;
|
||||
else if (!(ub = (LPWSTR)malloc(un * sizeof(WCHAR))))
|
||||
goto nope;
|
||||
else if (!(un = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)*fn, (LPWSTR)ub, un)))
|
||||
goto nope;
|
||||
|
||||
/*
|
||||
* UCS-2 => to
|
||||
*/
|
||||
|
||||
if (tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, un, *tb, *tn, 0, 0))
|
||||
fz = *fn;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* target too small
|
||||
* binary search on input size to make it fit
|
||||
*/
|
||||
|
||||
oz = 0;
|
||||
pz = *fn / 2;
|
||||
bz = *fn - pz;
|
||||
for (;;)
|
||||
{
|
||||
while (!(fz = MultiByteToWideChar(cc->from.index, 0, (LPCSTR)*fb, (int)bz, (LPWSTR)ub, un)))
|
||||
if (++bz > *fn)
|
||||
goto nope;
|
||||
if (!(tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, fz, *tb, 0, 0, 0)))
|
||||
goto nope;
|
||||
if (tz == *tn)
|
||||
break;
|
||||
if (!(pz /= 2))
|
||||
{
|
||||
if (!(fz = oz))
|
||||
goto nope;
|
||||
break;
|
||||
}
|
||||
if (tz > *tn)
|
||||
bz -= pz;
|
||||
else
|
||||
{
|
||||
oz = bz;
|
||||
bz += pz;
|
||||
}
|
||||
}
|
||||
if (!(tz = WideCharToMultiByte(cc->to.index, 0, (LPCWSTR)ub, fz, *tb, tz, 0, 0)))
|
||||
goto nope;
|
||||
#if DEBUG_TRACE
|
||||
error(DEBUG_TRACE, "AHA#%d _win_iconv *fn=%u fz=%u[%u] *tn=%u tz=%u\n", __LINE__, *fn, fz, fz * sizeof(WCHAR), *tn, tz);
|
||||
#endif
|
||||
}
|
||||
if (ub != (LPWSTR)*fb)
|
||||
free(ub);
|
||||
}
|
||||
}
|
||||
*fb += fz;
|
||||
*fn -= fz;
|
||||
*tb += tz;
|
||||
*tn -= tz;
|
||||
return fz;
|
||||
nope:
|
||||
if (ub && ub != (LPWSTR)*fb)
|
||||
free(ub);
|
||||
errno = EINVAL;
|
||||
return (size_t)(-1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* return canonical character code set name for m
|
||||
* if b!=0 then canonical name placed in b of size n
|
||||
|
@ -1106,10 +849,6 @@ error(DEBUG_TRACE, "AHA#%d _ast_iconv_open f=%s:%s:%d t=%s:%s:%d\n", __LINE__, f
|
|||
#if _lib_iconv_open
|
||||
else if ((cc->cvt = iconv_open(t, f)) != (iconv_t)(-1) || (cc->cvt = iconv_open(to, fr)) != (iconv_t)(-1))
|
||||
cc->from.fun = (_ast_iconv_f)iconv;
|
||||
#endif
|
||||
#if _UWIN
|
||||
else if ((cc->cvt = _win_iconv_open(cc, t, f)) != (_ast_iconv_t)(-1) || (cc->cvt = _win_iconv_open(cc, to, fr)) != (_ast_iconv_t)(-1))
|
||||
cc->from.fun = (_ast_iconv_f)_win_iconv;
|
||||
#endif
|
||||
else
|
||||
{
|
||||
|
@ -1556,34 +1295,8 @@ _ast_iconv_move(_ast_iconv_t cd, Sfio_t* ip, Sfio_t* op, size_t n, Iconv_disc_t*
|
|||
_ast_iconv_list_t*
|
||||
_ast_iconv_list(_ast_iconv_list_t* cp)
|
||||
{
|
||||
#if _UWIN
|
||||
struct dirent* ent;
|
||||
|
||||
if (!cp)
|
||||
{
|
||||
if (!(cp = newof(0, _ast_iconv_list_t, 1, 0)))
|
||||
return ccmaplist(NiL);
|
||||
if (!(cp->data = opendir(_win_maps)))
|
||||
{
|
||||
free(cp);
|
||||
return ccmaplist(NiL);
|
||||
}
|
||||
}
|
||||
if (cp->data)
|
||||
{
|
||||
if (ent = readdir((DIR*)cp->data))
|
||||
{
|
||||
cp->name = cp->match = cp->desc = (const char*)ent->d_name;
|
||||
return cp;
|
||||
}
|
||||
closedir((DIR*)cp->data);
|
||||
free(cp);
|
||||
return ccmaplist(NiL);
|
||||
}
|
||||
#else
|
||||
if (!cp)
|
||||
return ccmaplist(NiL);
|
||||
#endif
|
||||
if (cp->ccode >= 0)
|
||||
return (cp = ccmaplist(cp)) ? cp : (_ast_iconv_list_t*)codes;
|
||||
return (++cp)->name ? cp : (_ast_iconv_list_t*)0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <ast.h>
|
||||
|
||||
#if _lib_memccpy && !_UWIN
|
||||
#if _lib_memccpy
|
||||
|
||||
NoN(memccpy)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,10 +23,6 @@
|
|||
|
||||
#define putenv ______putenv
|
||||
|
||||
#if _UWIN
|
||||
#define _STDLIB_H_ 1
|
||||
#endif
|
||||
|
||||
#include <ast.h>
|
||||
|
||||
#undef putenv
|
||||
|
|
|
@ -82,103 +82,6 @@ header(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if _UWIN
|
||||
|
||||
#include <ast_windows.h>
|
||||
|
||||
#undef _lib_setlocale
|
||||
#define _lib_setlocale 1
|
||||
|
||||
#define setlocale(c,l) native_setlocale(c,l)
|
||||
|
||||
extern char* uwin_setlocale(int, const char*);
|
||||
|
||||
/*
|
||||
* convert locale to native locale name in buf
|
||||
*/
|
||||
|
||||
static char*
|
||||
native_locale(const char* locale, char* buf, size_t siz)
|
||||
{
|
||||
Lc_t* lc;
|
||||
const Lc_attribute_list_t* ap;
|
||||
int i;
|
||||
unsigned long lcid;
|
||||
unsigned long langidx;
|
||||
unsigned long ctry;
|
||||
char lbuf[128];
|
||||
char cbuf[128];
|
||||
|
||||
if (locale && *locale)
|
||||
{
|
||||
if (!(lc = lcmake(locale)))
|
||||
return 0;
|
||||
langidx = lc->language->index;
|
||||
ctry = 0;
|
||||
for (ap = lc->attributes; ap; ap = ap->next)
|
||||
if (ctry = ap->attribute->index)
|
||||
break;
|
||||
if (!ctry)
|
||||
{
|
||||
for (i = 0; i < elementsof(lc->territory->languages); i++)
|
||||
if (lc->territory->languages[i] == lc->language)
|
||||
{
|
||||
ctry = lc->territory->indices[i];
|
||||
break;
|
||||
}
|
||||
if (!ctry)
|
||||
{
|
||||
if (!langidx)
|
||||
return 0;
|
||||
ctry = SUBLANG_DEFAULT;
|
||||
}
|
||||
}
|
||||
lcid = MAKELCID(MAKELANGID(langidx, ctry), SORT_DEFAULT);
|
||||
}
|
||||
else
|
||||
lcid = GetUserDefaultLCID();
|
||||
if (GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, lbuf, sizeof(lbuf)) <= 0 ||
|
||||
GetLocaleInfo(lcid, LOCALE_SENGCOUNTRY, cbuf, sizeof(cbuf)) <= 0)
|
||||
return 0;
|
||||
if (lc->charset->ms)
|
||||
sfsprintf(buf, siz, "%s_%s.%s", lbuf, cbuf, lc->charset->ms);
|
||||
else
|
||||
sfsprintf(buf, siz, "%s_%s", lbuf, cbuf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
* locale!=0 here
|
||||
*/
|
||||
|
||||
static char*
|
||||
native_setlocale(int category, const char* locale)
|
||||
{
|
||||
char* usr;
|
||||
char* sys;
|
||||
char buf[256];
|
||||
|
||||
if (!(usr = native_locale(locale, buf, sizeof(buf))))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Win32 doesn't have LC_MESSAGES
|
||||
*/
|
||||
|
||||
if (category == LC_MESSAGES)
|
||||
return (char*)locale;
|
||||
sys = uwin_setlocale(category, usr);
|
||||
if (ast.locale.set & AST_LC_debug)
|
||||
sfprintf(sfstderr, "locale uwin %17s %-24s %-24s\n", lc_categories[lcindex(category, 0)].name, usr, sys);
|
||||
return sys;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define native_locale(a,b,c) ((char*)0)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LC_COLLATE and LC_CTYPE native support
|
||||
*/
|
||||
|
@ -2432,8 +2335,7 @@ default_setlocale(int category, const char* locale)
|
|||
|
||||
#endif
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
/* <TODO> [2022-07-21]: remove this and _vmkeep? obsolete? */
|
||||
/*
|
||||
* workaround for Solaris and FreeBSD systems
|
||||
* they call free() with addresses that look like they came from the stack
|
||||
|
@ -2454,8 +2356,7 @@ _sys_setlocale(int category, const char* locale)
|
|||
}
|
||||
|
||||
#define setlocale(a,b) _sys_setlocale(a,b)
|
||||
|
||||
#endif
|
||||
/* </TODO> */
|
||||
|
||||
/*
|
||||
* set a single AST_LC_* locale category
|
||||
|
@ -2796,7 +2697,7 @@ _ast_setlocale(int category, const char* locale)
|
|||
u = 0;
|
||||
if ((s = getenv("LANG")) && *s)
|
||||
{
|
||||
if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
|
||||
if (u && streq(s, local))
|
||||
s = u;
|
||||
lang = lcmake(s);
|
||||
}
|
||||
|
@ -2804,7 +2705,7 @@ _ast_setlocale(int category, const char* locale)
|
|||
lang = 0;
|
||||
if ((s = getenv("LC_ALL")) && *s)
|
||||
{
|
||||
if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
|
||||
if (u && streq(s, local))
|
||||
s = u;
|
||||
lc_all = lcmake(s);
|
||||
}
|
||||
|
@ -2815,7 +2716,7 @@ _ast_setlocale(int category, const char* locale)
|
|||
/* explicitly set by setlocale() */;
|
||||
else if ((s = getenv(lc_categories[i].name)) && *s)
|
||||
{
|
||||
if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
|
||||
if (u && streq(s, local))
|
||||
s = u;
|
||||
lc_categories[i].prev = lcmake(s);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -31,14 +31,10 @@
|
|||
|
||||
#undef strtoll
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
#undef _def_map_ast
|
||||
|
||||
#include <ast_map.h>
|
||||
|
||||
#endif
|
||||
|
||||
#define S2I_function strtoll
|
||||
#define S2I_number intmax_t
|
||||
#define S2I_unumber uintmax_t
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -31,14 +31,10 @@
|
|||
|
||||
#undef strtoull
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
#undef _def_map_ast
|
||||
|
||||
#include <ast_map.h>
|
||||
|
||||
#endif
|
||||
|
||||
#define S2I_function strtoull
|
||||
#define S2I_number intmax_t
|
||||
#define S2I_unumber uintmax_t
|
||||
|
|
|
@ -43,9 +43,6 @@ Syslog_state_t log = { LOG_USER, -1, 0, ~0 };
|
|||
|
||||
static const Namval_t attempt[] =
|
||||
{
|
||||
#if _UWIN
|
||||
"/var/log/syslog", 0,
|
||||
#endif
|
||||
"/dev/log", 0,
|
||||
"var/log/syslog", 0,
|
||||
"lib/syslog/log", 0,
|
||||
|
@ -92,161 +89,6 @@ const Namval_t log_severity[] =
|
|||
0, 0
|
||||
};
|
||||
|
||||
#if _UWIN
|
||||
|
||||
/*
|
||||
* open /dev/(fdp|tcp|udp)/HOST/SERVICE for read
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <ls.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if !defined(htons) && !_lib_htons
|
||||
# define htons(x) (x)
|
||||
#endif
|
||||
#if !defined(htonl) && !_lib_htonl
|
||||
# define htonl(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef INADDR_LOOPBACK
|
||||
#define INADDR_LOOPBACK 0x7f000001L
|
||||
#endif
|
||||
|
||||
/*
|
||||
* convert s to sockaddr_in
|
||||
* -1 returned on error
|
||||
*/
|
||||
|
||||
static int
|
||||
str2inet(register char* s, char* prot, struct sockaddr_in* addr)
|
||||
{
|
||||
register int c;
|
||||
register int v;
|
||||
register int n = 0;
|
||||
unsigned long a = 0;
|
||||
unsigned short p = 0;
|
||||
|
||||
if (!strncmp(s, "local/", 6))
|
||||
{
|
||||
a = INADDR_LOOPBACK;
|
||||
n = 4;
|
||||
s += 6;
|
||||
}
|
||||
else if (!isdigit(*s))
|
||||
{
|
||||
struct hostent* hp;
|
||||
char* e = strchr(s, '/');
|
||||
|
||||
if (!(e = strchr(s, '/')))
|
||||
return -1;
|
||||
*e = 0;
|
||||
hp = gethostbyname(s);
|
||||
*e = '/';
|
||||
if (!hp || hp->h_addrtype != AF_INET || hp->h_length > sizeof(struct in_addr))
|
||||
return -1;
|
||||
a = (unsigned long)((struct in_addr*)hp->h_addr)->s_addr;
|
||||
n = 6;
|
||||
s = e + 1;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
v = 0;
|
||||
while ((c = *s++) >= '0' && c <= '9')
|
||||
v = v * 10 + c - '0';
|
||||
if (++n <= 4)
|
||||
a = (a << 8) | (v & 0xff);
|
||||
else
|
||||
{
|
||||
if (n <= 5)
|
||||
a = htonl(a);
|
||||
if (c)
|
||||
{
|
||||
struct servent* sp;
|
||||
|
||||
if (!(sp = getservbyname(s - 1, prot)))
|
||||
return -1;
|
||||
p = sp->s_port;
|
||||
}
|
||||
else
|
||||
p = htons(v);
|
||||
break;
|
||||
}
|
||||
if (c != '.' && c != '/')
|
||||
return -1;
|
||||
}
|
||||
memset((char*)addr, 0, sizeof(*addr));
|
||||
addr->sin_family = AF_INET;
|
||||
addr->sin_addr.s_addr = a;
|
||||
addr->sin_port = p;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* call this after open fails to see if path is a socket
|
||||
*/
|
||||
|
||||
int
|
||||
sockopen(const char* path)
|
||||
{
|
||||
int fd;
|
||||
struct sockaddr_in addr;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if (pathgetlink(path, buf, sizeof(buf)) <= 0)
|
||||
{
|
||||
if (strlen(path) >= sizeof(buf))
|
||||
return -1;
|
||||
strcpy(buf, path);
|
||||
}
|
||||
#if LOCAL
|
||||
{
|
||||
int ul;
|
||||
struct sockaddr_un ua;
|
||||
struct stat st;
|
||||
|
||||
if ((ul = strlen(buf)) < sizeof(ua.sun_path) && !stat(buf, &st) && S_ISSOCK(st.st_mode))
|
||||
{
|
||||
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
||||
return -1;
|
||||
ua.sun_family = AF_UNIX;
|
||||
strcpy(ua.sun_path, buf);
|
||||
ul += sizeof(ua.sun_family) + 1;
|
||||
if (!connect(fd, (struct sockaddr*)&ua, ul))
|
||||
return fd;
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!strmatch(buf, "/dev/(tcp|udp)/*/*"))
|
||||
return -1;
|
||||
buf[8] = 0;
|
||||
if (str2inet(buf + 9, buf + 5, &addr))
|
||||
return -1;
|
||||
if ((fd = socket(AF_INET, buf[5] == 't' ? SOCK_STREAM : SOCK_DGRAM, 0)) < 0)
|
||||
return -1;
|
||||
if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)))
|
||||
{
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
sockopen(const char* path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
sendlog(const char* msg)
|
||||
{
|
||||
|
@ -268,7 +110,7 @@ sendlog(const char* msg)
|
|||
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 && (log.fd = sockopen(s)) < 0)
|
||||
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);
|
||||
|
|
|
@ -1,199 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
/*
|
||||
* tsearch() for systems that have <search.h> but no tsearch()
|
||||
* why would such a system provide the interface but not the
|
||||
* implementation? that's what happens when one slimes their
|
||||
* way through standards compliance
|
||||
*
|
||||
* NOTE: please excuse the crude feature test
|
||||
*/
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
void _STUB_tsearch(){}
|
||||
|
||||
#else
|
||||
|
||||
#if _PACKAGE_ast
|
||||
#include <ast.h>
|
||||
#endif
|
||||
|
||||
#define tdelete ______tdelete
|
||||
#define tfind ______tfind
|
||||
#define tsearch ______tsearch
|
||||
#define twalk ______twalk
|
||||
|
||||
#include <search.h>
|
||||
|
||||
#undef tdelete
|
||||
#undef tfind
|
||||
#undef tsearch
|
||||
#undef twalk
|
||||
|
||||
#include "dthdr.h"
|
||||
|
||||
extern void* dtfinger(Dt_t*);
|
||||
|
||||
/* POSIX tsearch library based on libcdt
|
||||
** Written by Kiem-Phong Vo (AT&T Research, 07/19/95)
|
||||
*/
|
||||
|
||||
typedef struct _tree_s
|
||||
{ Dtlink_t link;
|
||||
void* key;
|
||||
} Tree_t;
|
||||
|
||||
typedef struct _treedisc_s
|
||||
{ Dtdisc_t disc;
|
||||
int(* comparf)(const void*, const void*);
|
||||
} Treedisc_t;
|
||||
|
||||
#if defined(__EXPORT__)
|
||||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
/* compare function */
|
||||
static int treecompare(Dt_t* dt, char* one, char* two, Dtdisc_t* disc)
|
||||
{
|
||||
return (*((Treedisc_t*)disc)->comparf)((void*)one,(void*)two);
|
||||
}
|
||||
|
||||
static Treedisc_t Treedisc =
|
||||
{ { sizeof(Dtlink_t), -1, /* object is key */
|
||||
0,
|
||||
NIL(Dtmake_f), NIL(Dtfree_f),
|
||||
treecompare,
|
||||
NIL(Dthash_f),
|
||||
NIL(Dtmemory_f),
|
||||
NIL(Dtevent_f)
|
||||
},
|
||||
0
|
||||
};
|
||||
|
||||
extern
|
||||
void* tsearch(const void* key, void** rootp,
|
||||
int(*comparf)(const void*,const void*) )
|
||||
{
|
||||
reg Dt_t* dt;
|
||||
reg Tree_t* o;
|
||||
|
||||
if(!rootp ||
|
||||
(!(dt = *((Dt_t**)rootp)) && !(dt = dtopen((Dtdisc_t*)(&Treedisc),Dtoset))) )
|
||||
return NIL(void*);
|
||||
|
||||
/* dangerous to set comparf on each call but that's tsearch */
|
||||
Treedisc.comparf = comparf;
|
||||
|
||||
if(!(o = (Tree_t*)dtmatch(dt,key)) )
|
||||
{ if(!(o = (Tree_t*)malloc(sizeof(Tree_t))) )
|
||||
return NIL(void*);
|
||||
o->key = (void*)key;
|
||||
dtinsert(dt,o);
|
||||
}
|
||||
|
||||
if(o)
|
||||
*rootp = (void*)dt;
|
||||
else if(*rootp == NIL(void*) )
|
||||
dtclose(dt);
|
||||
|
||||
return (void*)(&o->key);
|
||||
}
|
||||
|
||||
extern
|
||||
void* tfind(const void* key, void*const* rootp,
|
||||
int(*comparf)(const void*, const void*) )
|
||||
{
|
||||
reg Dt_t* dt;
|
||||
reg Tree_t* o;
|
||||
|
||||
if(!rootp || !(dt = *((Dt_t**)rootp)) )
|
||||
return NIL(void*);
|
||||
Treedisc.comparf = comparf;
|
||||
|
||||
return (o = (Tree_t*)dtmatch(dt,key)) ? (void*)(&o->key) : NIL(void*);
|
||||
}
|
||||
|
||||
/* the original tdelete() specifies that it will return the parent pointer
|
||||
** in the tree if there is one. Since we are using a splay tree, a deleted
|
||||
** node is always rotated to the root first. So this implementation always
|
||||
** returns the key of the new root.
|
||||
*/
|
||||
extern
|
||||
void* tdelete(const void* key, void** rootp,
|
||||
int(*comparf)(const void*, const void*) )
|
||||
{
|
||||
reg Dt_t* dt;
|
||||
reg Tree_t* o;
|
||||
Tree_t obj;
|
||||
|
||||
if(!rootp || !(dt = *((Dt_t**)rootp)) )
|
||||
return NIL(void*);
|
||||
|
||||
Treedisc.comparf = comparf;
|
||||
|
||||
obj.key = (void*)key;
|
||||
dtdelete(dt,&obj);
|
||||
|
||||
if(!(o = dtfinger(dt)) )
|
||||
{ dtclose(dt);
|
||||
*rootp = NIL(void*);
|
||||
}
|
||||
|
||||
return o ? (void*)(&o->key) : NIL(void*);
|
||||
}
|
||||
|
||||
/* the below routine assumes a particular layout of Dtlink_t.
|
||||
** If this ever gets changed, this routine should be redone.
|
||||
*/
|
||||
#define lchild link.lh.__left
|
||||
#define rchild link.rh.__rght
|
||||
|
||||
static void _twalk(Tree_t* obj, void(*action)(const void*,VISIT,int), int level)
|
||||
{ if(!obj->lchild && !obj->rchild)
|
||||
(*action)((void*)obj,leaf,level);
|
||||
else
|
||||
{ (*action)((void*)obj,preorder,level);
|
||||
if(obj->lchild)
|
||||
_twalk((Tree_t*)obj->lchild,action,level+1);
|
||||
(*action)((void*)obj,postorder,level);
|
||||
if(obj->rchild)
|
||||
_twalk((Tree_t*)obj->rchild,action,level+1);
|
||||
(*action)((void*)obj,endorder,level);
|
||||
}
|
||||
}
|
||||
|
||||
/* the original twalk allows specifying arbitrary node to start traversal.
|
||||
** Since our root is a dictionary structure, the search here will start
|
||||
** at whichever node happens to be current root.
|
||||
*/
|
||||
extern
|
||||
void twalk(const void* root, void(*action)(const void*,VISIT,int) )
|
||||
{
|
||||
reg Tree_t* o;
|
||||
|
||||
if(root && (o = (Tree_t*)dtfinger((Dt_t*)root)) )
|
||||
_twalk(o,action,0);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -60,7 +60,7 @@ cat{
|
|||
#endif
|
||||
|
||||
/* Windows variants and veneers */
|
||||
#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__)
|
||||
#if !defined(_WINIX) && (__CYGWIN__ || __EMX__)
|
||||
# define _WINIX 1
|
||||
#endif
|
||||
|
||||
|
@ -75,7 +75,7 @@ cat{
|
|||
# if _BLD_STATIC && !_BLD_DLL
|
||||
# undef _DLL
|
||||
# else
|
||||
# if !_UWIN && !defined(_DLL)
|
||||
# if !defined(_DLL)
|
||||
# define _DLL 1
|
||||
# endif
|
||||
# endif
|
||||
|
@ -85,9 +85,6 @@ cat{
|
|||
# if !defined(__IMPORT__) && ( _BLD_DLL || defined(_DLL) )
|
||||
# define __IMPORT__ __declspec(dllimport)
|
||||
# endif
|
||||
# if _BLD_DLL && _UWIN
|
||||
# define __DYNAMIC__(v) (_ast_getdll()->_ast_ ## v)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(_astimport)
|
||||
# if defined(__IMPORT__) && defined(_DLL)
|
||||
|
@ -96,7 +93,7 @@ cat{
|
|||
# define _astimport extern
|
||||
# endif
|
||||
#endif
|
||||
#if _dll_import && ( !_BLD_DLL || _WINIX && !_UWIN )
|
||||
#if _dll_import && ( !_BLD_DLL || _WINIX )
|
||||
# define __EXTERN__(T,obj) extern T obj; T* _imp__ ## obj = &obj
|
||||
# define __DEFINE__(T,obj,val) T obj = val; T* _imp__ ## obj = &obj
|
||||
#else
|
||||
|
@ -517,12 +514,6 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{
|
|||
printf("/* va_arg() va_list type */\n");
|
||||
#endif /*TRY == 4*/
|
||||
|
||||
#if _UWIN
|
||||
printf("#ifndef va_copy\n");
|
||||
printf("#define va_copy(to,fr) ((to)=(fr))\t");
|
||||
printf("/* copy va_list fr -> to */\n");
|
||||
printf("#endif\n");
|
||||
#else
|
||||
#if !defined(va_copy)
|
||||
#if defined(__va_copy)
|
||||
printf("#ifndef va_copy\n");
|
||||
|
@ -542,7 +533,6 @@ tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{
|
|||
printf("#endif\n");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
printf("#endif\n");
|
||||
|
|
|
@ -630,19 +630,6 @@ tst - output{
|
|||
int
|
||||
main()
|
||||
{
|
||||
#if _UWIN
|
||||
printf("\n");
|
||||
printf("/* override some UWIN feature tests */\n");
|
||||
printf("#undef _lib_execlp\n");
|
||||
printf("#undef _lib_execvp\n");
|
||||
printf("#undef _lib_execvpe\n");
|
||||
printf("#undef _lib_fork\n");
|
||||
printf("#undef _std_string\n");
|
||||
printf("#define _std_string 1\n");
|
||||
printf("#undef _stream_peek\n");
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#if _lib_posix_spawn || _lib_spawn_mode || _lib_spawn && _hdr_spawn && _mem_pgroup_inheritance || _lib_vfork && _real_vfork
|
||||
printf("#if !_AST_no_spawnveg\n");
|
||||
printf("#define _use_spawnveg 1\n");
|
||||
|
|
|
@ -295,23 +295,6 @@ int main()
|
|||
#endif
|
||||
|
||||
printf("\n");
|
||||
#ifdef _UWIN
|
||||
printf("#ifdef _UWIN\n");
|
||||
printf("#ifndef DBL_DIG\n");
|
||||
printf("#define DBL_DIG 15\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef DBL_MAX\n");
|
||||
printf("#define DBL_MAX 1.7976931348623158e+308\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef FLT_DIG\n");
|
||||
printf("#define FLT_DIG 6\n");
|
||||
printf("#endif\n");
|
||||
printf("#ifndef FLT_MAX\n");
|
||||
printf("#define FLT_MAX 3.402823466e+38F\n");
|
||||
printf("#endif\n");
|
||||
printf("#endif\n");
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
#include "conflim.h"
|
||||
|
||||
|
|
|
@ -518,9 +518,7 @@ main()
|
|||
printf("#endif\n");
|
||||
#endif
|
||||
#endif
|
||||
printf("#if !_UWIN\n");
|
||||
printf("#undef extern\n");
|
||||
printf("#endif\n");
|
||||
#if _npt_strtold || _map_libc || _std_strtold
|
||||
#if _npt_strtold && !_map_libc && !_std_strtold
|
||||
printf("#ifndef _ISOC99_SOURCE\n");
|
||||
|
|
|
@ -25,7 +25,6 @@ tst tmp_rmfail note{ open files cannot be removed }end execute{
|
|||
int
|
||||
main()
|
||||
{
|
||||
#if !_UWIN
|
||||
int n;
|
||||
char* s;
|
||||
FILE* fr;
|
||||
|
@ -71,7 +70,6 @@ tst tmp_rmfail note{ open files cannot be removed }end execute{
|
|||
fclose(fr);
|
||||
if (strcmp(file, data) != 0)
|
||||
return 0;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
}end
|
||||
|
|
|
@ -115,7 +115,6 @@ output{
|
|||
printf("#ifndef TMP_MAX\n");
|
||||
printf("#define TMP_MAX %d\n", TMP_MAX);
|
||||
printf("#endif\n");
|
||||
#if !_UWIN
|
||||
printf("\n");
|
||||
printf("#define _doprnt _ast_doprnt\n");
|
||||
printf("#define _doscan _ast_doscan\n");
|
||||
|
@ -191,12 +190,7 @@ output{
|
|||
printf("#define putc_unlocked _ast_putc_unlocked\n");
|
||||
printf("#define putchar_unlocked _ast_putchar_unlocked\n");
|
||||
|
||||
printf("#define flockfile _ast_flockfile\n");
|
||||
printf("#define ftrylockfile _ast_ftrylockfile\n");
|
||||
printf("#define funlockfile _ast_funlockfile\n");
|
||||
|
||||
printf("\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
}end
|
||||
|
@ -359,14 +353,12 @@ cat{
|
|||
|
||||
#else
|
||||
|
||||
#if !_UWIN
|
||||
#if _BLD_ast && defined(__EXPORT__)
|
||||
#define extern extern __EXPORT__
|
||||
#endif
|
||||
#if !_BLD_ast && defined(__IMPORT__)
|
||||
#define extern extern __IMPORT__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern FILE _Sfstdin;
|
||||
extern FILE _Sfstdout;
|
||||
|
|
|
@ -5,7 +5,7 @@ _cc_export_dynamic = note{ probe CC.EXPORT.DYNAMIC supported }end run{
|
|||
}end
|
||||
|
||||
tst tzset_environ note{ tzset() bypasses user getenv() }end execute{
|
||||
#if _UWIN || !_cc_export_dynamic
|
||||
#if !_cc_export_dynamic
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
lib a64l,acosh,asinh,atanh,cbrt,ceil,crypt,erf,exp,expm1,floor
|
||||
lib gamma,getpass,lgamma,log,log1p,random,rcmd,rint,srand48
|
||||
lib copysign,logb,finite,drem,sqrt,ilogb,remainder,scalb
|
||||
lib _copysign,_finite,_scalb,__iob_func,_p__iob,__p__iob
|
||||
|
||||
dat _iob
|
||||
|
||||
cat{
|
||||
#define stricmp strcasecmp
|
||||
}end
|
|
@ -40,10 +40,8 @@
|
|||
#define _BLD_aso 1
|
||||
#define _BLD_cdt 1
|
||||
#define _BLD_sfio 1
|
||||
#if !_UWIN
|
||||
#define _BLD_vmalloc 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _SFSTDIO_H
|
||||
#define _SKIP_SFSTDIO_H
|
||||
|
@ -134,8 +132,6 @@ struct lconv
|
|||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
#if !_UWIN /* for AST54 compatibility */
|
||||
|
||||
#undef getenv
|
||||
#define getenv _ast_getenv
|
||||
|
||||
|
@ -144,8 +140,6 @@ struct lconv
|
|||
|
||||
extern char* getenv(const char*);
|
||||
|
||||
#endif
|
||||
|
||||
#undef localeconv
|
||||
#define localeconv _ast_localeconv
|
||||
|
||||
|
|
|
@ -207,10 +207,6 @@ extern Sfio_t* sfstdin;
|
|||
extern Sfio_t* sfstdout;
|
||||
extern Sfio_t* sfstderr;
|
||||
|
||||
#if _UWIN
|
||||
#undef extern
|
||||
#endif
|
||||
|
||||
extern Sfio_t _Sfstdin;
|
||||
extern Sfio_t _Sfstdout;
|
||||
extern Sfio_t _Sfstderr;
|
||||
|
|
|
@ -1986,10 +1986,6 @@ FILE* tmpfile();
|
|||
int fclose(FILE* stream);
|
||||
int pclose(FILE* stream);
|
||||
|
||||
void flockfile(FILE* stream)
|
||||
int ftrylockfile(FILE* stream)
|
||||
void funlockfile(FILE* stream)
|
||||
|
||||
void setbuf(FILE* stream, char* buf);
|
||||
int setvbuf(FILE* stream, char* buf, int mode, size_t size);
|
||||
void setbuffer(FILE* stream, char* buf, size_t size);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -21,16 +21,8 @@
|
|||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#if _UWIN && __STDPP__
|
||||
__STDPP__directive pragma pp:hide getenv
|
||||
#endif
|
||||
|
||||
#include "intercepts.h"
|
||||
|
||||
#if _UWIN && __STDPP__
|
||||
__STDPP__directive pragma pp:nohide getenv
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NOTE: the "intercepts" definition is here instead of astintercept.c because some
|
||||
* static linkers miss lone references to "intercepts" without "astintercept()"
|
||||
|
@ -41,43 +33,6 @@ __STDPP__directive pragma pp:nohide getenv
|
|||
Intercepts_t intercepts
|
||||
= { 0 };
|
||||
|
||||
#if _UWIN && !defined(getenv)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
extern char** environ;
|
||||
|
||||
static char*
|
||||
default_getenv(const char* name)
|
||||
{
|
||||
register char** av;
|
||||
register const char* cp;
|
||||
register const char* sp;
|
||||
register char c0;
|
||||
register char c1;
|
||||
|
||||
av = environ;
|
||||
if (!av || !name || !(c0 = *name))
|
||||
return 0;
|
||||
if (!(c1 = *++name))
|
||||
c1 = '=';
|
||||
while (cp = *av++)
|
||||
{
|
||||
if (cp[0] != c0 || cp[1] != c1)
|
||||
continue;
|
||||
sp = name;
|
||||
cp++;
|
||||
while (*sp && *sp++ == *cp++);
|
||||
if (*(sp-1) != *(cp-1))
|
||||
continue;
|
||||
if (*sp == 0 && *cp == '=')
|
||||
return (char*)(cp+1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* get name from the environment
|
||||
*/
|
||||
|
@ -89,21 +44,6 @@ default_getenv(const char* name)
|
|||
extern char*
|
||||
getenv(const char* name)
|
||||
{
|
||||
#if _UWIN && !defined(getenv) /* for AST54 compatibility */
|
||||
HANDLE dll;
|
||||
|
||||
static char* (*posix_getenv)(const char*);
|
||||
|
||||
if (!posix_getenv)
|
||||
{
|
||||
if (dll = GetModuleHandle("posix.dll"))
|
||||
posix_getenv = (char*(*)(const char*))GetProcAddress(dll, "getenv");
|
||||
if (!posix_getenv)
|
||||
posix_getenv = default_getenv;
|
||||
}
|
||||
return intercepts.intercept_getenv ? (*intercepts.intercept_getenv)(name) : (*posix_getenv)(name);
|
||||
#else
|
||||
#undef getenv
|
||||
return intercepts.intercept_getenv ? (*intercepts.intercept_getenv)(name) : getenv(name);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -839,82 +839,9 @@ ckmagic(register Magic_t* mp, const char* file, char* buf, char* end, struct sta
|
|||
break;
|
||||
|
||||
case 'r':
|
||||
#if _UWIN
|
||||
{
|
||||
char* e;
|
||||
Sfio_t* rp;
|
||||
Sfio_t* gp;
|
||||
|
||||
if (!(t = strrchr(file, '.')))
|
||||
goto next;
|
||||
sfprintf(mp->tmp, "/reg/classes_root/%s", t);
|
||||
if (!(t = sfstruse(mp->tmp)) || !(rp = sfopen(NiL, t, "r")))
|
||||
goto next;
|
||||
*ep->desc = 0;
|
||||
*ep->mime = 0;
|
||||
gp = 0;
|
||||
while (t = sfgetr(rp, '\n', 1))
|
||||
{
|
||||
if (strneq(t, "Content Type=", 13))
|
||||
{
|
||||
ep->mime = vmnewof(mp->vm, ep->mime, char, sfvalue(rp), 0);
|
||||
strcpy(ep->mime, t + 13);
|
||||
if (gp)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sfprintf(mp->tmp, "/reg/classes_root/%s", t);
|
||||
if ((e = sfstruse(mp->tmp)) && (gp = sfopen(NiL, e, "r")))
|
||||
{
|
||||
ep->desc = vmnewof(mp->vm, ep->desc, char, strlen(t), 1);
|
||||
strcpy(ep->desc, t);
|
||||
if (*ep->mime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sfclose(rp);
|
||||
if (!gp)
|
||||
goto next;
|
||||
if (!*ep->mime)
|
||||
{
|
||||
t = T(ep->desc);
|
||||
if (!strncasecmp(t, "microsoft", 9))
|
||||
t += 9;
|
||||
while (isspace(*t))
|
||||
t++;
|
||||
e = "application/x-ms-";
|
||||
ep->mime = vmnewof(mp->vm, ep->mime, char, strlen(t), strlen(e));
|
||||
e = strcopy(ep->mime, e);
|
||||
while ((c = *t++) && c != '.' && c != ' ')
|
||||
*e++ = isupper(c) ? tolower(c) : c;
|
||||
*e = 0;
|
||||
}
|
||||
while (t = sfgetr(gp, '\n', 1))
|
||||
if (*t && !streq(t, "\"\""))
|
||||
{
|
||||
ep->desc = vmnewof(mp->vm, ep->desc, char, sfvalue(gp), 0);
|
||||
strcpy(ep->desc, t);
|
||||
break;
|
||||
}
|
||||
sfclose(gp);
|
||||
if (!*ep->desc)
|
||||
goto next;
|
||||
if (!t)
|
||||
for (t = T(ep->desc); *t; t++)
|
||||
if (*t == '.')
|
||||
*t = ' ';
|
||||
if (!mp->keep[level])
|
||||
mp->keep[level] = 2;
|
||||
mp->mime = ep->mime;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (ep->cont == '#' && !mp->keep[level])
|
||||
mp->keep[level] = 1;
|
||||
goto next;
|
||||
#endif
|
||||
|
||||
case 'v':
|
||||
if (!(p = getdata(mp, num, 4)))
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* fun==SIG_DFL also unblocks signal
|
||||
*/
|
||||
|
||||
#if !_UWIN && !__HAIKU__
|
||||
#if !__HAIKU__
|
||||
|
||||
#undef signal
|
||||
#define signal ______signal
|
||||
|
@ -36,8 +36,6 @@
|
|||
#include <ast.h>
|
||||
#include <sig.h>
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
#undef signal
|
||||
|
||||
#undef _def_map_ast
|
||||
|
@ -47,8 +45,6 @@
|
|||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(SV_ABORT)
|
||||
#undef SV_INTERRUPT
|
||||
#define SV_INTERRUPT SV_ABORT
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -65,9 +65,6 @@ pathkey_20100601(const char* lang, const char* tool, const char* apath, char* ke
|
|||
char* env[elementsof(usr) + 3];
|
||||
char* ver[2];
|
||||
char tmp[PATH_MAX];
|
||||
#if _UWIN
|
||||
struct stat st;
|
||||
#endif
|
||||
|
||||
static char let[] = "ABCDEFGHIJKLMNOP";
|
||||
|
||||
|
@ -127,15 +124,6 @@ pathkey_20100601(const char* lang, const char* tool, const char* apath, char* ke
|
|||
attr = strcopy(attr, k);
|
||||
}
|
||||
#endif
|
||||
#if _UWIN
|
||||
if (!stat("/", &st) && st.st_ino == 64)
|
||||
{
|
||||
k = "/64";
|
||||
n = memsum(k, strlen(k), n);
|
||||
if (attr)
|
||||
attr = strcopy(attr, k);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* universe
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -33,18 +33,6 @@
|
|||
|
||||
#include <ast.h>
|
||||
|
||||
#if _UWIN
|
||||
|
||||
extern int uwin_path(const char*, char*, int);
|
||||
|
||||
size_t
|
||||
pathnative(const char* path, char* buf, size_t siz)
|
||||
{
|
||||
return uwin_path(path, buf, siz);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if __CYGWIN__
|
||||
|
||||
extern void cygwin_conv_to_win32_path(const char*, char*);
|
||||
|
@ -122,5 +110,3 @@ pathnative(const char* path, char* buf, size_t siz)
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -33,18 +33,6 @@
|
|||
|
||||
#include <ast.h>
|
||||
|
||||
#if _UWIN
|
||||
|
||||
#include <uwin.h>
|
||||
|
||||
size_t
|
||||
pathposix(const char* path, char* buf, size_t siz)
|
||||
{
|
||||
return uwin_unpath(path, buf, siz);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if __CYGWIN__
|
||||
|
||||
extern void cygwin_conv_to_posix_path(const char*, char*);
|
||||
|
@ -124,5 +112,3 @@ pathposix(const char* path, char* buf, size_t siz)
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -605,11 +605,7 @@ format(register Feature_t* fp, const char* path, const char* value, unsigned int
|
|||
{
|
||||
register Feature_t* sp;
|
||||
register int n;
|
||||
#if _UWIN && ( _X86_ || _X64_ )
|
||||
struct stat st;
|
||||
#else
|
||||
static struct utsname uts;
|
||||
#endif
|
||||
|
||||
#if DEBUG_astconf
|
||||
error(-6, "astconf format name=%s path=%s value=%s flags=%04x fp=%p%s", fp->name, path, value, flags, fp, state.synthesizing ? " SYNTHESIZING" : "");
|
||||
|
@ -622,31 +618,10 @@ format(register Feature_t* fp, const char* path, const char* value, unsigned int
|
|||
{
|
||||
|
||||
case OP_architecture:
|
||||
#if _UWIN && ( _X86_ || _X64_ )
|
||||
if (!stat("/", &st))
|
||||
{
|
||||
if (st.st_ino == 64)
|
||||
{
|
||||
fp->value = "x64";
|
||||
break;
|
||||
}
|
||||
if (st.st_ino == 32)
|
||||
{
|
||||
fp->value = "x86";
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if _X64_
|
||||
fp->value = "x64";
|
||||
#else
|
||||
fp->value = "x86";
|
||||
#endif
|
||||
#else
|
||||
if (!uname(&uts))
|
||||
return fp->value = uts.machine;
|
||||
if (!(fp->value = getenv("HOSTNAME")))
|
||||
fp->value = "unknown";
|
||||
#endif
|
||||
break;
|
||||
|
||||
case OP_conformance:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -25,88 +25,6 @@
|
|||
* AST dynamic data initialization
|
||||
*/
|
||||
|
||||
#ifdef _UWIN
|
||||
|
||||
#define _std_def_cfree 1
|
||||
|
||||
#include <sfio_t.h>
|
||||
#include <ast.h>
|
||||
|
||||
#undef strcoll
|
||||
|
||||
#include <ast_windows.h>
|
||||
|
||||
extern Sfio_t _Sfstdin;
|
||||
extern Sfio_t _Sfstdout;
|
||||
extern Sfio_t _Sfstderr;
|
||||
|
||||
#include "sfhdr.h"
|
||||
|
||||
#undef sfstdin
|
||||
#undef sfstdout
|
||||
#undef sfstderr
|
||||
|
||||
#if defined(__EXPORT__)
|
||||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
/*
|
||||
* for backward compatibility with early UNIX
|
||||
*/
|
||||
|
||||
extern void
|
||||
cfree(void* addr)
|
||||
{
|
||||
free(addr);
|
||||
}
|
||||
|
||||
extern void
|
||||
_ast_libinit(void* in, void* out, void* err)
|
||||
{
|
||||
Sfio_t* sp;
|
||||
|
||||
sp = (Sfio_t*)in;
|
||||
*sp = _Sfstdin;
|
||||
sfstdin = sp;
|
||||
sp = (Sfio_t*)out;
|
||||
*sp = _Sfstdout;
|
||||
sfstdout = sp;
|
||||
sp = (Sfio_t*)err;
|
||||
*sp = _Sfstderr;
|
||||
sfstderr = sp;
|
||||
}
|
||||
|
||||
extern void
|
||||
_ast_init(void)
|
||||
{
|
||||
struct _astdll* ap = _ast_getdll();
|
||||
|
||||
_ast_libinit(ap->_ast_stdin,ap->_ast_stdout,ap->_ast_stderr);
|
||||
}
|
||||
|
||||
extern void
|
||||
_ast_exit(void)
|
||||
{
|
||||
if (_Sfcleanup)
|
||||
(*_Sfcleanup)();
|
||||
}
|
||||
|
||||
BOOL WINAPI
|
||||
DllMain(HINSTANCE hinst, DWORD reason, VOID* reserved)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
_ast_exit();
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <ast.h>
|
||||
|
||||
#if _dll_data_intercept && ( _DLL_BLD || _BLD_DLL )
|
||||
|
@ -128,5 +46,3 @@ _ast_getdll(void)
|
|||
NoN(astdynamic)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
_doprnt(const char* fmt, va_list args, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "_doprnt", int, (const char*, va_list, Sfio_t*), (fmt, args, f))
|
||||
|
||||
return sfvprintf(f, fmt, args);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
_doscan(Sfio_t* f, const char* fmt, va_list args)
|
||||
{
|
||||
STDIO_INT(f, "_doscan", int, (Sfio_t*, const char*, va_list), (f, fmt, args))
|
||||
|
||||
return sfvscanf(f, fmt, args);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -30,7 +30,5 @@
|
|||
extern int
|
||||
_filbuf(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "_filbuf", int, (Sfio_t*), (f))
|
||||
|
||||
return _sffilbuf(f, 0);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -36,8 +36,6 @@ NoN(_flsbuf)
|
|||
extern int
|
||||
_flsbuf(int c, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "_flsbuf", int, (int, Sfio_t*), (c, f))
|
||||
|
||||
return _sfflsbuf(f, c);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include <ast.h>
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
void _STUB_stdfun(){}
|
||||
|
||||
#else
|
||||
|
||||
#include <ast_windows.h>
|
||||
#include <uwin.h>
|
||||
#include <dlfcn.h>
|
||||
#include "FEATURE/uwin"
|
||||
|
||||
#if _lib___iob_func
|
||||
#define IOB ((char*)__iob_func())
|
||||
#elif _lib___p__iob
|
||||
#define IOB ((char*)__p__iob())
|
||||
#elif _dat__iob
|
||||
#define IOB ((char*)_iob)
|
||||
#else
|
||||
#define IOB ((char*)_p__iob())
|
||||
#endif
|
||||
|
||||
#define IOBMAX (512*32)
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
int
|
||||
_stdfun(Sfio_t* f, Funvec_t* vp)
|
||||
{
|
||||
static char* iob;
|
||||
static int init;
|
||||
static void* bp;
|
||||
static void* np;
|
||||
|
||||
if (!iob && !(iob = IOB))
|
||||
return 0;
|
||||
if (f && ((char*)f < iob || (char*)f > iob+IOBMAX))
|
||||
return 0;
|
||||
if (!vp->vec[1])
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
init = 1;
|
||||
bp = dlopen("/usr/bin/stdio.dll", 0);
|
||||
}
|
||||
if (bp && (vp->vec[1] = (Fun_f)dlsym(bp, vp->name)))
|
||||
return 1;
|
||||
if (!np && !(np = dlopen("/sys/msvcrt.dll", 0)))
|
||||
return -1;
|
||||
if (!(vp->vec[1] = (Fun_f)dlsym(np, vp->name)))
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
int
|
||||
clearerr(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "clearerr", int, (Sfio_t*), (f))
|
||||
|
||||
sfclrerr(f);
|
||||
return sfclrlock(f);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fclose(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fclose", int, (Sfio_t*), (f))
|
||||
|
||||
return sfclose(f);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -35,8 +35,6 @@ fcloseall(void)
|
|||
int count;
|
||||
int loop;
|
||||
|
||||
STDIO_INT(0, "fcloseall", int, (void), ())
|
||||
|
||||
for(loop = 0; loop < MAXLOOP; ++loop)
|
||||
{ nclose = count = 0;
|
||||
for(p = &_Sfpool; p; p = next)
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(feof)
|
||||
|
||||
#else
|
||||
|
||||
#undef feof
|
||||
|
||||
int
|
||||
feof(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "feof", int, (Sfio_t*), (f))
|
||||
|
||||
return sfeof(f);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(ferror)
|
||||
|
||||
#else
|
||||
|
||||
#undef ferror
|
||||
|
||||
int
|
||||
ferror(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "ferror", int, (Sfio_t*), (f))
|
||||
|
||||
return sferror(f);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -33,8 +33,6 @@ fflush(Sfio_t* f)
|
|||
if (!f)
|
||||
return fcloseall();
|
||||
|
||||
STDIO_INT(f, "fflush", int, (Sfio_t*), (f))
|
||||
|
||||
if (f->extent > 0)
|
||||
sfseek(f, (Sfoff_t)0, SEEK_CUR|SF_PUBLIC);
|
||||
return (sfsync(f) < 0 || sfpurge(f) < 0) ? -1 : 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fgetc(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fgetc", int, (Sfio_t*), (f))
|
||||
|
||||
return sfgetc(f);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fgetpos(Sfio_t* f, fpos_t* pos)
|
||||
{
|
||||
STDIO_INT(f, "fgetpos", int, (Sfio_t*, fpos_t*), (f, pos))
|
||||
|
||||
return (pos->_sf_offset = sfseek(f, (Sfoff_t)0, SEEK_CUR)) >= 0 ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -98,8 +98,6 @@ _stdgets(Sfio_t* f, char* us, int n, int isgets)
|
|||
char*
|
||||
fgets(char* s, int n, Sfio_t* f)
|
||||
{
|
||||
STDIO_PTR(f, "fgets", char*, (char*, int, Sfio_t*), (s, n, f))
|
||||
|
||||
return _stdgets(f, s, n, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -28,8 +28,6 @@ fgetwc(Sfio_t* f)
|
|||
{
|
||||
wchar_t c;
|
||||
|
||||
STDIO_INT(f, "fgetwc", wint_t, (Sfio_t*), (f))
|
||||
|
||||
FWIDE(f, WEOF);
|
||||
return (sfread(f, &c, sizeof(c)) == sizeof(c)) ? c : WEOF;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -30,8 +30,6 @@ fgetws(wchar_t* s, int n, Sfio_t* f)
|
|||
register wchar_t* e = s + n - 1;
|
||||
register wint_t c;
|
||||
|
||||
STDIO_PTR(f, "fgets", wchar_t*, (wchar_t*, int, Sfio_t*), (s, n, f))
|
||||
|
||||
FWIDE(f, 0);
|
||||
while (p < e && (c = fgetwc(f)) != WEOF && (*p++ = c) != '\n');
|
||||
*p = 0;
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(fileno)
|
||||
|
||||
#else
|
||||
|
||||
#undef fileno
|
||||
|
||||
int
|
||||
fileno(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fileno", int, (Sfio_t*), (f))
|
||||
|
||||
return sffileno(f);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -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 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
void
|
||||
flockfile(Sfio_t* f)
|
||||
{
|
||||
STDIO_VOID(f, "flockfile", void, (Sfio_t*), (f))
|
||||
}
|
|
@ -26,7 +26,5 @@
|
|||
Sfio_t*
|
||||
fmemopen(void* buf, size_t size, const char* mode)
|
||||
{
|
||||
STDIO_PTR(0, "fmemopen", Sfio_t*, (void*, size_t, const char*), (buf, size, mode))
|
||||
|
||||
return sfnew(NiL, buf, size, -1, SF_STRING|_sftype(mode, NiL, NiL));
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -31,8 +31,6 @@ fprintf(Sfio_t* f, const char* fmt, ...)
|
|||
|
||||
va_start(args, fmt);
|
||||
|
||||
STDIO_INT(f, "vfprintf", int, (Sfio_t*, const char*, va_list), (f, fmt, args))
|
||||
|
||||
v = sfvprintf(f, fmt, args);
|
||||
va_end(args);
|
||||
return v;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fpurge(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fpurge", int, (Sfio_t*), (f))
|
||||
|
||||
return sfpurge(f);
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(fputc)
|
||||
|
||||
#else
|
||||
|
||||
#undef fputc
|
||||
|
||||
int
|
||||
fputc(int c, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fputc", int, (int, Sfio_t*), (c, f))
|
||||
|
||||
return sfputc(f, c);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fputs(const char* s, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fputs", int, (const char*, Sfio_t*), (s, f))
|
||||
|
||||
return sfputr(f, s, -1);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
wint_t
|
||||
fputwc(wchar_t c, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "fputc", wint_t, (wchar_t, Sfio_t*), (c, f))
|
||||
|
||||
FWIDE(f, WEOF);
|
||||
return (sfwrite(f, &c, sizeof(c)) == sizeof(c)) ? c : WEOF;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -28,8 +28,6 @@ fputws(const wchar_t* s, Sfio_t* f)
|
|||
{
|
||||
size_t n;
|
||||
|
||||
STDIO_INT(f, "fputws", int, (const wchar_t*, Sfio_t*), (s, f))
|
||||
|
||||
FWIDE(f, WEOF);
|
||||
n = wcslen(s) * sizeof(wchar_t);
|
||||
return (sfwrite(f, s, n) == n) ? 0 : -1;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -28,7 +28,5 @@ fread(void* p, size_t s, size_t n, Sfio_t* f)
|
|||
{
|
||||
ssize_t v;
|
||||
|
||||
STDIO_INT(f, "fread", ssize_t, (void*, size_t, size_t, Sfio_t*), (p, s, n, f))
|
||||
|
||||
return ((v = sfread(f, p, s * n)) <= 0) ? 0 : (v / s);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
Sfio_t*
|
||||
freopen(const char* path, const char* mode, Sfio_t* f)
|
||||
{
|
||||
STDIO_PTR(f, "freopen", Sfio_t*, (const char*, const char*, Sfio_t*), (path, mode, f))
|
||||
|
||||
return sfopen(f, path, mode);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -31,8 +31,6 @@ fscanf(Sfio_t* f, const char* fmt, ...)
|
|||
|
||||
va_start(args, fmt);
|
||||
|
||||
STDIO_INT(f, "vfscanf", int, (Sfio_t*, const char*, va_list), (f, fmt, args))
|
||||
|
||||
v = sfvscanf(f, fmt, args);
|
||||
va_end(args);
|
||||
return v;
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fseek(Sfio_t* f, long off, int op)
|
||||
{
|
||||
STDIO_INT(f, "fseek", int, (Sfio_t*, long, int), (f, off, op))
|
||||
|
||||
return sfseek(f, (Sfoff_t)off, op|SF_SHARE) >= 0 ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fseeko(Sfio_t* f, off_t off, int op)
|
||||
{
|
||||
STDIO_INT(f, "fseeko", int, (Sfio_t*, off_t, int), (f, off, op))
|
||||
|
||||
return sfseek(f, (Sfoff_t)off, op|SF_SHARE) >= 0 ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
fsetpos(Sfio_t* f, const fpos_t* pos)
|
||||
{
|
||||
STDIO_INT(f, "fsetpos", int, (Sfio_t*, const fpos_t*), (f, pos))
|
||||
|
||||
return sfseek(f, (Sfoff_t)pos->_sf_offset, SF_PUBLIC) == (Sfoff_t)pos->_sf_offset ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
long
|
||||
ftell(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "ftell", long, (Sfio_t*), (f))
|
||||
|
||||
return (long)sfseek(f, (Sfoff_t)0, SEEK_CUR);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,5 @@
|
|||
off_t
|
||||
ftello(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "ftello", off_t, (Sfio_t*), (f))
|
||||
|
||||
return sfseek(f, (Sfoff_t)0, SEEK_CUR);
|
||||
}
|
||||
|
|
|
@ -1,32 +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 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
int
|
||||
ftrylockfile(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "ftrylockfile", int, (Sfio_t*), (f))
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -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 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
void
|
||||
funlockfile(Sfio_t* f)
|
||||
{
|
||||
STDIO_VOID(f, "funlockfile", void, (Sfio_t*), (f))
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
int
|
||||
fwide(Sfio_t* f, int mode)
|
||||
{
|
||||
STDIO_INT(f, "fwide", int, (Sfio_t*, int), (f, mode))
|
||||
|
||||
if (mode > 0)
|
||||
{
|
||||
f->bits &= ~SF_MB;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -28,7 +28,5 @@ fwrite(const void* p, size_t s, size_t n, Sfio_t* f)
|
|||
{
|
||||
ssize_t v;
|
||||
|
||||
STDIO_INT(f, "fwrite", ssize_t, (const void*, size_t, size_t, Sfio_t*), (p, s, n, f))
|
||||
|
||||
return ((v = sfwrite(f, p, s * n)) <= 0) ? 0 : (v / s);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -31,8 +31,6 @@ fwscanf(Sfio_t* f, const wchar_t* fmt, ...)
|
|||
|
||||
va_start(args, fmt);
|
||||
|
||||
STDIO_INT(f, "vfwscanf", int, (Sfio_t*, const wchar_t*, va_list), (f, fmt, args))
|
||||
|
||||
v = vfwscanf(f, fmt, args);
|
||||
va_end(args);
|
||||
return v;
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(getc)
|
||||
|
||||
#else
|
||||
|
||||
#undef getc
|
||||
|
||||
int
|
||||
getc(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "getc", int, (Sfio_t*), (f))
|
||||
|
||||
return sfgetc(f);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,40 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(getchar)
|
||||
|
||||
#else
|
||||
|
||||
#undef getchar
|
||||
|
||||
int
|
||||
getchar(void)
|
||||
{
|
||||
return sfgetc(sfstdin);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -33,8 +33,6 @@ getdelim(char** sp, size_t* np, int delim, Sfio_t* f)
|
|||
uchar* s;
|
||||
uchar* ps;
|
||||
|
||||
STDIO_INT(f, "getdelim", ssize_t, (char**, size_t*, int, Sfio_t*), (sp, np, delim, f))
|
||||
|
||||
if(delim < 0 || delim > 255 || !sp || !np) /* bad parameters */
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -30,7 +30,5 @@
|
|||
ssize_t
|
||||
getline(char** sp, size_t* np, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "getline", ssize_t, (char**, size_t*, Sfio_t*), (sp, np, f))
|
||||
|
||||
return getdelim(sp, np, '\n', f);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -28,7 +28,5 @@ getw(Sfio_t* f)
|
|||
{
|
||||
int v;
|
||||
|
||||
STDIO_INT(f, "getw", int, (Sfio_t*), (f))
|
||||
|
||||
return sfread(f, &v, sizeof(v)) == sizeof(v) ? v : -1;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
pclose(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "pclose", int, (Sfio_t*), (f))
|
||||
|
||||
return sfclose(f);
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(putc)
|
||||
|
||||
#else
|
||||
|
||||
#undef putc
|
||||
|
||||
int
|
||||
putc(int c, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "putc", int, (int, Sfio_t*), (c, f))
|
||||
|
||||
return sfputc(f, c);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -23,18 +23,4 @@
|
|||
|
||||
#include "stdhdr.h"
|
||||
|
||||
#if !_UWIN
|
||||
|
||||
NoN(putchar)
|
||||
|
||||
#else
|
||||
|
||||
#undef putchar
|
||||
|
||||
int
|
||||
putchar(int c)
|
||||
{
|
||||
return sfputc(sfstdout, c);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
putw(int v, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "putw", int, (int, Sfio_t*), (v, f))
|
||||
|
||||
return sfwrite(f, &v, sizeof(v)) == sizeof(v) ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
void
|
||||
rewind(Sfio_t* f)
|
||||
{
|
||||
STDIO_VOID(f, "rewind", void, (Sfio_t*), (f))
|
||||
|
||||
sfseek(f, (Sfoff_t)0, SEEK_SET|SF_PUBLIC);
|
||||
sfclrlock(f);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
void
|
||||
setbuf(Sfio_t* f, char* b)
|
||||
{
|
||||
STDIO_VOID(f, "setbuf", void, (Sfio_t*, char*), (f, b))
|
||||
|
||||
sfsetbuf(f, b, b ? BUFSIZ : 0);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
setbuffer(Sfio_t* f, char* b, int n)
|
||||
{
|
||||
STDIO_INT(f, "setbuffer", int, (Sfio_t*, char*, int), (f, b, n))
|
||||
|
||||
return sfsetbuf(f, b, n) ? 0 : -1;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
int
|
||||
setlinebuf(Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "setlinebuf", int, (Sfio_t*), (f))
|
||||
|
||||
sfset(f, SF_LINE, 1);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,8 +26,6 @@
|
|||
int
|
||||
setvbuf(Sfio_t* f, char* buf, int type, size_t size)
|
||||
{
|
||||
STDIO_INT(f, "setvbuf", int, (Sfio_t*, char*, int, size_t), (f, buf, type, size))
|
||||
|
||||
if (type == _IOLBF)
|
||||
sfset(f, SF_LINE, 1);
|
||||
else if (f->flags & SF_STRING)
|
||||
|
|
|
@ -37,64 +37,6 @@
|
|||
#define SF_MB 010000
|
||||
#define SF_WC 020000
|
||||
|
||||
#if _UWIN
|
||||
|
||||
#define STDIO_TRANSFER 1
|
||||
|
||||
typedef int (*Fun_f)();
|
||||
|
||||
typedef struct Funvec_s
|
||||
{
|
||||
const char* name;
|
||||
Fun_f vec[2];
|
||||
} Funvec_t;
|
||||
|
||||
extern int _stdfun(Sfio_t*, Funvec_t*);
|
||||
|
||||
#define STDIO_INT(p,n,t,f,a) \
|
||||
{ \
|
||||
typedef t (*_s_f)f; \
|
||||
int _i; \
|
||||
static Funvec_t _v = { n }; \
|
||||
if ((_i = _stdfun(p, &_v)) < 0) \
|
||||
return -1; \
|
||||
else if (_i > 0) \
|
||||
return ((_s_f)_v.vec[_i])a; \
|
||||
}
|
||||
|
||||
#define STDIO_PTR(p,n,t,f,a) \
|
||||
{ \
|
||||
typedef t (*_s_f)f; \
|
||||
int _i; \
|
||||
static Funvec_t _v = { n }; \
|
||||
if ((_i = _stdfun(p, &_v)) < 0) \
|
||||
return 0; \
|
||||
else if (_i > 0) \
|
||||
return ((_s_f)_v.vec[_i])a; \
|
||||
}
|
||||
|
||||
#define STDIO_VOID(p,n,t,f,a) \
|
||||
{ \
|
||||
typedef t (*_s_f)f; \
|
||||
int _i; \
|
||||
static Funvec_t _v = { n }; \
|
||||
if ((_i = _stdfun(p, &_v)) < 0) \
|
||||
return; \
|
||||
else if (_i > 0) \
|
||||
{ \
|
||||
((_s_f)_v.vec[_i])a; \
|
||||
return; \
|
||||
} \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define STDIO_INT(p,n,t,f,a)
|
||||
#define STDIO_PTR(p,n,t,f,a)
|
||||
#define STDIO_VOID(p,n,t,f,a)
|
||||
|
||||
#endif
|
||||
|
||||
#define FWIDE(f,r) \
|
||||
do \
|
||||
{ \
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
ungetc(int c, Sfio_t* f)
|
||||
{
|
||||
STDIO_INT(f, "ungetc", int, (int, Sfio_t*), (c, f))
|
||||
|
||||
return sfungetc(f, c);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -29,8 +29,6 @@ ungetwc(wint_t c, Sfio_t* f)
|
|||
register unsigned char* s = (unsigned char*)&c;
|
||||
register unsigned char* e = s + sizeof(c);
|
||||
|
||||
STDIO_INT(f, "ungetwc", wint_t, (wint_t, Sfio_t*), (c, f))
|
||||
|
||||
FWIDE(f, WEOF);
|
||||
while (s < e)
|
||||
if (sfungetc(f, *s++) == EOF)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
vfprintf(Sfio_t* f, const char* fmt, va_list args)
|
||||
{
|
||||
STDIO_INT(f, "vfprintf", int, (Sfio_t*, const char*, va_list), (f, fmt, args))
|
||||
|
||||
return sfvprintf(f, fmt, args);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* Copyright (c) 2020-2022 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
@ -26,7 +26,5 @@
|
|||
int
|
||||
vfscanf(Sfio_t* f, const char* fmt, va_list args)
|
||||
{
|
||||
STDIO_INT(f, "vfscanf", int, (Sfio_t*, const char*, va_list), (f, fmt, args))
|
||||
|
||||
return sfvscanf(f, fmt, args);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue