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

included commits to RCS files with non-trunk default branches.
This commit is contained in:
jshepher
2004-09-09 22:52:26 +00:00
213 changed files with 6541 additions and 1350 deletions
+71 -60
View File
@@ -29,36 +29,31 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CC = @CC@
CPP = @CPP@
AS = as
RANLIB = @RANLIB@
#### End system configuration section ####
V=VER: libnix 1.2 (14.7.98)
V=VER: libnix 2.0 BETA (12.4.2000)
CURDIR := $(shell pwd)
MAKE=make -f $(CURDIR)/sources/Makefile
MAK2=$(MAKE) -f $(CURDIR)/sources/Makefile
SUBDIRS=startup lib libb lib020 libb020 lib881 libb881#lib060 libb060 libb32 libb32881
SUBDIRS=startup lib libb lib020 libb020 lib881 libb881#lib060 libb060 libb32 libb32881 libb32060
all: libnix.guide libnix.info $(SUBDIRS)
cd sources; make filelists
cd startup; make -f $(CURDIR)/sources/startup/Makefile V="$(V)"
cd lib; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer"
cd libb; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA"
cd lib020; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68020"
cd libb020; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68020"
cd lib881; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68020 -m68881"
cd libb881; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68020 -m68881"
# cd lib060; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68060 -m68881"
# cd libb060; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68060 -m68881"
# cd libb32; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel32 -DSMALL_DATA -m68020"
# cd libb32881; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel32 -DSMALL_DATA -m68020 -m68881"
# cd libix; $(MAKE) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -DIXPATHS"
cd sources; $(MAKE) filelists
cd startup; $(MAKE) -f $(CURDIR)/sources/startup/Makefile V="$(V)"
cd lib; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer"
cd libb; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA"
cd lib020; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68020"
cd libb020; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68020"
cd lib881; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68020 -m68881"
cd libb881; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68020 -m68881"
# cd lib060; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -m68060 -m68881"
# cd libb060; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel -DSMALL_DATA -m68060 -m68881"
# cd libb32; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel32 -DSMALL_DATA -m68020"
# cd libb32881; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel32 -DSMALL_DATA -m68020 -m68881"
# cd libb32060; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -fbaserel32 -DSMALL_DATA -m68060 -m68881"
# cd libix; $(MAK2) V="$(V)" CFLAGS="-Wall -O3 -fomit-frame-pointer -DIXPATHS"
$(SUBDIRS):
mkdir $@
@@ -67,37 +62,39 @@ libamiga:
if [ ! -d lib ] ; then mkdir lib ; else true ; fi
if [ ! -d libb ] ; then mkdir libb ; else true ; fi
if [ ! -d libb32 ] ; then mkdir libb32 ; else true ; fi
cd sources; make filelists
cd lib; $(MAKE) libamiga CFLAGS="-O3 -fomit-frame-pointer"
cd libb; $(MAKE) libamiga CFLAGS="-O3 -fomit-frame-pointer -fbaserel"
cd libb32; $(MAKE) libamiga CFLAGS="-O3 -fomit-frame-pointer -fbaserel32 -m68020"
cd sources; $(MAK2) filelists
cd lib; $(MAK2) libamiga CFLAGS="-O3 -fomit-frame-pointer"
cd libb; $(MAK2) libamiga CFLAGS="-O3 -fomit-frame-pointer -fbaserel"
# cd libb32; $(MAK2) libamiga CFLAGS="-O3 -fomit-frame-pointer -fbaserel32 -m68020"
clean:
cd lib; $(MAKE) clean
cd libb; $(MAKE) clean
cd lib020; $(MAKE) clean
cd libb020; $(MAKE) clean
cd lib881; $(MAKE) clean
cd libb881; $(MAKE) clean
# cd lib060; $(MAKE) clean
# cd libb060; $(MAKE) clean
# cd lib32; $(MAKE) clean
# cd libb32881; $(MAKE) clean
# cd libix; $(MAKE) clean
cd lib; $(MAK2) clean
cd libb; $(MAK2) clean
cd lib020; $(MAK2) clean
cd libb020; $(MAK2) clean
cd lib881; $(MAK2) clean
cd libb881; $(MAK2) clean
# cd lib060; $(MAK2) clean
# cd libb060; $(MAK2) clean
# cd lib32; $(MAK2) clean
# cd libb32881; $(MAK2) clean
# cd libb32060; $(MAK2) clean
# cd libix; $(MAK2) clean
-rm -f sources/*/filelist sources/stubs/libbases/* sources/stubs/libnames/*
veryclean:
cd lib; $(MAKE) veryclean
cd libb; $(MAKE) veryclean
cd lib020; $(MAKE) veryclean
cd libb020; $(MAKE) veryclean
cd lib881; $(MAKE) veryclean
cd libb881; $(MAKE) veryclean
# cd lib060; $(MAKE) veryclean
# cd libb060; $(MAKE) veryclean
# cd lib32; $(MAKE) veryclean
# cd libb32881; $(MAKE) veryclean
# cd libix; $(MAKE) veryclean
cd lib; $(MAK2) veryclean
cd libb; $(MAK2) veryclean
cd lib020; $(MAK2) veryclean
cd libb020; $(MAK2) veryclean
cd lib881; $(MAK2) veryclean
cd libb881; $(MAK2) veryclean
# cd lib060; $(MAK2) veryclean
# cd libb060; $(MAK2) veryclean
# cd lib32; $(MAK2) veryclean
# cd libb32881; $(MAK2) veryclean
# cd libb32060; $(MAK2) veryclean
# cd libix; $(MAK2) veryclean
-rm sources/*/filelist
libnix.guide: libnix.texi
@@ -120,16 +117,18 @@ install: installdirs
$(INSTALL) lib881/misc/*.o $(prefix)/lib/libm020/libm881/libnix
$(INSTALL) libb881/*/lib*.a $(prefix)/lib/libb/libm020/libm881/libnix
$(INSTALL) libb881/misc/*.o $(prefix)/lib/libb/libm020/libm881/libnix
$(INSTALL_DATA) *.info* $(infodir)
$(INSTALL_DATA) libnix.guide $(guidedir)/libnix.guide
# $(INSTALL) lib060/*/lib*.a $(prefix)/lib/libm060/libnix
# $(INSTALL) lib060/misc/*.o $(prefix)/lib/libm060/libnix
# $(INSTALL) libb060/*/lib*.a $(prefix)/lib/libb/libm060/libnix
# $(INSTALL) libb060/misc/*.o $(prefix)/lib/libb/libm060/libnix
# $(INSTALL) libb32/*/lib*.a $(prefix)/lib/libb32/libm020/libnix
# $(INSTALL) libb32/misc/*.o $(prefix)/lib/libb32/libm020/libnix
# $(INSTALL) libb32881/*/lib*.a $(prefix)/lib/libb32/libm020/libm881/libnix
# $(INSTALL) libb32881/misc/*.o $(prefix)/lib/libb32/libm020/libm881/libnix
# $(INSTALL) libb32/*/lib*.a $(prefix)/lib/libb32/libm020/libnix
# $(INSTALL) libb32/misc/*.o $(prefix)/lib/libb32/libm020/libnix
# $(INSTALL) libb32881/*/lib*.a $(prefix)/lib/libb32/libm020/libm881/libnix
# $(INSTALL) libb32881/misc/*.o $(prefix)/lib/libb32/libm020/libm881/libnix
# $(INSTALL) libb32060/*/lib*.a $(prefix)/lib/libb32/libm060/libnix
# $(INSTALL) libb32060/misc/*.o $(prefix)/lib/libb32/libm060/libnix
$(INSTALL_DATA) *.info* $(infodir)
$(INSTALL_DATA) libnix.guide $(guidedir)/libnix.guide
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs \
@@ -151,12 +150,14 @@ installdirs: mkinstalldirs
# $(libdir)/libm060/libnix \
# $(libdir)/libb/libm060 \
# $(libdir)/libb/libm060/libnix
# $(libdir)/libb32 \
# $(libdir)/libb32/libnix \
# $(libdir)/libb32/libm020 \
# $(libdir)/libb32/libm020/libnix \
# $(libdir)/libb32/libm020/libm881 \
# $(libdir)/libb32/libm020/libm881/libnix
# $(libdir)/libb32 \
# $(libdir)/libb32/libnix \
# $(libdir)/libb32/libm020 \
# $(libdir)/libb32/libm020/libnix \
# $(libdir)/libb32/libm020/libm881 \
# $(libdir)/libb32/libm020/libm881/libnix \
# $(libdir)/libb32/libm060 \
# $(libdir)/libb32/libm060/libnix
distribution:
mkdir t:gg t:gg/lib t:gg/lib/libnix
@@ -180,6 +181,16 @@ distribution:
cp -p lib881/misc/*.o t:gg/lib/libm020/libm881/libnix
cp -p libb881/*/*.a t:gg/lib/libb/libm020/libm881/libnix
cp -p libb881/misc/*.o t:gg/lib/libb/libm020/libm881/libnix
# cp -p lib060/*/*.a t:gg/lib/libm060/libnix
# cp -p lib060/misc/*.o t:gg/lib/libm060/libnix
# cp -p libb060/*/*.a t:gg/lib/libm060/libnix
# cp -p libb060/misc/*.o t:gg/lib/libm060/libnix
# cp -p libb32/*/*.a t:gg/lib/libm020/libnix
# cp -p libb32/misc/*.o t:gg/lib/libm020/libnix
# cp -p libb32881/*/*.a t:gg/lib/libm020/libm881/libnix
# cp -p libb32881/misc/*.o t:gg/lib/libm020/libm881/libnix
# cp -p libb32060/*/*.a t:gg/lib/libm060/libnix
# cp -p libb32060/misc/*.o t:gg/lib/libm060/libnix
-rm t:gg/lib/libnix/libglue.a t:gg/lib/libb/libnix/libglue.a
-cp * t:gg
rm t:gg/Makefile t:gg/libnix.texi
+31
View File
@@ -0,0 +1,31 @@
This is BETA 2 of libnix and its considered final. Changes compared with
the previous BETA are completed append mode (now works for fdopen()),
stderr behavoir according to the standard (always unbuffered; previosly
it had the normal fopen() mode) since write-only streams are now optimized
(as in *BSD ;-). The internal socket i/o interface was changed for better
system compatibility (used a packet in private memory, now its DOS alloced)
The only change that I consider is a makefile change: changing the
optimization level from -O3 to -O2 or -Os.
---old---
This libnix version is BETA!!! The final version will certainly contain
changes compared to this snapshot.
Its intended for those who are interested and are able to recompile the
libraries. This packaged can be compiled under a cross compiler environment.
The configure script MUST be invoked through an absolute pathname! If you
configure it with a relative pathname you have to modify VPATH and srcdir
in startup/Makefile (remove the first ../).
libnix 2.0 finally offers support for networking. The network support is
in a new link library called libsocket.a. This code is based on work by
Jeff Sheperd. For a more changes consult sources/history. The list is
probably no complete.
Send comments and bugreports to:
gnikl@informatik.uni-rostock.de
with a subject including "libnix BETA".
Flames to dev/null :-)
+76 -198
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13
# Generated automatically using autoconf version 2.12.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -357,7 +357,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.13"
echo "configure generated by autoconf version 2.12.1"
exit 0 ;;
-with-* | --with-*)
@@ -527,11 +527,9 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -549,16 +547,15 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:553: checking for $ac_word" >&5
echo "configure:551: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -579,16 +576,15 @@ if test -z "$CC"; then
# Extract the first word of "bcc", so it can be a program name with args.
set dummy bcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:583: checking for $ac_word" >&5
echo "configure:580: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="bcc"
@@ -607,50 +603,18 @@ fi
fi
if test -z "$CC"; then
machine=`(uname -m 2>/dev/null)` || machine=unknown
case "$machine" in
BePC) # Extract the first word of "mwccx86", so it can be a program name with args.
set dummy mwccx86; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:616: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="mwccx86"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
;;
BeBox | BeMac ) # Extract the first word of "mwcc", so it can be a program name with args.
# Extract the first word of "mwcc", so it can be a program name with args.
set dummy mwcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:645: checking for $ac_word" >&5
echo "configure:610: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="mwcc"
@@ -666,25 +630,22 @@ if test -n "$CC"; then
else
echo "$ac_t""no" 1>&6
fi
;;
*) ;;
esac
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:678: checking for $ac_word" >&5
echo "configure:640: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
ac_prog_rejected=no
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -719,61 +680,25 @@ else
echo "$ac_t""no" 1>&6
fi
fi
if test -z "$CC"; then
case "`uname -s`" in
*win32* | *WIN32*)
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:730: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="cl"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
;;
esac
fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:688: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
#line 772 "configure"
cat > conftest.$ac_ext <<EOF
#line 698 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -787,24 +712,18 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:803: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:808: checking whether we are using GNU C" >&5
echo "configure:727: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -813,7 +732,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -824,15 +743,11 @@ echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:836: checking whether ${CC-cc} accepts -g" >&5
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:751: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -847,47 +762,28 @@ rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
CFLAGS="-O2"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
if test "$CC" = "mwcc"; then
CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
AR="mwld"
RANLIB="true"
elif test "$CC" = "bcc"; then
AR="mwld"
RANLIB="true"
fi
case "$CC" in
bcc )
AR=${AR-mwld}
LD=${LD-mwld}
RANLIB=${RANLIB-true};;
mwcc )
CC="mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup"
AR=${AR-mwld}
LD=${LD-mwld}
RANLIB=${RANLIB-true};;
mwccx86 )
CC="mwccx86 -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib"
AR=${AR-mwldx86}
LD=${LD-mwldx86}
RANLIB=${RANLIB-true};;
${host_alias}-gcc)
;;
*)
AR=${AR-ar}
LD=${LD-ld}
RANLIB=${RANLIB-ranlib};;
esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:891: checking how to run the C preprocessor" >&5
echo "configure:787: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -902,14 +798,14 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 906 "configure"
#line 802 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
{ (eval echo configure:808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
else
@@ -919,31 +815,14 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 923 "configure"
#line 819 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 940 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
else
@@ -955,8 +834,6 @@ else
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
@@ -971,16 +848,15 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:975: checking for $ac_word" >&5
echo "configure:852: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_AWK="$ac_prog"
@@ -1003,16 +879,15 @@ done
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1007: checking for $ac_word" >&5
echo "configure:883: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1062,12 +937,12 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1066: checking for a BSD compatible install" >&5
echo "configure:941: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
@@ -1110,8 +985,6 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
@@ -1138,7 +1011,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set | grep ac_space) 2>&1` in
case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -1178,7 +1051,6 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
@@ -1220,7 +1092,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.13"
echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -1249,7 +1121,6 @@ s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -1274,11 +1145,10 @@ s%@dvidir@%$dvidir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@AWK@%$AWK%g
s%@RANLIB@%$RANLIB%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
CEOF
@@ -1321,12 +1191,20 @@ EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile sources/Makefile sources/amiga/Makefile
sources/math/Makefile sources/misc/Makefile
sources/nix/Makefile sources/nix13/Makefile
sources/nixmain/Makefile sources/nix_main/Makefile
sources/stack/Makefile sources/startup/Makefile
sources/stubs/Makefile examples/Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"Makefile
sources/Makefile
sources/amiga/Makefile
sources/math/Makefile
sources/misc/Makefile
sources/nix/Makefile
sources/nix13/Makefile
sources/nixmain/Makefile
sources/nix_main/Makefile
sources/socket/Makefile
sources/stack/Makefile
sources/startup/Makefile
sources/stubs/Makefile
examples/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+14 -6
View File
@@ -8,9 +8,17 @@ AC_PROG_AWK
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_OUTPUT(Makefile sources/Makefile sources/amiga/Makefile
sources/math/Makefile sources/misc/Makefile
sources/nix/Makefile sources/nix13/Makefile
sources/nixmain/Makefile sources/nix_main/Makefile
sources/stack/Makefile sources/startup/Makefile
sources/stubs/Makefile examples/Makefile)
AC_OUTPUT(Makefile
sources/Makefile
sources/amiga/Makefile
sources/math/Makefile
sources/misc/Makefile
sources/nix/Makefile
sources/nix13/Makefile
sources/nixmain/Makefile
sources/nix_main/Makefile
sources/socket/Makefile
sources/stack/Makefile
sources/startup/Makefile
sources/stubs/Makefile
examples/Makefile)
+6 -9
View File
@@ -4,9 +4,7 @@
/* */
/******************************************************************************/
#include <exec/types.h>
#include <exec/errors.h>
#include <exec/execbase.h>
#include <proto/exec.h>
#include "stabs.h"
@@ -16,8 +14,8 @@
/* */
/******************************************************************************/
const BYTE DevName[]="simple.device";
const BYTE DevIdString[]="version 1.0";
const char DevName[]="simple.device";
const char DevIdString[]="version 1.0";
const UWORD DevVersion=1;
const UWORD DevRevision=0;
@@ -41,8 +39,8 @@ struct ExecBase *SysBase;
int __UserDevInit(struct Device *myDev)
{
/* required !!! */
SysBase=*(struct ExecBase **)4;
/* !!! required !!! */
SysBase = *(struct ExecBase **)4L;
/* setup your device base - to access device functions over *this* basePtr! */
@@ -65,7 +63,7 @@ int __UserDevInit(struct Device *myDev)
/* */
/******************************************************************************/
void __UserDevCleanup()
void __UserDevCleanup(void)
{
/* your cleanup comes here */
@@ -84,7 +82,7 @@ void __UserDevCleanup()
int __UserDevOpen(struct IORequest *iorq,ULONG unit,ULONG flags)
{
int io_err=IOERR_OPENFAIL;
int io_err = IOERR_OPENFAIL;
/* return a bool to indicate success */
@@ -101,7 +99,6 @@ int __UserDevOpen(struct IORequest *iorq,ULONG unit,ULONG flags)
void __UserDevClose(struct IORequest *iorq)
{
/* nothing to return */
}
+7 -9
View File
@@ -4,8 +4,6 @@
/* */
/******************************************************************************/
#include <exec/types.h>
#include <exec/execbase.h>
#include <dos/dosextens.h>
#include <proto/exec.h>
#include "stabs.h"
@@ -16,8 +14,8 @@
/* */
/******************************************************************************/
const BYTE LibName[]="simple.library";
const BYTE LibIdString[]="version 1.0";
const char LibName[]="simple.library";
const char LibIdString[]="version 1.0";
const UWORD LibVersion=1;
const UWORD LibRevision=0;
@@ -46,10 +44,10 @@ int __UserLibInit(struct Library *myLib)
myLibPtr = myLib;
/* required !!! */
SysBase=*(struct ExecBase **)4;
/* !!! required !!! */
SysBase = *(struct ExecBase **)4L;
return (DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",33))==NULL;
return (DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",33L))==NULL;
}
/******************************************************************************/
@@ -60,9 +58,9 @@ int __UserLibInit(struct Library *myLib)
/* */
/******************************************************************************/
void __UserLibCleanup()
void __UserLibCleanup(void)
{
CloseLibrary((struct Library *)DOSBase);
CloseLibrary(&DOSBase->dl_lib);
}
/******************************************************************************/
+251
View File
@@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
+12 -21
View File
@@ -18,24 +18,19 @@
srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
AS = as
RANLIB = @RANLIB@
AWK = @AWK@
AWK = @AWK@
#### End system configuration section ####
CURDIR = $(shell pwd)
MAKELIST=make -f $(CURDIR)/Makefile
MAKELIST=$(MAKE) -f $(CURDIR)/Makefile
SUBDIRS=nixmain nix_main misc nix nix13 math stack stubs
SUBDIRS=nixmain nix_main misc math nix nix13 socket stack stubs
all: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f))
for subdir in $(SUBDIRS); do \
( cd $$subdir;make -f ../../sources/$$subdir/Makefile V="$(V)" \
( cd $$subdir;$(MAKE) -f ../../sources/$$subdir/Makefile V="$(V)" \
CFLAGS="$(CFLAGS)" ); \
done
@@ -44,19 +39,20 @@ $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)):
libamiga:
if [ ! -d amiga ] ; then mkdir amiga ; else true ; fi
cd amiga;make -f $(CURDIR)/../sources/amiga/Makefile CFLAGS="$(CFLAGS)"
cd amiga;$(MAKE) -f $(CURDIR)/../sources/amiga/Makefile CFLAGS="$(CFLAGS)"
filelists:
-cd $(srcdir)/math; $(MAKELIST) SOURCEFILES="*/*" FLDIR=$(CURDIR)/math $(CURDIR)/math/filelist
-cd $(srcdir)/stack; $(MAKELIST) SOURCEFILES="*.c" FLDIR=$(CURDIR)/stack $(CURDIR)/stack/filelist
-cd $(srcdir)/nix; $(MAKELIST) SOURCEFILES="*/*" FLDIR=$(CURDIR)/nix $(CURDIR)/nix/filelist
-cd $(srcdir)/nix13; $(MAKELIST) SOURCEFILES="*/*" FLDIR=$(CURDIR)/nix13 $(CURDIR)/nix13/filelist
-cd $(srcdir)/stubs; make -f $(CURDIR)/Makefile STUBDIR=$(CURDIR)/stubs libbases/dos.c; \
-cd $(srcdir)/socket; $(MAKELIST) SOURCEFILES="*/*" FLDIR=$(CURDIR)/socket $(CURDIR)/socket/filelist
-cd $(srcdir)/stack; $(MAKELIST) SOURCEFILES="*.c" FLDIR=$(CURDIR)/stack $(CURDIR)/stack/filelist
-cd $(srcdir)/stubs; $(MAKE) -f $(CURDIR)/Makefile STUBDIR=$(CURDIR)/stubs libbases/dos.c; \
$(MAKELIST) SOURCEFILES=" \
libbases/* misc/__DOSBase.c misc/__UtilityBase.c \
misc/__MathIeeeSingBasBase.c misc/__MathIeeeDoubBasBase.c \
misc/__MathIeeeSingTransBase.c misc/__MathIeeeDoubTransBase.c \
misc/__initlibraries.c misc/__flush_cache.c misc/__cpucheck.c \
misc/__cpucheck.c misc/__flush_cache.c misc/__initlibraries.c \
libnames/* stubs/*" \
FLDIR=$(CURDIR)/stubs $(CURDIR)/stubs/filelist
-cd $(srcdir)/amiga; $(MAKELIST) SOURCEFILES="*/*" FLDIR=$(CURDIR)/amiga $(CURDIR)/amiga/filelist
@@ -85,14 +81,9 @@ libbases/dos.c: $(STUBDIR)/Makefile library.list
print "char __" sname "name[]=\"" $$2 "\";" >fname;}'
clean:
if [ -d nixmain ] ; then (cd nixmain; make -f ../../sources/nixmain/Makefile TARGET=clean clean) ; else true ; fi
if [ -d nix_main ] ; then (cd nix_main; make -f ../../sources/nix_main/Makefile TARGET=clean clean) ; else true ; fi
if [ -d misc ] ; then (cd misc; make -f ../../sources/misc/Makefile TARGET=clean clean) ; else true ; fi
if [ -d math ] ; then (cd math; make -f ../../sources/math/Makefile TARGET=clean clean) ; else true ; fi
if [ -d stack ] ; then (cd stack; make -f ../../sources/stack/Makefile TARGET=clean clean) ; else true ; fi
if [ -d nix ] ; then (cd nix; make -f ../../sources/nix/Makefile TARGET=clean clean) ; else true ; fi
if [ -d nix13 ] ; then (cd nix13; make -f ../../sources/nix13/Makefile TARGET=clean clean) ; else true ; fi
if [ -d stubs ] ; then (cd stubs; make -f ../../sources/stubs/Makefile TARGET=clean clean) ; else true ; fi
for subdir in $(SUBDIRS); do \
( if [ -d $$subdir ] ; then (cd $$subdir; $(MAKE) -f ../../sources/$$subdir/Makefile clean) ; else true ; fi ) \
done
veryclean:
-rm -rf *
+12 -14
View File
@@ -4,15 +4,16 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
CPP = @CPP@
AS = as
AR = ar
RANLIB = @RANLIB@
AWK = @AWK@
FD2INLINE = fd2inline
AWK = @AWK@
CLIBPATH = $(prefix)/os-include/clib/
FD2INLINE = fd2inline
FDPATH = $(prefix)/os-lib/fd/
CLIBPATH = $(prefix)/os-include/clib/
#### End system configuration section ####
@@ -20,15 +21,12 @@ include ../../sources/amiga/filelist
CURDIR = $(shell pwd)
OPTIONS=-I $(srcdir)/../headers -I../../sources/headers $(CFLAGS)
SOURCEFILES=*/*
OPTIONS=-I$(srcdir)/../headers $(CFLAGS)
FDFILES = $(wildcard $(FDPATH)*.fd)
CLIB = $(addprefix $(CLIBPATH),$(subst _lib.fd,_protos.h,$(notdir $(fd))))
STUB = $(subst _lib.fd,,$(notdir $(fd)))
%.o: %.c
$(CC) $(OPTIONS) -c $^ -o $@ 2>&1|tee $*.err
-if test ! -s $*.err; then rm $*.err; fi
@@ -50,12 +48,12 @@ veryclean:
$(foreach f,$(SUBDIRS),$(CURDIR)/$(f)):
mkdir $@
##libamiga.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) libglue.a ../../sources/amiga/makefile ../../sources/amiga/filelist
libamiga.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) newlibglue.a ../../sources/amiga/makefile ../../sources/amiga/filelist
#libamiga.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) libglue.a ../../sources/amiga/Makefile ../../sources/amiga/filelist
libamiga.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) newlibglue.a ../../sources/amiga/Makefile ../../sources/amiga/filelist
-rm -f libamiga.a
## -cp libglue.a libamiga.a
# -cp libglue.a libamiga.a
-cp newlibglue.a libamiga.a
ar -q libamiga.a $(OBJECTS)
$(AR) -q libamiga.a $(OBJECTS)
$(RANLIB) libamiga.a
libglue.a:
@@ -87,7 +85,7 @@ libglue.a:
{ if(file!="") print $$0 >file; }' ); done
-cd tmp;rm vararg.c dummy.c;$(CC) -c *.s
-rm libglue.a
-cd tmp;ar -q ../libglue.a *.o
-cd tmp;$(AR) -q ../libglue.a *.o
-rm -rf tmp
newlibglue.a: stublibs
@@ -97,7 +95,7 @@ newlibglue.a: stublibs
rm -f $@;\
$(foreach fd, $(FDFILES),\
echo "adding $(STUB) stubs to $@ ...";\
ar -q $@ stubs/$(STUB)/*.o;)\
$(AR) -q $@ stubs/$(STUB)/*.o;)\
touch stamp-libglue;\
else\
true;\
+1 -1
View File
@@ -1,4 +1,4 @@
#include <stabs.h>
#include "stabs.h"
ABSDEF(AbsExecBase,0x00000004);
ABSDEF(cartridge, 0x00f00000);
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
APTR ASM AsmAllocPooled(REG(a0,POOL *poolHeader),REG(d0,ULONG memSize),REG(a6,APTR SysBase))
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
#define NEWLIST(l) ((l)->mlh_Head = (struct MinNode *)&(l)->mlh_Tail, \
(l)->mlh_Tail = NULL, \
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
VOID ASM AsmFreePooled(REG(a0,POOL *poolHeader),REG(a1,APTR memory),REG(d0,ULONG memSize),REG(a6,APTR SysBase))
{
+2 -2
View File
@@ -1,10 +1,10 @@
#ifdef __GNUC__
#include <exec/devices.h>
#include <exec/io.h>
#include <exec/devices.h>
void BeginIO(struct IORequest *iorequest)
{ register struct IORequest *a1 asm("a1")=iorequest;
register struct Device *a6 asm("a6")=iorequest->io_Device;
asm("jsr a6@(-30)"::"r"(a1),"r"(a6):"a0","a1","d0","d1");
__asm __volatile ("jsr a6@(-30:W)"::"r"(a1),"r"(a6):"a0","a1","d0","d1");
}
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include <stabs.h>
#include "stabs.h"
/* Absolute definitions for the cia registers
* some of the are recommended to use
+1 -1
View File
@@ -2,7 +2,7 @@
#include <exec/memory.h>
#include <clib/alib_protos.h>
#include <proto/exec.h>
#include <stabs.h>
#include "stabs.h"
struct IORequest *CreateExtIO(struct MsgPort *port,LONG iosize)
{ APTR SysBase = *(APTR *)4L;
+3 -2
View File
@@ -30,8 +30,7 @@ struct Task *CreateTask(STRPTR name, LONG pri, APTR initpc, ULONG stacksize)
stacksize=(stacksize+3)&~3;
{
long *p1,*p2;
{ long *p1,*p2;
int i;
for (p1=(long *)&nml,p2=(long*)&MemTemplate,i=7; i; *p1++=*p2++,i--) ;
@@ -60,6 +59,7 @@ struct Task *CreateTask(STRPTR name, LONG pri, APTR initpc, ULONG stacksize)
}
#else
asm("
.globl _CreateTask
@@ -123,4 +123,5 @@ Lmemlist: .long 0,0 | Succ,Pred
.long 0x10000 | MemType
| .long 0 | Length
");
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
#include <stabs.h>
#include "stabs.h"
/* Absolute definitions for the custom chips
* Most of them are recommended not to use
+2 -2
View File
@@ -1,3 +1,3 @@
#include <stabs.h>
#include "stabs.h"
ALIAS (DeleteTask,RemTask);
ALIAS(DeleteTask,RemTask);
+7
View File
@@ -0,0 +1,7 @@
#include "stabs.h"
ALIAS(DoPkt0,DoPkt);
ALIAS(DoPkt1,DoPkt);
ALIAS(DoPkt2,DoPkt);
ALIAS(DoPkt3,DoPkt);
ALIAS(DoPkt4,DoPkt);
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
APTR LibAllocPooled(APTR poolHeader, ULONG memSize)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
APTR LibCreatePool(ULONG requirements, ULONG puddleSize, ULONG threshSize)
{
+1 -1
View File
@@ -1,4 +1,4 @@
#include <pool.h>
#include "pool.h"
VOID LibFreePooled(APTR poolHeader, APTR memory, ULONG memSize)
{
+1 -1
View File
@@ -3,5 +3,5 @@
VOID waitbeam(LONG pos)
{
do {} while(pos>VBeamPos());
do{}while(pos>VBeamPos());
}
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _BASE_H_
#define _BASE_H_
#ifndef _HEADERS_BASE_H
#define _HEADERS_BASE_H
#ifndef SMALL_DATA
#define A4(x) #x
@@ -21,4 +21,4 @@
#define GETUTLBASE movel A4(_UtilityBase),a6
#define GETWBBASE movel A4(_WorkbenchBase),a6
#endif _BASE_H_
#endif /* _HEADERS_BASE_H */
+13 -12
View File
@@ -1,14 +1,15 @@
#ifndef _DEBUGLIB_H
#define _DEBUGLIB_H
#ifdef DEBUG_LIB
#ifndef _DEBUGLIB_H_
#define _DEBUGLIB_H_
extern int KPrintF(const char *, ...);
#define DB(x) x
#define BUG KPrintF
#define ASSERT(x) { if (!(x)) KPrintF("Assertion failed: " #x " at file " __FILE__ ", line %ld\n", __LINE__); }
#else
#define DB(x)
#define BUG
#define ASSERT(x)
#endif /* DEBUG_LIB */
/* Yet nothing - could be a debug-requester or something */
/*
#define FATALERROR(a)
*/
#endif
#endif
#endif /* _DEBUGLIB_H */
+8 -1
View File
@@ -1,3 +1,6 @@
#ifndef _HEADERS_DIRENT_H
#define _HEADERS_DIRENT_H
#include <dos/exall.h>
#include <dos/dosextens.h>
@@ -25,9 +28,13 @@ typedef struct _dirdesc {
#define d_ead _dirun.ead
#define d_info _dirun.fib
/* prototypes */
/*
** prototypes
*/
DIR *opendir(const char *dirname);
struct dirent *readdir(DIR *dirp);
void rewinddir(DIR *dirp);
int closedir(DIR *dirp);
#endif /* _HEADERS_DIRENT_H */
+201
View File
@@ -0,0 +1,201 @@
#ifndef _INLINE_AMITCP_H
#define _INLINE_AMITCP_H
#ifndef __INLINE_MACROS_H
#include <inline/macros.h>
#endif
#ifndef AMITCP_BASE_NAME
#define AMITCP_BASE_NAME lss->lx_BsdSocketBase
#endif
#define TCP_Accept(s, addr, addrlen) \
LP3(0x30, LONG, TCP_Accept, LONG, s, d0, struct sockaddr *, addr, a0, int *, addrlen, a1, \
, AMITCP_BASE_NAME)
#define TCP_Bind(s, name, namelen) \
LP3(0x24, LONG, TCP_Bind, LONG, s, d0, const struct sockaddr *, name, a0, LONG, namelen, d1, \
, AMITCP_BASE_NAME)
#define TCP_CloseSocket(d) \
LP1(0x78, LONG, TCP_CloseSocket, LONG, d, d0, \
, AMITCP_BASE_NAME)
#define TCP_Connect(s, name, namelen) \
LP3(0x36, LONG, TCP_Connect, LONG, s, d0, const struct sockaddr *, name, a0, LONG, namelen, d1, \
, AMITCP_BASE_NAME)
#define TCP_Dup2Socket(fd1, fd2) \
LP2(0x108, LONG, TCP_Dup2Socket, LONG, fd1, d0, LONG, fd2, d1, \
, AMITCP_BASE_NAME)
#define TCP_Errno() \
LP0(0xa2, LONG, TCP_Errno, \
, AMITCP_BASE_NAME)
#define TCP_GetDTableSize() \
LP0(0x8a, LONG, TCP_GetDTableSize, \
, AMITCP_BASE_NAME)
#define TCP_GetHostByAddr(addr, len, type) \
LP3(0xd8, struct hostent *, TCP_GetHostByAddr, const UBYTE *, addr, a0, LONG, len, d0, LONG, type, d1, \
, AMITCP_BASE_NAME)
#define TCP_GetHostByName(name) \
LP1(0xd2, struct hostent *, TCP_GetHostByName, const UBYTE *, name, a0, \
, AMITCP_BASE_NAME)
#define TCP_GetHostId() \
LP0(0x120, ULONG, TCP_GetHostId, \
, AMITCP_BASE_NAME)
#define TCP_GetHostName(hostname, size) \
LP2(0x11a, LONG, TCP_GetHostName, STRPTR, hostname, a0, LONG, size, d0, \
, AMITCP_BASE_NAME)
#define TCP_GetNetByAddr(net, type) \
LP2(0xe4, struct netent *, TCP_GetNetByAddr, LONG, net, d0, LONG, type, d1, \
, AMITCP_BASE_NAME)
#define TCP_GetNetByName(name) \
LP1(0xde, struct netent *, TCP_GetNetByName, const UBYTE *, name, a0, \
, AMITCP_BASE_NAME)
#define TCP_GetPeerName(s, hostname, namelen) \
LP3(0x6c, LONG, TCP_GetPeerName, LONG, s, d0, struct sockaddr *, hostname, a0, int *, namelen, a1, \
, AMITCP_BASE_NAME)
#define TCP_GetProtoByName(name) \
LP1(0xf6, struct protoent *, TCP_GetProtoByName, const UBYTE *, name, a0, \
, AMITCP_BASE_NAME)
#define TCP_GetProtoByNumber(proto) \
LP1(0xfc, struct protoent *, TCP_GetProtoByNumber, LONG, proto, d0, \
, AMITCP_BASE_NAME)
#define TCP_GetServByName(name, proto) \
LP2(0xea, struct servent *, TCP_GetServByName, const UBYTE *, name, a0, const UBYTE *, proto, a1, \
, AMITCP_BASE_NAME)
#define TCP_GetServByPort(port, proto) \
LP2(0xf0, struct servent *, TCP_GetServByPort, LONG, port, d0, const UBYTE *, proto, a0, \
, AMITCP_BASE_NAME)
#define TCP_GetSockName(s, hostname, namelen) \
LP3(0x66, LONG, TCP_GetSockName, LONG, s, d0, struct sockaddr *, hostname, a0, int *, namelen, a1, \
, AMITCP_BASE_NAME)
#define TCP_GetSockOpt(s, level, optname, optval, optlen) \
LP5(0x60, LONG, TCP_GetSockOpt, LONG, s, d0, LONG, level, d1, LONG, optname, d2, void *, optval, a0, int *, optlen, a1, \
, AMITCP_BASE_NAME)
#define TCP_GetSocketEvents(eventmaskp) \
LP1(0x12c, LONG, TCP_GetSocketEvents, ULONG *, eventmaskp, a0, \
, AMITCP_BASE_NAME)
#define TCP_Inet_Addr(cp) \
LP1(0xb4, ULONG, TCP_Inet_Addr, const UBYTE *, cp, a0, \
, AMITCP_BASE_NAME)
#define TCP_Inet_LnaOf(in) \
LP1(0xba, ULONG, TCP_Inet_LnaOf, LONG, in, d0, \
, AMITCP_BASE_NAME)
#define TCP_Inet_MakeAddr(net, host) \
LP2(0xc6, ULONG, TCP_Inet_MakeAddr, ULONG, net, d0, ULONG, host, d1, \
, AMITCP_BASE_NAME)
#define TCP_Inet_NetOf(in) \
LP1(0xc0, ULONG, TCP_Inet_NetOf, LONG, in, d0, \
, AMITCP_BASE_NAME)
#define TCP_Inet_Network(cp) \
LP1(0xcc, ULONG, TCP_Inet_Network, const UBYTE *, cp, a0, \
, AMITCP_BASE_NAME)
#define TCP_Inet_NtoA(in) \
LP1(0xae, char *, TCP_Inet_NtoA, ULONG, in, d0, \
, AMITCP_BASE_NAME)
#define TCP_IoctlSocket(d, request, argp) \
LP3(0x72, LONG, TCP_IoctlSocket, LONG, d, d0, ULONG, request, d1, char *, argp, a0, \
, AMITCP_BASE_NAME)
#define TCP_Listen(s, backlog) \
LP2(0x2a, LONG, TCP_Listen, LONG, s, d0, LONG, backlog, d1, \
, AMITCP_BASE_NAME)
#define TCP_ObtainSocket(id, domain, type, protocol) \
LP4(0x90, LONG, TCP_ObtainSocket, LONG, id, d0, LONG, domain, d1, LONG, type, d2, LONG, protocol, d3, \
, AMITCP_BASE_NAME)
#define TCP_Recv(s, buf, len, flags) \
LP4(0x4e, LONG, TCP_Recv, LONG, s, d0, UBYTE *, buf, a0, LONG, len, d1, LONG, flags, d2, \
, AMITCP_BASE_NAME)
#define TCP_RecvFrom(s, buf, len, flags, from, fromlen) \
LP6(0x48, LONG, TCP_RecvFrom, LONG, s, d0, UBYTE *, buf, a0, LONG, len, d1, LONG, flags, d2, struct sockaddr *, from, a1, int *, fromlen, a2, \
, AMITCP_BASE_NAME)
#define TCP_RecvMsg(s, msg, flags) \
LP3(0x114, LONG, TCP_RecvMsg, LONG, s, d0, struct msghdr *, msg, a0, LONG, flags, d1, \
, AMITCP_BASE_NAME)
#define TCP_ReleaseCopyOfSocket(fd, id) \
LP2(0x9c, LONG, TCP_ReleaseCopyOfSocket, LONG, fd, d0, LONG, id, d1, \
, AMITCP_BASE_NAME)
#define TCP_ReleaseSocket(fd, id) \
LP2(0x96, LONG, TCP_ReleaseSocket, LONG, fd, d0, LONG, id, d1, \
, AMITCP_BASE_NAME)
#define TCP_Send(s, msg, len, flags) \
LP4(0x42, LONG, TCP_Send, LONG, s, d0, const UBYTE *, msg, a0, LONG, len, d1, LONG, flags, d2, \
, AMITCP_BASE_NAME)
#define TCP_SendMsg(s, msg, flags) \
LP3(0x10e, LONG, TCP_SendMsg, LONG, s, d0, const struct msghdr *, msg, a0, LONG, flags, d1, \
, AMITCP_BASE_NAME)
#define TCP_SendTo(s, msg, len, flags, to, tolen) \
LP6(0x3c, LONG, TCP_SendTo, LONG, s, d0, const UBYTE *, msg, a0, LONG, len, d1, LONG, flags, d2, const struct sockaddr *, to, a1, LONG, tolen, d3, \
, AMITCP_BASE_NAME)
#define TCP_SetErrnoPtr(errno_p, size) \
LP2(0xa8, LONG, TCP_SetErrnoPtr, void *, errno_p, a0, LONG, size, d0, \
, AMITCP_BASE_NAME)
#define TCP_SetSockOpt(s, level, optname, optval, optlen) \
LP5(0x5a, LONG, TCP_SetSockOpt, LONG, s, d0, LONG, level, d1, LONG, optname, d2, const void *, optval, a0, LONG, optlen, d3, \
, AMITCP_BASE_NAME)
#define TCP_SetSocketSignals(SIGINTR, SIGIO, SIGURG) \
LP3NR(0x84, TCP_SetSocketSignals, ULONG, SIGINTR, d0, ULONG, SIGIO, d1, ULONG, SIGURG, d2, \
, AMITCP_BASE_NAME)
#define TCP_ShutDown(s, how) \
LP2(0x54, LONG, TCP_ShutDown, LONG, s, d0, LONG, how, d1, \
, AMITCP_BASE_NAME)
#define TCP_Socket(domain, type, protocol) \
LP3(0x1e, LONG, TCP_Socket, LONG, domain, d0, LONG, type, d1, LONG, protocol, d2, \
, AMITCP_BASE_NAME)
#define TCP_SocketBaseTagList(taglist) \
LP1(0x126, LONG, TCP_SocketBaseTagList, struct TagItem *, taglist, a0, \
, AMITCP_BASE_NAME)
#ifndef NO_INLINE_STDARG
#define TCP_SocketBaseTags(tags...) \
({ULONG _tags[] = { tags }; TCP_SocketBaseTagList((struct TagItem *)_tags);})
#endif /* !NO_INLINE_STDARG */
#define TCP_SyslogA(level, format, ap) \
LP3NR(0x102, TCP_SyslogA, ULONG, level, d0, const char *, format, a0, va_list, ap, a1, \
, AMITCP_BASE_NAME)
#define TCP_WaitSelect(nfds, readfds, writefds, execptfds, timeout, maskp) \
LP6(0x7e, LONG, TCP_WaitSelect, LONG, nfds, d0, fd_set *, readfds, a0, fd_set *, writefds, a1, fd_set *, execptfds, a2, struct timeval *, timeout, a3, ULONG *, maskp, d1, \
, AMITCP_BASE_NAME)
#endif /* _INLINE_AMITCP_H */
+296
View File
@@ -0,0 +1,296 @@
#ifndef _INLINE_AS225_H
#define _INLINE_AS225_H
#ifndef __INLINE_MACROS_H
#include <inline/macros.h>
#endif
#ifndef AS225_BASE_NAME
#define AS225_BASE_NAME lss->lx_SocketBase
#endif
#define SOCK_accept(s, name, lenp) \
LP3(0xba, int, SOCK_accept, int, s, d0, struct sockaddr *, name, a0, int *, lenp, a1, \
, AS225_BASE_NAME)
#define SOCK_bind(s, name, namelen) \
LP3(0xc0, int, SOCK_bind, int, s, d0, const struct sockaddr *, name, a1, int, namelen, d1, \
, AS225_BASE_NAME)
#define SOCK_cleanup_sockets() \
LP0NR(0x24, SOCK_cleanup_sockets, \
, AS225_BASE_NAME)
#define SOCK_close(socket) \
LP1(0x30, int, SOCK_close, int, socket, d0, \
, AS225_BASE_NAME)
#define SOCK_connect(s, name, namelen) \
LP3(0xc6, int, SOCK_connect, int, s, d0, const struct sockaddr *, name, a1, int, namelen, d1, \
, AS225_BASE_NAME)
#define SOCK_dev_list(res, size) \
LP2NR(0x1bc, SOCK_dev_list, u_long, res, d0, int, size, d1, \
, AS225_BASE_NAME)
#define SOCK_endhostent() \
LP0NR(0x7e, SOCK_endhostent, \
, AS225_BASE_NAME)
#define SOCK_endnetent() \
LP0NR(0x120, SOCK_endnetent, \
, AS225_BASE_NAME)
#define SOCK_endprotoent() \
LP0NR(0x13e, SOCK_endprotoent, \
, AS225_BASE_NAME)
#define SOCK_endpwent() \
LP0NR(0x18c, SOCK_endpwent, \
, AS225_BASE_NAME)
#define SOCK_endservent() \
LP0NR(0x15c, SOCK_endservent, \
, AS225_BASE_NAME)
#define SOCK_get_tz() \
LP0(0x5a, short, SOCK_get_tz, \
, AS225_BASE_NAME)
#define SOCK_getdomainname(name, namelen) \
LP2(0x60, int, SOCK_getdomainname, char *, name, a1, int, namelen, d1, \
, AS225_BASE_NAME)
#define SOCK_getgid() \
LP0(0x48, gid_t, SOCK_getgid, \
, AS225_BASE_NAME)
#define SOCK_getgroups(num, gids) \
LP2(0x4e, int, SOCK_getgroups, int, num, d0, int *, gids, a0, \
, AS225_BASE_NAME)
#define SOCK_gethostbyaddr(addr, len, type) \
LP3(0x90, struct hostent *, SOCK_gethostbyaddr, const char *, addr, a0, int, len, d0, int, type, d1, \
, AS225_BASE_NAME)
#define SOCK_gethostbyname(name) \
LP1(0x8a, struct hostent *, SOCK_gethostbyname, const char *, name, a0, \
, AS225_BASE_NAME)
#define SOCK_gethostent() \
LP0(0x84, struct hostent *, SOCK_gethostent, \
, AS225_BASE_NAME)
#define SOCK_gethostname(name, length) \
LP2(0x72, int, SOCK_gethostname, char *, name, a0, int, length, d0, \
, AS225_BASE_NAME)
#define SOCK_getlogin() \
LP0(0x54, char *, SOCK_getlogin, \
, AS225_BASE_NAME)
#define SOCK_getnetbyaddr(net, type) \
LP2(0x12c, struct netent *, SOCK_getnetbyaddr, long, net, d0, int, type, d1, \
, AS225_BASE_NAME)
#define SOCK_getnetbyname(name) \
LP1(0x132, struct netent *, SOCK_getnetbyname, const char *, name, a0, \
, AS225_BASE_NAME)
#define SOCK_getnetent() \
LP0(0x126, struct netent *, SOCK_getnetent, \
, AS225_BASE_NAME)
#define SOCK_getpeername(s, name, lenp) \
LP3(0x198, int, SOCK_getpeername, int, s, d0, struct sockaddr *, name, a0, int *, lenp, a1, \
, AS225_BASE_NAME)
#define SOCK_getprotobyname(name) \
LP1(0x14a, struct protoent *, SOCK_getprotobyname, const char *, name, a0, \
, AS225_BASE_NAME)
#define SOCK_getprotobynumber(proto) \
LP1(0x150, struct protoent *, SOCK_getprotobynumber, int, proto, d0, \
, AS225_BASE_NAME)
#define SOCK_getprotoent() \
LP0(0x144, struct protoent *, SOCK_getprotoent, \
, AS225_BASE_NAME)
#define SOCK_getpwent() \
LP0(0x180, struct AS225_passwd *, SOCK_getpwent, \
, AS225_BASE_NAME)
#define SOCK_getpwnam(name) \
LP1(0x17a, struct AS225_passwd *, SOCK_getpwnam, char *, name, a0, \
, AS225_BASE_NAME)
#define SOCK_getpwuid(uid) \
LP1(0x174, struct AS225_passwd *, SOCK_getpwuid, uid_t, uid, d1, \
, AS225_BASE_NAME)
#define SOCK_getservbyname(name, proto) \
LP2(0x168, struct servent *, SOCK_getservbyname, const char *, name, a0, const char *, proto, a1, \
, AS225_BASE_NAME)
#define SOCK_getservbyport(port, proto) \
LP2(0x16e, struct servent *, SOCK_getservbyport, u_short, port, d0, const char *, proto, a0, \
, AS225_BASE_NAME)
#define SOCK_getservent() \
LP0(0x162, struct servent *, SOCK_getservent, \
, AS225_BASE_NAME)
#define SOCK_getsignal(type) \
LP1(0x36, BYTE, SOCK_getsignal, UWORD, type, d1, \
, AS225_BASE_NAME)
#define SOCK_getsockname(s, name, lenp) \
LP3(0x19e, int, SOCK_getsockname, int, s, d0, struct sockaddr *, name, a0, int *, lenp, a1, \
, AS225_BASE_NAME)
#define SOCK_getsockopt(s, level, optname, optval, optlenp) \
LP5(0x114, int, SOCK_getsockopt, int, s, d0, int, level, d1, int, optname, d2, char *, optval, a0, int *, optlenp, a1, \
, AS225_BASE_NAME)
#define SOCK_getuid() \
LP0(0x42, uid_t, SOCK_getuid, \
, AS225_BASE_NAME)
#define SOCK_getumask() \
LP0(0x66, mode_t, SOCK_getumask, \
, AS225_BASE_NAME)
#define SOCK_inet_addr(cp) \
LP1(0x96, u_long, SOCK_inet_addr, char *, cp, a1, \
, AS225_BASE_NAME)
#define SOCK_inet_lnaof(in) \
LP1(0xa2, int, SOCK_inet_lnaof, struct, in, d1, \
, AS225_BASE_NAME)
#define SOCK_inet_makeaddr(net, lna) \
LP2(0x9c, struct in_addr, SOCK_inet_makeaddr, int, net, d0, int, lna, d1, \
, AS225_BASE_NAME)
#define SOCK_inet_netof(in) \
LP1(0xa8, int, SOCK_inet_netof, struct, in, d1, \
, AS225_BASE_NAME)
#define SOCK_inet_network(str) \
LP1(0xae, int, SOCK_inet_network, char *, str, a1, \
, AS225_BASE_NAME)
#define SOCK_inet_ntoa(in) \
LP1(0xb4, char *, SOCK_inet_ntoa, struct, in, d1, \
, AS225_BASE_NAME)
#define SOCK_inherit(sp) \
LP1(0x1b6, int, SOCK_inherit, void *, sp, d1, \
, AS225_BASE_NAME)
#define SOCK_ioctl(s, cmd, data) \
LP3(0xcc, int, SOCK_ioctl, int, s, d0, int, cmd, d1, char *, data, a0, \
, AS225_BASE_NAME)
#define SOCK_listen(s, backlog) \
LP2(0xd2, int, SOCK_listen, int, s, d0, int, backlog, d1, \
, AS225_BASE_NAME)
#define SOCK_rcmd(ahost, inport, luser, ruser, cmd, fd2p) \
LP6(0x192, int, SOCK_rcmd, char **, ahost, d0, u_short, inport, d1, char *, luser, a0, char *, ruser, a1, char *, cmd, a2, int *, fd2p, d2, \
, AS225_BASE_NAME)
#define SOCK_reconfig() \
LP0(0x1aa, int, SOCK_reconfig, \
, AS225_BASE_NAME)
#define SOCK_recv(s, buf, len, flags) \
LP4(0xd8, int, SOCK_recv, int, s, d0, char *, buf, a0, int, len, d1, int, flags, d2, \
, AS225_BASE_NAME)
#define SOCK_recvfrom(s, buf, len, flags, from, fromlen) \
LP6(0xde, int, SOCK_recvfrom, int, s, d0, char *, buf, a0, int, len, d1, int, flags, d2, struct sockaddr *, from, a1, int *, fromlen, a2, \
, AS225_BASE_NAME)
#define SOCK_recvmsg(s, msg, flags) \
LP3(0xe4, int, SOCK_recvmsg, int, s, d0, struct msghdr *, msg, a0, int, flags, d1, \
, AS225_BASE_NAME)
#define SOCK_release(s) \
LP1(0x1b0, void *,SOCK_release, int, s, d1, \
, AS225_BASE_NAME)
#define SOCK_select(numfds, rfds, wfds, efds, timeout) \
LP5(0xea, int, SOCK_select, int, numfds, d0, fd_set *, rfds, a0, fd_set *, wfds, a1, fd_set *, efds, a2, struct timeval *, timeout, d1, \
, AS225_BASE_NAME)
#define SOCK_selectwait(numfds, rfds, wfds, efds, timeout, umask) \
LP6(0xf0, int, SOCK_selectwait, int, numfds, d0, fd_set *, rfds, a0, fd_set *, wfds, a1, fd_set *, efds, a2, struct timeval *, timeout, d1, long *, umask, d2, \
, AS225_BASE_NAME)
#define SOCK_send(s, buf, len, flags) \
LP4(0xf6, int, SOCK_send, int, s, d0, const char *, buf, a0, int, len, d1, int, flags, a1, \
, AS225_BASE_NAME)
#define SOCK_sendmsg(s, msg, flags) \
LP3(0x102, int, SOCK_sendmsg, int, s, d0, const struct msghdr *, msg, a0, int, flags, d1, \
, AS225_BASE_NAME)
#define SOCK_sendto(s, buf, len, flags, to, to_len) \
LP6(0xfc, int, SOCK_sendto, int, s, d0, const char *, buf, a0, int, len, d1, int, flags, d2, const struct sockaddr *, to, a1, int, to_len, d3, \
, AS225_BASE_NAME)
#define SOCK_sethostent(flag) \
LP1NR(0x78, SOCK_sethostent, int, flag, d1, \
, AS225_BASE_NAME)
#define SOCK_setnetent(flag) \
LP1NR(0x11a, SOCK_setnetent, int, flag, d1, \
, AS225_BASE_NAME)
#define SOCK_setprotoent(flag) \
LP1NR(0x138, SOCK_setprotoent, int, flag, d1, \
, AS225_BASE_NAME)
#define SOCK_setpwent(flag) \
LP1NR(0x186, SOCK_setpwent, int, flag, d1, \
, AS225_BASE_NAME)
#define SOCK_setservent(flag) \
LP1NR(0x156, SOCK_setservent, int, flag, d1, \
, AS225_BASE_NAME)
#define SOCK_setsockopt(s, level, optname, optval, optlen) \
LP5(0x10e, int, SOCK_setsockopt, int, s, d0, int, level, d1, int, optname, d2, const char *, optval, a0, int, optlen, d3, \
, AS225_BASE_NAME)
#define SOCK_setup_sockets(max_socks, errno_ptr) \
LP2(0x1e, ULONG, SOCK_setup_sockets, UWORD, max_socks, d1, int *, errno_ptr, a0, \
, AS225_BASE_NAME)
#define SOCK_shutdown(s, how) \
LP2(0x108, int, SOCK_shutdown, int, s, d0, int, how, d1, \
, AS225_BASE_NAME)
#define SOCK_socket(family, type, protocol) \
LP3(0x2a, int, SOCK_socket, int, family, d0, int, type, d1, int, protocol, d2, \
, AS225_BASE_NAME)
#define SOCK_strerror(num) \
LP1(0x3c, char *, SOCK_strerror, int, num, d1, \
, AS225_BASE_NAME)
#define SOCK_syslog(pri, msg) \
LP2(0x1a4, int, SOCK_syslog, int, pri, d0, char *, msg, a0, \
, AS225_BASE_NAME)
#define SOCK_umask(cmask) \
LP1(0x6c, mode_t, SOCK_umask, mode_t, cmask, d0, \
, AS225_BASE_NAME)
#define SOCK_dup(fd) \
LP1(0x2b2, int, SOCK_dup, int, fd, d0, \
, AS225_BASE_NAME)
#endif /* _INLINE_AS225_H */
+173
View File
@@ -0,0 +1,173 @@
#ifndef _INLINE_USERGROUP_H
#define _INLINE_USERGROUP_H
#ifndef __INLINE_MACROS_H
#include <inline/macros.h>
#endif
#ifndef USERGROUP_BASE_NAME
#define USERGROUP_BASE_NAME lss->lx_UserGroupBase
#endif
#define UG_crypt(key, salt) \
LP2(0xae, char *, UG_crypt, const char *, key, a0, const char *, salt, a1, \
, USERGROUP_BASE_NAME)
#define UG_endgrent() \
LP0NR(0xa8, UG_endgrent, \
, USERGROUP_BASE_NAME)
#define UG_endpwent() \
LP0NR(0x8a, UG_endpwent, \
, USERGROUP_BASE_NAME)
#define UG_endutent() \
LP0NR(0xf0, UG_endutent, \
, USERGROUP_BASE_NAME)
#define UG_getcredentials(task) \
LP1(0x102, struct UserGroupCredentials *, UG_getcredentials, struct Task *, task, a0, \
, USERGROUP_BASE_NAME)
#define UG_getegid() \
LP0(0x4e, gid_t, UG_getegid, \
, USERGROUP_BASE_NAME)
#define UG_geteuid() \
LP0(0x36, uid_t, UG_geteuid, \
, USERGROUP_BASE_NAME)
#define UG_getgid() \
LP0(0x48, gid_t, UG_getgid, \
, USERGROUP_BASE_NAME)
#define UG_getgrent() \
LP0(0xa2, struct group *, UG_getgrent, \
, USERGROUP_BASE_NAME)
#define UG_getgrgid(gid) \
LP1(0x96, struct group *, UG_getgrgid, gid_t, gid, d0, \
, USERGROUP_BASE_NAME)
#define UG_getgrnam(name) \
LP1(0x90, struct group *, UG_getgrnam, const char *, name, a1, \
, USERGROUP_BASE_NAME)
#define UG_getgroups(ngroups, groups) \
LP2(0x60, int, UG_getgroups, int, ngroups, d0, int *, groups, a1, \
, USERGROUP_BASE_NAME)
#define UG_getlastlog(uid) \
LP1(0xf6, struct lastlog *, UG_getlastlog, uid_t, uid, d0, \
, USERGROUP_BASE_NAME)
#define UG_getlogin() \
LP0(0xd8, char *, UG_getlogin, \
, USERGROUP_BASE_NAME)
#define UG_getpass(prompt) \
LP1(0xba, char *, UG_getpass, const char *, prompt, a1, \
, USERGROUP_BASE_NAME)
#define UG_getpgrp() \
LP0(0xd2, pid_t, UG_getpgrp, \
, USERGROUP_BASE_NAME)
#define UG_getpwent() \
LP0(0x84, struct TCP_passwd *, UG_getpwent, \
, USERGROUP_BASE_NAME)
#define UG_getpwnam(name) \
LP1(0x72, struct TCP_passwd *, UG_getpwnam, const char *, name, a1, \
, USERGROUP_BASE_NAME)
#define UG_getpwuid(uid) \
LP1(0x78, struct TCP_passwd *, UG_getpwuid, uid_t, uid, d0, \
, USERGROUP_BASE_NAME)
#define UG_getuid() \
LP0(0x30, uid_t, UG_getuid, \
, USERGROUP_BASE_NAME)
#define UG_getumask() \
LP0(0xc6, mode_t, UG_getumask, \
, USERGROUP_BASE_NAME)
#define UG_getutent() \
LP0(0xea, struct utmp *, UG_getutent, \
, USERGROUP_BASE_NAME)
#define UG_initgroups(name, basegroup) \
LP2(0x6c, int, UG_initgroups, const char *, name, a1, gid_t, basegroup, d0, \
, USERGROUP_BASE_NAME)
#define UG_setgid(id) \
LP1(0x5a, int, UG_setgid, gid_t, id, d0, \
, USERGROUP_BASE_NAME)
#define UG_setgrent() \
LP0NR(0x9c, UG_setgrent, \
, USERGROUP_BASE_NAME)
#define UG_setgroups(ngroups, groups) \
LP2(0x66, int, UG_setgroups, int, ngroups, d0, const int *, groups, a1, \
, USERGROUP_BASE_NAME)
#define UG_setlastlog(uid, name, host) \
LP3(0xfc, int, UG_setlastlog, uid_t, uid, d0, char *, name, a0, char *, host, a1, \
, USERGROUP_BASE_NAME)
#define UG_setlogin(buffer) \
LP1(0xde, int, UG_setlogin, const char *, buffer, a1, \
, USERGROUP_BASE_NAME)
#define UG_setpwent() \
LP0NR(0x7e, UG_setpwent, \
, USERGROUP_BASE_NAME)
#define UG_setregid(real, eff) \
LP2(0x54, int, UG_setregid, gid_t, real, d0, gid_t, eff, d1, \
, USERGROUP_BASE_NAME)
#define UG_setreuid(real, eff) \
LP2(0x3c, int, UG_setreuid, uid_t, real, d0, uid_t, eff, d1, \
, USERGROUP_BASE_NAME)
#define UG_setsid() \
LP0(0xcc, pid_t, UG_setsid, \
, USERGROUP_BASE_NAME)
#define UG_setuid(id) \
LP1(0x42, int, UG_setuid, uid_t, id, d0, \
, USERGROUP_BASE_NAME)
#define UG_setutent() \
LP0NR(0xe4, UG_setutent, \
, USERGROUP_BASE_NAME)
#define UG_umask(mask) \
LP1(0xc0, mode_t, UG_umask, mode_t, mask, d0, \
, USERGROUP_BASE_NAME)
#define ug_GetErr() \
LP0(0x24, int, ug_GetErr, \
, USERGROUP_BASE_NAME)
#define ug_GetSalt(user, buffer, size) \
LP3(0xb4, char *, ug_GetSalt, const struct TCP_passwd *, user, a0, char *, buffer, a1, ULONG, size, d0, \
, USERGROUP_BASE_NAME)
#define ug_SetupContextTagList(pname, taglist) \
LP2(0x1e, int, ug_SetupContextTagList, const UBYTE*, pname, a0, struct TagItem *, taglist, a1, \
, USERGROUP_BASE_NAME)
#ifndef NO_INLINE_STDARG
#define ug_SetupContextTags(a0, tags...) \
({ULONG _tags[] = { tags }; ug_SetupContextTagList((a0), (struct TagItem *)_tags);})
#endif /* !NO_INLINE_STDARG */
#define ug_StrError(code) \
LP1(0x2a, const char *, ug_StrError, LONG, code, d1, \
, USERGROUP_BASE_NAME)
#endif /* _INLINE_USERGROUP_H */
+26 -17
View File
@@ -1,3 +1,6 @@
#ifndef _HEADERS_LIBINIT_H
#define _HEADERS_LIBINIT_H
/******************************************************************************/
/* */
/* special define(s) */
@@ -19,7 +22,7 @@
/* */
/******************************************************************************/
struct LibBase {
typedef struct libBase {
struct Library LibNode;
UWORD Pad;
LONG SegList;
@@ -27,9 +30,9 @@ struct LibBase {
SysBase;
#ifdef EXTENDED
ULONG DataSize;
struct LibBase *Parent;
struct libBase *Parent;
#endif
};
} *__LIB, *__DEV;
/******************************************************************************/
/* */
@@ -38,10 +41,10 @@ struct LibBase {
/******************************************************************************/
LONG LibExtFunc(VOID);
LONG LibExpunge(REG(a6,struct LibBase *));
LONG LibClose(REG(a6,struct LibBase *));
APTR LibOpen(REG(a6,struct LibBase *));
APTR LibInit(REG(a0,LONG),REG(d0,struct LibBase *),REG(a6,struct Library *));
LONG LibExpunge(REG(a6,__LIB));
LONG LibClose(REG(a6,__LIB));
APTR LibOpen(REG(a6,__LIB));
APTR LibInit(REG(a0,LONG),REG(d0,__LIB),REG(a6,struct Library *));
/******************************************************************************/
/* */
@@ -49,11 +52,11 @@ APTR LibInit(REG(a0,LONG),REG(d0,struct LibBase *),REG(a6,struct Library *));
/* */
/******************************************************************************/
APTR DevInit();
VOID DevOpen();
APTR DevClose();
APTR DevExpunge();
APTR DevExtFunc();
LONG DevExtFunc(VOID);
LONG DevExpunge(REG(a6,__DEV));
LONG DevClose(REG(a1,APTR),REG(a6,__DEV));
VOID DevOpen(REG(d0,ULONG),REG(a1,APTR),REG(d1,ULONG),REG(a6,__DEV));
APTR DevInit(REG(a0,LONG),REG(d0,__DEV),REG(a6,struct Library *));
/******************************************************************************/
/* */
@@ -69,13 +72,19 @@ extern const UWORD LibRevision;
extern const char LibIdString[];
extern const char LibName[];
extern LONG __stdargs __UserDevInit(struct Library *,REG(a4,APTR));
extern LONG __stdargs __UserDevOpen(struct IORequest *,ULONG,ULONG,REG(a4,APTR));
extern VOID __stdargs __UserDevClose(struct IORequest *,REG(a4,APTR));
extern VOID __stdargs __UserDevCleanup(REG(a4,APTR));
extern const UWORD DevVersion;
extern const UWORD DevRevision;
extern const char DevIdString[];
extern const char DevName[];
extern APTR __LibTable__[];
extern APTR __FuncTable__[];
extern LONG __datadata_relocs[];
/******************************************************************************/
/* */
/* end of libinit.h */
/* */
/******************************************************************************/
#endif /* _HEADERS_LIBINIT_H */
+6 -1
View File
@@ -1,3 +1,6 @@
#ifndef _HEADERS_POOL_H
#define _HEADERS_POOL_H
#include <exec/types.h>
#if defined(__GNUC__)
@@ -25,10 +28,12 @@ typedef struct Pool {
} POOL;
/*
** required prototypes ;)
** required prototypes
*/
APTR ASM AsmCreatePool(REG(d0,ULONG),REG(d1,ULONG),REG(d2,ULONG),REG(a6,APTR));
APTR ASM AsmAllocPooled(REG(a0,POOL *),REG(d0,ULONG),REG(a6,APTR));
VOID ASM AsmFreePooled(REG(a0,POOL *),REG(a1,APTR),REG(d0,ULONG),REG(a6,APTR));
VOID ASM AsmDeletePool(REG(a0,POOL *),REG(a6,APTR));
#endif /* _HEADERS_POOL_H */
+5
View File
@@ -1,3 +1,6 @@
#ifndef _HEADERS_RAND48_H
#define _HEADERS_RAND48_H
void srand48(long);
unsigned short *seed48(unsigned short *);
void lcong48(unsigned short *);
@@ -7,3 +10,5 @@ long mrand48(void);
long jrand48(unsigned short *);
double drand48(void);
double erand48(unsigned short *seed);
#endif /* _HEADERS_RAND48_H */
+4
View File
@@ -1,3 +1,6 @@
#ifndef _HEADERS_REGPARM_H
#define _HEADERS_REGPARM_H
#define ___PUSH(a) "movel\t" #a ",sp@-\n"
#define ___POP(a) "movel\tsp@+," #a "\n"
@@ -29,3 +32,4 @@ __REGP(functype,funcname,___PUSH(r3)___PUSH(r2)___PUSH(r1),12) (a1,a2,a3)
#define REGPARM4(functype,funcname,a1,r1,a2,r2,a3,r3,a4,r4) \
__REGP(functype,funcname,___PUSH(r4)___PUSH(r3)___PUSH(r2)___PUSH(r1),16) (a1,a2,a3,a4)
#endif /* _HEADERS_REGPARM_H */
+28
View File
@@ -0,0 +1,28 @@
#ifndef _HEADERS_SELECT_H
#define _HEADERS_SELECT_H
#define SELCMD_PREPARE 0
#define SELCMD_CHECK 1
#define SELCMD_POLL 2
#define SELMODE_IN 0
#define SELMODE_OUT 1
#define SELMODE_EXC 2
#define SELPKT_IN_USE(fp) ((fp)->lx_packet->sp_Pkt.dp_Port != NULL)
#define SelLastResult(fp) ((fp)->lx_packet->sp_Pkt.dp_Res1)
#define SelLastError(fp) ((fp)->lx_packet->sp_Pkt.dp_Res2)
#define PutPacket(port,pack) PutMsg((port),(pack))
#define GetPacket(port) ((struct StandardPacket *)GetMsg(port))
#define SelSendPacket1(fp,port,act,arg1) \
do { \
struct StandardPacket *sp = (fp)->lx_packet; \
sp->sp_Pkt.dp_Port = (port); \
sp->sp_Pkt.dp_Type = (act); \
sp->sp_Pkt.dp_Arg1 = (arg1); \
PutPacket(((struct FileHandle *)BADDR((fp)->lx_fh))->fh_Type,&sp->sp_Msg); \
} while(0)
#endif /* _HEADERS_SELECT_H */
+104
View File
@@ -0,0 +1,104 @@
#ifndef _HEADERS_SOCKET_H
#define _HEADERS_SOCKET_H
/*
**
*/
#include <netdb.h>
#include <amitcp/usergroup.h>
#include <amitcp/socketbasetags.h>
#include "inline/usergroup.h"
#include "inline/amitcp.h"
#include "inline/as225.h"
#include "stdio.h"
/*
**
*/
typedef enum {LX_NONE, LX_AMITCP, LX_AS225} LX_NETWORK_TYPE;
/*
**
*/
struct SocketSettings {
LX_NETWORK_TYPE lx_network_type;
union {
struct {
struct Library *BsdSocketBase;
struct Library *UserGroupBase;
} AMITCP;
struct {
struct Library *SocketBase;
} AS225;
} lx_stack;
#define lx_BsdSocketBase lx_stack.AMITCP.BsdSocketBase
#define lx_UserGroupBase lx_stack.AMITCP.UserGroupBase
#define lx_SocketBase lx_stack.AS225.SocketBase
unsigned long lx_sigurg;
unsigned long lx_sigio;
int lx_sockid;
int lx_isdaemon;
/* Support for net functions */
FILE *lx_pwd_fp; /* File pointer to the passwd file */
char *lx_pwd_line; /* buffer for reading a line from the passwd file */
struct passwd lx_pwd; /* static buffer to hold the data */
int lx_pwd_stayopen;/* TRUE if passwd file should stay open */
FILE *lx_grp_fp; /* File pointer to the groups file */
char *lx_grp_line; /* buffer for reading a line from the group file */
struct group lx_grp; /* static buffer to hold the data */
char **lx_members; /* array of group members */
int lx_grp_stayopen;/* TRUE if group file should stay open */
FILE *lx_net_fp; /* File pointer to protocol file */
char *lx_net_line; /* buffer for reading a line from the protocol file */
struct netent lx_net;
char **lx_net_aliases;
int lx_net_stayopen;
FILE *lx_serv_fp; /* File pointer to services file */
char *lx_serv_line; /* buffer for reading a line from the services file */
struct servent lx_serv;
char **lx_serv_aliases;
int lx_serv_stayopen;
FILE *lx_proto_fp; /* File pointer to protocol file */
char *lx_proto_line; /* buffer for reading a line from the protocol file */
struct protoent lx_proto;
char **lx_proto_aliases;
int lx_proto_stayopen;
/* resolv state structure */
struct __res_state *lx_res;
int *lx_res_socket;
/* XXX unused XXX */
int lx_logname_valid;
char lx_logname[MAXLOGNAME + 1];
char lx_logname_buf[MAXLOGNAME + 1];
/* XXX unused XXX */
char lx_ntoa_buf[18]; /* used by inet_ntoa */
/* logfile handling */
int lx_LogFile; /* fd for log */
int lx_LogStat; /* status bits, set by openlog() */
char *lx_LogTag; /* string to tag the entry with */
int lx_LogFacility; /* default facility code */
int lx_LogMask; /* mask of priorities to be logged */
int lx_setuid; /* used for setuid() - have to remember to log out */
};
/*
**
*/
extern struct SocketSettings *_lx_get_socket_settings(void);
/*
**
*/
extern StdFileDes *_create_socket(int family, int type, int protocol);
#endif /* _HEADERS_SOCKET_H */
+4 -4
View File
@@ -1,11 +1,11 @@
#ifndef _STABS_H_
#define _STABS_H_
#ifndef _HEADERS_STABS_H
#define _HEADERS_STABS_H
/* These are some macros for handling of symboltable information
*/
/* linker can use symbol b for symbol a if a is not defined */
#define ALIAS(a,b) asm(".stabs \"_" #a "\",11,0,0,0\n.stabs \"_" #b "\",1,0,0,0")
#define ALIAS(a,b) asm(".stabs \"_" #a "\",11,0,0,0;.stabs \"_" #b "\",1,0,0,0")
/* add symbol a to list b (type c (22=text 24=data 26=bss)) */
#define ADD2LIST(a,b,c) asm(".stabs \"_" #b "\"," #c ",0,0,_" #a )
@@ -99,4 +99,4 @@ _ADDTABL_ENDN(name,4)
#define ADDTABL_END() asm(".stabs \"___FuncTable__\",20,0,0,-1")
#endif
#endif /* _HEADERS_STABS_H */
+95 -25
View File
@@ -1,9 +1,8 @@
#ifndef STDIO_H
#define STDIO_H
#include <stdarg.h>
#ifndef _HEADERS_STDIO_H
#define _HEADERS_STDIO_H
#include <string.h>
#include <stdarg.h>
#include <exec/lists.h>
#include <exec/nodes.h>
/* Adjusted to be compatible with the bsd headers
* (At least for normal ANSI stuff)
@@ -19,15 +18,17 @@ typedef struct __FILE
int outcount; /* Space left in buffer for writing + fp->linebufsize,
* readmode: 0
*/
short flags; /* Some flags: 0x01 line buffered
* 0x02 unbuffered
* 0x04 read mode
* 0x08 write mode
* 0x20 EOF read
* 0x40 error encountered
* 0x80 buffer malloc'ed by library
* 0x200 sprintf/sscanf buffer
*/
short flags;
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* read mode */
#define __SWR 0x0008 /* write mode */
#define __SEOF 0x0020 /* EOF read */
#define __SERR 0x0040 /* error encountered */
#define __SMBF 0x0080 /* buffer malloc'ed by library */
#define __SSTR 0x0200 /* sprintf/sscanf buffer */
#define __SWO 0x8000 /* write-only mode */
short file; /* The filehandle */
unsigned char *buffer; /* original buffer pointer */
int bufsize; /* size of the buffer */
@@ -59,6 +60,7 @@ typedef struct __FILE
extern FILE *fopen(const char *filename,const char *mode);
extern FILE *freopen(const char *filename,const char *mode,FILE *stream);
extern FILE *fdopen(int filedes,const char *mode);
extern int fclose(FILE *stream);
extern int fgetc(FILE *stream);
extern int fputc(int c,FILE *stream);
@@ -74,11 +76,13 @@ extern int vfscanf(FILE *stream,const char *format,va_list args);
extern int snprintf(char *s,size_t size,const char *format,...);
extern int vsnprintf(char *s,size_t size,const char *format,va_list args);
extern int fseek(FILE *stream,long int offset,int whence);
extern char *fgets(char *s,int size,FILE *stream);
extern int fputs(const char *s,FILE *stream);
extern long int ftell(FILE *stream);
extern int setvbuf(FILE *stream,char *buf,int mode,unsigned long size);
extern int fread(void *,unsigned long,unsigned long,FILE *);
extern int fwrite(const void *,unsigned long,unsigned long,FILE *);
extern void rewind(FILE *stream);
extern long ftell(FILE *stream);
extern int setvbuf(FILE *stream,char *buf,int mode,size_t size);
extern int fread(void *,size_t,size_t,FILE *);
extern int fwrite(const void *,size_t,size_t,FILE *);
/* More bsd headers compatibility */
@@ -91,26 +95,92 @@ extern FILE **__sF; /* Standard I/O streams */
/* Be careful: We have side effects and use incount in __srget -
must use comma-operator */
#define getc(fp) ((fp)->incount--,(fp)->incount>=0?(int)*(fp)->p++:__srget(fp))
#define getc(fp) ((fp)->incount-=1,(fp)->incount>=0?(int)*(fp)->p++:__srget(fp))
#define putc(c,fp) \
((fp)->outcount--,(fp)->outcount>=0|| \
((fp)->outcount-=1,(fp)->outcount>=0|| \
((fp)->outcount>=(fp)->linebufsize&&(char)(c)!='\n')? \
*(fp)->p++=(c):__swbuf((c),(fp)))
#define ferror(fp) ((fp)->flags&64)
#define feof(fp) ((fp)->flags&32)
#define ferror(fp) ((fp)->flags&__SERR)
#define feof(fp) ((fp)->flags&__SEOF)
/* own stuff */
extern struct MinList __filelist; /* List of all fopen'ed files */
extern unsigned long *__stdfiledes; /* List of Amiga OS filehandles */
extern struct MinList __memorylist; /* List of memory puddles */
extern int __fflush(FILE *stream); /* fflush single file */
extern void __chkabort(void); /* check for SIGABRT */
struct filenode /* objects in __filelist */
{
/* objects in __filelist */
struct filenode {
struct MinNode node;
FILE FILE;
};
#endif
/*
** FILE/SOCKET abstraction layer
*/
#ifndef _SOCKET_IO
typedef struct _StdFileDes {
long lx_fh;
int lx_pos; /* __stdfiledes[lx_pos]; */
int lx_inuse;
int lx_oflags;
char lx_isatty;
char lx_sys;
} StdFileDes;
#else
#include <sys/types.h>
#include <dos/dosextens.h>
struct stat;
typedef enum {LX_FILE,LX_SOCKET} LX_FILE_TYPE;
typedef struct _StdFileDes {
LX_FILE_TYPE lx_type;
int lx_pos; /* __stdfiledes[lx_pos]; */
int lx_inuse;
union {
struct {
int lx_oflags;
long lx_fh;
char lx_isatty;
char lx_sys,lx_pad[2];
struct StandardPacket *lx_packet;
} file;
struct {
int lx_sock;
int lx_family;
int lx_protocol;
int lx_domain;
} sock;
} fd;
#define lx_oflags fd.file.lx_oflags
#define lx_fh fd.file.lx_fh
#define lx_isatty fd.file.lx_isatty
#define lx_sys fd.file.lx_sys
#define lx_packet fd.file.lx_packet
#define lx_sock fd.sock.lx_sock
#define lx_family fd.sock.lx_family
#define lx_protocol fd.sock.lx_protocol
#define lx_domain fd.sock.lx_domain
ssize_t (*lx_read)(struct _StdFileDes *,void *,size_t);
ssize_t (*lx_write)(struct _StdFileDes *,const void *,size_t);
int (*lx_close)(struct _StdFileDes *);
int (*lx_dup)(struct _StdFileDes *);
int (*lx_fstat)(struct _StdFileDes *,struct stat *);
int (*lx_select)(struct _StdFileDes *sfd,int select_cmd,int io_mode,fd_set *,u_long *);
} StdFileDes;
extern StdFileDes *_lx_fdfromfh(int fh, LX_FILE_TYPE type);
#endif /* _SOCKET_IO */
extern StdFileDes *_lx_fhfromfd(int fd);
#endif /* _HEADERS_STDIO_H */
+9 -5
View File
@@ -6,7 +6,11 @@
#ifdef __OPTIMIZE__
extern __inline__ void *memcpy(void *s1,const void *s2,size_t n)
{ register char *a6 __asm("a6") = *(char **)4;
{
#ifndef __NOLIBBASE__
extern struct ExecBase *SysBase;
#endif
register char *a6 __asm("a6") = (char *)SysBase;
register const void *a0 __asm("a0") = s2;
register const void *a1 __asm("a1") = s1;
register size_t d0 __asm("d0") = n;
@@ -14,26 +18,26 @@ extern __inline__ void *memcpy(void *s1,const void *s2,size_t n)
: /* no output */
: "r" (a6), "r" (a0), "r" (a1), "r" (d0)
: "a0","a1","d0","d1", "memory");
return s1;
}
extern __inline__ void *memmove(void *s1,const void *s2,size_t n)
{ extern void bcopy();
bcopy(s2,s1,n); return s1;
}
extern __inline__ void *memset(void *s,int c,size_t n)
{
if (n) {
unsigned char *p=s;
unsigned char *p=(unsigned char *)s;
do;while(*p++=c,--n);
}
return s;
}
extern __inline__ int memcmp(const void *s1,const void *s2,size_t n)
{ const unsigned char *p1=s1,*p2=s2;
{ const unsigned char *p1=(const unsigned char *)s1,*p2=(const unsigned char *)s2;
unsigned long r,c;
if ((r=n))
@@ -148,7 +152,7 @@ extern __inline__ char *strlwr(char *s)
return s;
}
extern __inline__ char *stpcpy(char *dst,char *src)
extern __inline__ char *stpcpy(char *dst,const char *src)
{
do;while((*dst++=*src++)); return(--dst);
}
+68 -5
View File
@@ -68,7 +68,7 @@ B Symbol redirections didn't work the way I expected - removed most of them.
B -lm links libm.a BEFORE libnix. Moved some functions.
B vfscanf() does no longer ungetc EOF
B vfscanf() does no longer ungetc EOF.
M Optimized __udivsi3, __umodsi3, __divsi3, __modsi3, div, ldiv.
@@ -158,7 +158,7 @@ B LocaleBase was defined twice - fixed.
B Moved __decimalpoint from libm.a into libnix.a.
F Added 3.1 system libraries to libstubs.a
F Added 3.1 system libraries to libstubs.a.
F Added Un*x functions (mkdir,chdir,rmdir,getwd,getcwd,opendir,readdir,closedir)
@@ -262,6 +262,7 @@ F Added CPU check with error requester for the non-68000 versions (changed
startups, too).
V1.1
F cache flush function for gcc support added
B fixed a macro in stabs.h for shared library support
@@ -276,13 +277,13 @@ V1.1a
B fixed "off-by-one" error of portable strncpy()
B fixed open() so that it ignores stdio slots now
B fixed open() to ignore stdio slots now
V1.1b
B fixed longjmp() not returning 1 if passed a 0
M changed automatic library opening once again ;(
M changed automatic library opening once again ;-(
(moved openliberror() function into __initlibraries source)
P tweaked string functions and removed some asm versions
@@ -296,7 +297,8 @@ S added some const qualifiers at several places
F tweaked libamiga.a functions
F rewrote libinit.c, libinitr.c and devinit.c (requires ADE/GG GCC 2.7.2.1 or up)
F rewrote libinit.c, libinitr.c and devinit.c
(requires ADE/GG GCC 2.7.2.1 or up)
F added three math functions from vc.lib: frexp.c, ldexp.c and modf.c
@@ -306,3 +308,64 @@ S added "/WAIT" to default stdiowin options
(suggested by Martin Hauner)
V1.2
S updated headers/strsup.h once again
F added fdopen() (required changes in freopen())
B fixed auto-initilization of init_stk.c
(broken since 1.2)
B fixed bug in mktime() (tm_mday starts with 1!)
(reported by Detlef Wuerkner)
S modified rename() according to man-page
S __seterrno() does map rename() error now
(was disabled!?)
V1.3
F added networking support based on initial work by Jeff Sheperd
(supports AmiTCP and AS225 compatible stacks)
B strftime() formats for date and date/time were swapped
(apparently this was due to an outdated manpage...)
B fixed incorrect types usage with proper system types
(makes the library better prepared for PPC ;-)
P improved memset(), bcopy() and bzero()
(hopefully ;-)
B fixed (harmless?) bug in freopen() open mode handling
(did only handle rwa[b]+ but not rwa+[b])
B fixed append filemode to really write at end of file only
S changed fdopen() to be independed from freopen()
S stdin/stdout/stderr initialization now use fdopen()
(-> removed freopen()'s stdio open kludge)
S adapted chmod() to return success if SetProtection
fails because source is locked
F finally rewrote devinit.c to use GCC 2.7.2.1 features
(now in sync with libinit.c/libinitr.c)
B fixed Makefiles for case sensitives filesystems, cross
compilation support (dosesn't use ar directly anymore)
and proper $(MAKE) handling
B fixed hole in math/Makefile.in :-(
(didn't reference *all* objects leading to vfprint/vfscanf)
F added a better and more general debug scheme
F added gettimeofday() from libnixPPC package
S general code cleanup
(eg. replaced all numerical stdio flags with #defines)
V2.0
+10 -9
View File
@@ -4,11 +4,12 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
CPP = @CPP@
AS = as
AR = ar
RANLIB = @RANLIB@
AWK = @AWK@
AWK = @AWK@
#### End system configuration section ####
@@ -18,17 +19,17 @@ endif
CURDIR = $(shell pwd)
OPTIONS=-I $(srcdir)/../headers -I ../../sources/headers -DFULL_SPECIFIERS $(CFLAGS)
SOURCEFILES=*/*
OPTIONS=-I$(srcdir)/../headers -DFULL_SPECIFIERS $(CFLAGS)
OBJECTS2=$(OBJECTS) \
../nix/assert/__eprintf.o \
../nix/stdio/printf.o ../nix/stdio/fprintf.o ../nix/stdio/sprintf.o \
../nix/stdio/vprintf.o ../nix/stdio/vsprintf.o stdio/vfprintf.o \
../nix/stdio/scanf.o ../nix/stdio/fscanf.o ../nix/stdio/sscanf.o \
../nix/stdio/vscanf.o ../nix/stdio/vsscanf.o stdio/vfscanf.o
../nix/stdio/vscanf.o ../nix/stdio/vsscanf.o stdio/vfscanf.o \
../nix/stdio/tmpfile.o ../nix/stdio/tmpnam.o
SUBDIRS2=$(SUBDIRS) ../nix/stdio
SUBDIRS2=$(SUBDIRS) ../nix/assert ../nix/stdio
REDEF=-D_DOSBase=___DOSBase \
-D_UtilityBase=___UtilityBase \
@@ -58,9 +59,9 @@ veryclean:
$(foreach f,$(SUBDIRS2),$(CURDIR)/$(f)):
mkdir $@
libm.a: $(foreach f,$(SUBDIRS2),$(CURDIR)/$(f)) $(OBJECTS2) ../../sources/math/makefile ../../sources/math/filelist
libm.a: $(foreach f,$(SUBDIRS2),$(CURDIR)/$(f)) $(OBJECTS2) ../../sources/math/Makefile ../../sources/math/filelist
-rm -f $@
ar -q $@ $(OBJECTS2)
$(AR) -q $@ $(OBJECTS2)
$(RANLIB) $@
echo "\$$$(V)" >>$@
+4 -3
View File
@@ -4,17 +4,18 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
CPP = @CPP@
AS = as
AR = ar
RANLIB = @RANLIB@
AWK = @AWK@
AWK = @AWK@
#### End system configuration section ####
OBJECTS=detach.o swapstack.o
OPTIONS=-I $(srcdir)/../headers -I../../sources/headers $(CFLAGS)
OPTIONS=-I$(srcdir)/../headers $(CFLAGS)
vpath %.c $(SOURCEDIR)
+1 -1
View File
@@ -3,7 +3,7 @@
#include <dos/dosextens.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <stabs.h>
#include "stabs.h"
/* Sorry, but the assembler code produced by gcc for this function is too bad.
* This one is much better!
+6 -7
View File
@@ -4,11 +4,12 @@ srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
CPP = @CPP@
CPP = @CPP@
AS = as
AR = ar
RANLIB = @RANLIB@
AWK = @AWK@
AWK = @AWK@
#### End system configuration section ####
@@ -18,9 +19,7 @@ endif
CURDIR = $(shell pwd)
OPTIONS=-I $(srcdir)/../headers -I ../../sources/headers $(CFLAGS)
SOURCEFILES=*/*
OPTIONS=-I$(srcdir)/../headers $(CFLAGS)
REDEF=-D_DOSBase=___DOSBase \
-D_UtilityBase=___UtilityBase \
@@ -50,8 +49,8 @@ veryclean:
$(foreach f,$(SUBDIRS),$(CURDIR)/$(f)):
mkdir $@
libnix.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) ../../sources/nix/makefile ../../sources/nix/filelist
libnix.a: $(foreach f,$(SUBDIRS),$(CURDIR)/$(f)) $(OBJECTS) ../../sources/nix/Makefile ../../sources/nix/filelist
-rm -f $@
ar -q $@ $(OBJECTS)
$(AR) -q $@ $(OBJECTS)
$(RANLIB) $@
echo "\$$$(V)" >>$@
+8 -20
View File
@@ -4,10 +4,7 @@
/* Table to convert amigados error messages to unix ones */
extern int errno;
static long _errortable[]=
{
static long _errortable[] = {
ERROR_NO_FREE_STORE ,ENOMEM,
ERROR_TASK_TABLE_FULL ,EPROCLIM,
/*ERROR_BAD_TEMPLATE
@@ -32,7 +29,7 @@ static long _errortable[]=
ERROR_OBJECT_WRONG_TYPE*/
ERROR_DISK_NOT_VALIDATED ,EBUSY,
ERROR_DISK_WRITE_PROTECTED ,EROFS,
/*ERROR_RENAME_ACROSS_DEVICES*/
ERROR_RENAME_ACROSS_DEVICES ,EXDEV,
ERROR_DIRECTORY_NOT_EMPTY ,ENOTEMPTY,
ERROR_TOO_MANY_LEVELS ,ENAMETOOLONG,
ERROR_DEVICE_NOT_MOUNTED ,ENXIO,
@@ -56,22 +53,13 @@ static long _errortable[]=
ERROR_BUFFER_OVERFLOW
ERROR_BREAK*/
ERROR_NOT_EXECUTABLE ,EACCES,
0
0 ,EPERM
};
void __seterrno(void)
{
long amigaerror;
long *ptr=_errortable;
amigaerror=IoErr();
while(*ptr)
{
if(*ptr++==amigaerror)
{
errno=*ptr;
return;
}
ptr++;
}
errno=EPERM;
{ long amigaerror=IoErr(),*ptr=_errortable,err;
while((err=*ptr++)&&(err!=amigaerror))
++ptr;
errno=*ptr;
}
+1 -1
View File
@@ -1,7 +1,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stabs.h>
#include "stabs.h"
static int __pathconv;
+2 -2
View File
@@ -1,7 +1,7 @@
#include <dos/dos.h>
#include <proto/dos.h>
#include <fcntl.h>
#include <unistd.h>
#include <dos/dos.h>
#include <proto/dos.h>
extern void __seterrno(void);
extern char *__amigapath(const char *path);
+1 -1
View File
@@ -1,3 +1,3 @@
#include <stabs.h>
#include "stabs.h"
ALIAS(bcmp,memcmp);
+2 -2
View File
@@ -1,7 +1,7 @@
#include <proto/dos.h>
#include <stdlib.h>
#include <unistd.h>
#include <stabs.h>
#include <proto/dos.h>
#include "stabs.h"
extern void __seterrno(void);
+14 -15
View File
@@ -1,3 +1,4 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dos/dosextens.h>
@@ -7,23 +8,21 @@ extern void __seterrno(void);
extern char *__amigapath(const char *path);
int chmod(const char *name, mode_t mode)
{ int ret;
{
#ifdef IXPATHS
if((name=__amigapath(name))==NULL)
return -1;
#endif
if ((ret=~(SetProtection((STRPTR)name,((mode&S_IRUSR?0:FIBF_READ)|
(mode&S_IWUSR?0:FIBF_WRITE|FIBF_DELETE)|
(mode&S_IXUSR?0:FIBF_EXECUTE)|
(mode&S_IRGRP?FIBF_GRP_READ:0)|
(mode&S_IWGRP?FIBF_GRP_WRITE|FIBF_GRP_DELETE:0)|
(mode&S_IXGRP?FIBF_GRP_EXECUTE:0)|
(mode&S_IROTH?FIBF_OTR_READ:0)|
(mode&S_IWOTH?FIBF_OTR_WRITE|FIBF_OTR_DELETE:0)|
(mode&S_IXOTH?FIBF_OTR_EXECUTE:0))))))
__seterrno();
return ret;
if(!SetProtection((STRPTR)name,((mode&S_IRUSR?0:FIBF_READ)|
(mode&S_IWUSR?0:FIBF_WRITE|FIBF_DELETE)|
(mode&S_IXUSR?0:FIBF_EXECUTE)|
(mode&S_IRGRP?FIBF_GRP_READ:0)|
(mode&S_IWGRP?FIBF_GRP_WRITE|FIBF_GRP_DELETE:0)|
(mode&S_IXGRP?FIBF_GRP_EXECUTE:0)|
(mode&S_IROTH?FIBF_OTR_READ:0)|
(mode&S_IWOTH?FIBF_OTR_WRITE|FIBF_OTR_DELETE:0)|
(mode&S_IXOTH?FIBF_OTR_EXECUTE:0))))
if(__seterrno(),errno!=ETXTBSY)
return -1;
return 0;
}
-2
View File
@@ -1,7 +1,5 @@
#include <fcntl.h>
extern void __seterrno(void);
int creat(const char *path, mode_t mode)
{
return open(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
+13 -23
View File
@@ -1,29 +1,24 @@
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <exec/memory.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <strsup.h>
DIR *opendir(const char *dirname)
{
DIR *dirp;
{ DIR *dirp;
if ((dirp=(DIR *)AllocVec(sizeof(DIR),MEMF_PUBLIC)) != NULL)
{
if ((dirp->d_lock=(Lock((STRPTR)dirname,SHARED_LOCK))) != 0ul)
{
if ((dirp=(DIR *)AllocVec(sizeof(DIR),MEMF_PUBLIC)) != NULL) {
if ((dirp->d_lock=(Lock((STRPTR)dirname,SHARED_LOCK))) != 0ul) {
dirp->d_count=0; dirp->d_more = DOSTRUE;
if ((dirp->d_eac=AllocDosObject(DOS_EXALLCONTROL,NULL)) != NULL)
{
if ((dirp->d_eac=AllocDosObject(DOS_EXALLCONTROL,NULL)) != NULL) {
#if 0
dirp->d_eac->eac_LastKey=0;
dirp->d_eac->eac_MatchString=NULL;
dirp->d_eac->eac_MatchFunc=NULL;
#endif
if (Examine(dirp->d_lock,&dirp->d_info))
{
if (Examine(dirp->d_lock,&dirp->d_info)) {
if (dirp->d_info.fib_EntryType>=0)
return dirp;
}
@@ -37,20 +32,15 @@ DIR *opendir(const char *dirname)
}
struct dirent *readdir(DIR *dirp)
{
struct dirent *result;
{ struct dirent *result;
if (dirp->d_count==0 && dirp->d_more!=DOSFALSE)
{
if (!dirp->d_count && dirp->d_more!=DOSFALSE) {
dirp->d_more=ExAll(dirp->d_lock,(APTR)&dirp->d_ead[0],sizeof(dirp->d_ead),ED_NAME,dirp->d_eac);
dirp->current=(struct ExAllData *)&dirp->d_ead[0];
dirp->d_count=dirp->d_eac->eac_Entries;
}
result = NULL;
if (dirp->d_count)
{
if (result=NULL,dirp->d_count) {
dirp->dd_ent.d_fileno = dirp->dd_ent.d_reclen = 1;
strcpy(dirp->dd_ent.d_name,dirp->current->ed_Name);
dirp->dd_ent.d_namlen = strlen(dirp->dd_ent.d_name);
@@ -58,16 +48,16 @@ struct dirent *readdir(DIR *dirp)
dirp->d_count--;
result=&dirp->dd_ent;
}
return result;
}
void rewinddir(DIR *dirp)
{
if (dirp->d_more!=DOSFALSE)
do
{
dirp->d_more=ExAll(dirp->d_lock,(APTR)&dirp->d_ead[0],sizeof(dirp->d_ead),ED_NAME,dirp->d_eac);
}
do {
dirp->d_more=ExAll(dirp->d_lock,(APTR)&dirp->d_ead[0],sizeof(dirp->d_ead),ED_NAME,dirp->d_eac);
}
while(dirp->d_more!=DOSFALSE);
dirp->d_count=0; dirp->d_more = DOSTRUE; dirp->d_eac->eac_LastKey=0;
}
+4 -5
View File
@@ -6,9 +6,8 @@
* It's not ANSI but it's encapsulated and may be useful - so why not :-).
*
*/
unsigned long *__stdfiledes;
unsigned long fdtofh(int filedescriptor)
{
return __stdfiledes[filedescriptor];
}
#include "stdio.h"
long fdtofh(int filedescriptor)
{ return _lx_fhfromfd(filedescriptor)->lx_fh; }
+16 -24
View File
@@ -2,46 +2,39 @@
#include <sys/stat.h>
#include <dos/dosextens.h>
#include <proto/dos.h>
#include <string.h>
#include <strsup.h>
#include <stdio.h>
extern void __seterrno(void);
extern int __stat(struct stat *buf,struct FileInfoBlock *fib);
extern unsigned long *__stdfiledes;
int fstat(int d,struct stat *buf)
{
{ extern int __stat(struct stat *buf,struct FileInfoBlock *fib);
#if defined (__GNUC__)
#undef DOS_BASE_NAME
#define DOS_BASE_NAME dosbase
struct DosLibrary *dosbase = DOSBase;
register APTR dosbase __asm("a6") = DOSBase;
#endif
StdFileDes *fp = _lx_fhfromfd(d);
struct FileInfoBlock *fib;
LONG pos,len;
BPTR fh;
LONG pos,len,fh;
if (/*d<stdfilesize && */((fh=__stdfiledes[d]) != 0))
if ((fib=(struct FileInfoBlock *)AllocDosObject(DOS_FIB,NULL)) != NULL)
;
else
{
if (fp && (fh=fp->lx_fh)) {
if ((fib=(struct FileInfoBlock *)AllocDosObject(DOS_FIB,NULL)) == NULL) {
__seterrno(); return -1;
}
else
return -1;
} else return -1;
memset(buf,0,sizeof(struct stat));
memset(buf,0,sizeof(*buf));
buf->st_mode = S_IFCHR | 0777;
buf->st_nlink = 1;
buf->st_blksize = 512;
/*buf->st_blocks = 0;*/
if (((struct FileHandle *)BADDR(fh))->fh_Type != NULL)
{
if (!ExamineFH(fh,fib))
{
if (((struct FileHandle *)BADDR(fh))->fh_Type) {
if (!ExamineFH(fh,fib)) {
len = 0; pos = Seek(fh,0,OFFSET_END);
if (pos >= 0 && (IoErr() != ERROR_ACTION_NOT_KNOWN))
len = Seek(fh,pos,OFFSET_BEGINNING);
@@ -50,14 +43,13 @@ int fstat(int d,struct stat *buf)
fib->fib_DirEntryType = -1;
fib->fib_Size = len;
fib->fib_Protection = 0xff0;
fib->fib_NumBlocks = ((len + 511) >> 9);
fib->fib_NumBlocks = (len+=511,len>>=9);
DateStamp(&fib->fib_Date);
}
__stat(buf,fib);
Seek(fh,0,OFFSET_CURRENT);
if (IoErr())
if (Seek(fh,0,OFFSET_CURRENT),IoErr())
buf->st_mode = ((buf->st_mode & ~S_IFREG) | S_IFCHR);
}
+2 -1
View File
@@ -2,8 +2,9 @@
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/times.h>
#include <string.h>
#include <strsup.h>
#include <stabs.h>
#include "stabs.h"
extern void timer(long *);
+31
View File
@@ -0,0 +1,31 @@
#include <sys/time.h>
#include <dos/dos.h>
#include <proto/dos.h>
extern long __gmtoffset;
int gettimeofday(struct timeval *tv, struct timezone *tzp)
{
if (tv) {
struct DateStamp t;
DateStamp(&t); /* Get timestamp */
tv->tv_sec=((t.ds_Days+2922)*1440+t.ds_Minute+__gmtoffset)*60+
t.ds_Tick/TICKS_PER_SECOND;
tv->tv_usec=(t.ds_Tick%TICKS_PER_SECOND)*1000000/TICKS_PER_SECOND;
}
if (tzp) {
/* since AmigaOS doesn't support timezones, we always return
* GMT...
*/
tzp->tz_minuteswest = 0;
tzp->tz_dsttime = 0;
}
return 0;
}
/*
* 2922 is the number of days between 1.1.1970 and 1.1.1978 (2 leap years and 6 normal)
* 1440 is the number of minutes per day
* 60 is the number of seconds per minute
*/
+1 -1
View File
@@ -1,7 +1,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <proto/dos.h>
#include <stabs.h>
#include "stabs.h"
extern void __seterrno(void);
+9 -9
View File
@@ -1,25 +1,25 @@
#include <unistd.h>
#include <string.h>
#include <proto/exec.h>
#include "strsup.h"
char *mktemp(char *buf)
{
long pid = (long)FindTask(0L);
char *c = buf + strlen(buf);
{ long pid = (long)FindTask(0L);
char *c = buf;
while (*--c == 'X') {
while(*c++); --c;
while(*--c == 'X') {
*c = pid % 10 + '0';
pid /= 10;
}
c++;
if (*c) {
if (++c,*c) {
for(*c='A'; *c <= 'Z'; (*c)++) {
if (access(buf, 0)) {
if (access(buf,0)) {
return buf;
}
}
*c = 0;
}
return buf;
}
+1 -1
View File
@@ -1,3 +1,3 @@
#include <stabs.h>
#include "stabs.h"
ALIAS(rmdir,remove);
+2 -3
View File
@@ -1,5 +1,4 @@
#include <stdio.h>
#include <stdlib.h>
int setbuffer(FILE *stream,char *buf,size_t size)
{ return setvbuf(stream,buf,buf!=NULL?_IOFBF:_IONBF,size); }
void setbuffer(FILE *stream,char *buf,size_t size)
{ (void)setvbuf(stream,buf,buf?_IOFBF:_IONBF,size); }
+2 -4
View File
@@ -1,6 +1,4 @@
#include <stdio.h>
int setlinebuf(FILE *f)
{
return setvbuf(f, NULL, _IOLBF, 0);
}
int setlinebuf(FILE *stream)
{ return setvbuf(stream,NULL,_IOLBF,0); }
+1 -1
View File
@@ -3,7 +3,7 @@
#include <dos/dosextens.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <stabs.h>
#include "stabs.h"
extern int __stat(struct stat *buf,struct FileInfoBlock *fib);
extern void __seterrno(void);
+3 -1
View File
@@ -1,4 +1,6 @@
char *stpcpy(char *dest,char *source)
#include <string.h>
char *stpcpy(char *dest,const char *source)
{
while((*dest++=*source++)); return(dest-1);
}
+3 -5
View File
@@ -1,12 +1,10 @@
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <strsup.h>
char *strdup(const char *s)
{
char *s1;
if ((s1=malloc(strlen_plus_one(s))))
{ char *s1=malloc(strlen_plus_one(s));
if (s1)
strcpy(s1,s);
return s1;
}
+2 -2
View File
@@ -1,6 +1,6 @@
#include <proto/utility.h>
#include <string.h>
#include <stabs.h>
#include <proto/utility.h>
#include "stabs.h"
int stricmp(const char *s1,const char *s2)
{
+4 -6
View File
@@ -1,16 +1,14 @@
#include <ctype.h>
#include <stabs.h>
#include "stabs.h"
char *strlower(char *s)
{
unsigned char *s1;
{ unsigned char *s1;
s1=(unsigned char *)s;
while(*s1)
{
while(*s1) {
if (isupper(*s1))
*s1+='a'-'A';
s1++;
++s1;
}
return s;
}
+2 -3
View File
@@ -1,10 +1,9 @@
#include <proto/utility.h>
#include <string.h>
#include <stabs.h>
#include <proto/utility.h>
#include "stabs.h"
int strnicmp(const char *s1,const char *s2,size_t len)
{
return Strnicmp((STRPTR)s1,(STRPTR)s2,(LONG)len);
}
+4 -6
View File
@@ -1,16 +1,14 @@
#include <ctype.h>
#include <stabs.h>
#include "stabs.h"
char *strupper(char *s)
{
unsigned char *s1;
{ unsigned char *s1;
s1=(unsigned char *)s;
while(*s1)
{
while(*s1) {
if (islower(*s1))
*s1-='a'-'A';
s1++;
++s1;
}
return s;
}
+15 -21
View File
@@ -1,35 +1,29 @@
#include <errno.h>
#include <limits.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/times.h>
clock_t times(struct tms *tp)
{
struct rusage r1, r2;
clock_t tim;
int status;
{ struct rusage r;
time_t tim;
status = getrusage(RUSAGE_SELF, &r1);
if (status != 0) {
return status;
}
status = getrusage(RUSAGE_CHILDREN, &r2);
if (status != 0) {
return status;
}
if (getrusage(RUSAGE_SELF, &r) < 0)
return (clock_t)-1;
tim = time(0L);
if (errno != 0) {
return tim;
}
tp->tms_utime = r.ru_utime.tv_sec * CLK_TCK +
(r.ru_utime.tv_usec * CLK_TCK) / 1000000;
tp->tms_stime = r.ru_stime.tv_sec * CLK_TCK +
(r.ru_stime.tv_usec * CLK_TCK) / 1000000;
if (getrusage(RUSAGE_CHILDREN, &r) < 0)
return (clock_t)-1;
tp->tms_utime = r1.ru_utime.tv_sec * CLK_TCK +
(r1.ru_utime.tv_usec * CLK_TCK) /1000000;
tp->tms_cutime = 0;
tp->tms_stime = r1.ru_stime.tv_sec * CLK_TCK +
(r1.ru_stime.tv_usec * CLK_TCK) / 1000000;
tp->tms_cstime = 0;
if ((tim=time(NULL)) == (time_t)-1)
return (clock_t)-1;
/* The value we are supposed to return does not fit in 32 bits.
Still, it is useful if you are interested in time differences
in CLK_TCKths of a second.
+1 -1
View File
@@ -1,3 +1,3 @@
#include <stabs.h>
#include "stabs.h"
ALIAS(unlink,remove);
+7 -8
View File
@@ -2,16 +2,15 @@
#include <utime.h>
int utime(const char *file, const struct utimbuf *timep)
{
struct timeval times[2],*t=NULL;
{ struct timeval times[2],*t=NULL;
if (timep != NULL)
{
t=&times[0];
t[0].tv_sec = timep->actime;
if (timep) {
t = &times[0];
t[0].tv_sec = timep->actime;
t[0].tv_usec = 0;
t[1].tv_sec = timep->modtime;
t[1].tv_sec = timep->modtime;
t[1].tv_usec = 0;
}
return utimes(file, t);
return utimes(file,t);
}
+4 -7
View File
@@ -5,18 +5,15 @@
#include <devices/timer.h>
#include <sys/time.h>
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
#define SECSPERDAY (24L * 60L * 60L)
int utimes(const char *file, const struct timeval *times)
{
struct timeval modtime;
struct DateStamp d;
time_t t;
{ struct DateStamp d;
if (times) {
modtime = times[1];
struct timeval modtime = times[1];
time_t t;
if (modtime.tv_usec > 1000000) {
modtime.tv_sec += (modtime.tv_usec / 1000000);
modtime.tv_usec %= 1000000;
+7 -12
View File
@@ -1,18 +1,13 @@
#include <libraries/locale.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <dos/dos.h>
#ifdef __GNUC__ /* This is very sad :-( */
#undef BITSPERBYTE
#undef MAXINT
#undef MININT
#endif
#include <limits.h>
#include <proto/exec.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <dos/dos.h>
#include <libraries/locale.h>
#include <proto/locale.h>
#include <proto/exec.h>
#include <strsup.h>
#include <stabs.h>
#include "stabs.h"
extern struct LocaleBase *LocaleBase;
extern char __localename[];
+1 -1
View File
@@ -1,4 +1,4 @@
#include <bases.h>
#include "bases.h"
asm("
.globl _div
+1 -1
View File
@@ -1,5 +1,5 @@
#include <proto/mathieeedoubbas.h>
#include <stabs.h>
#include "stabs.h"
signed long __eqdf2(double x,double y)
{ return IEEEDPCmp(x,y); }
+1 -1
View File
@@ -1,5 +1,5 @@
#include <proto/mathieeesingbas.h>
#include <stabs.h>
#include "stabs.h"
signed long __eqsf2(float x,float y)
{ return IEEESPCmp(x,y); }
+1 -1
View File
@@ -1,4 +1,4 @@
#include <bases.h>
#include "bases.h"
asm("
.globl ___mulsi3
+1 -1
View File
@@ -1,4 +1,4 @@
#include <bases.h>
#include "bases.h"
asm("
.globl ___umodsi3
+1 -1
View File
@@ -1,4 +1,4 @@
#include <bases.h>
#include "bases.h"
asm("
.data
+39 -23
View File
@@ -1,36 +1,52 @@
#include <stdlib.h>
/* This is a _fast_ block move routine */
/* This is a _fast_ block move routine! */
void bcopy(const void *s1,void *s2,size_t n)
{ size_t m;
if(!n)
return;
if(s2<s1)
{ if((long)s1&1)
{ *((char *)s2)++=*((char *)s1)++;
n--; }
if(!((long)s2&1))
{ m=n/sizeof(long);
n&=sizeof(long)-1;
for(;m;m--)
*((long *)s2)++=*((long *)s1)++;
}
for(;n;n--)
*((char *)s2)++=*((char *)s1)++;
{ if(n>15)
{ if((long)s1&1)
{ *((char *)s2)++=*((char *)s1)++;
n--; }
if(!((long)s2&1))
{ if((long)s1&2)
{ *((short *)s2)++=*((short *)s1)++;
n-=2; }
for(m=n/(8*sizeof(long));m;--m)
{ *((long *)s2)++=*((long *)s1)++; *((long *)s2)++=*((long *)s1)++;
*((long *)s2)++=*((long *)s1)++; *((long *)s2)++=*((long *)s1)++;
*((long *)s2)++=*((long *)s1)++; *((long *)s2)++=*((long *)s1)++;
*((long *)s2)++=*((long *)s1)++; *((long *)s2)++=*((long *)s1)++; }
n&=8*sizeof(long)-1;
for(m=n/sizeof(long);m;--m)
*((long *)s2)++=*((long *)s1)++;
n&=sizeof(long)-1; }
if(!n) return;
} do;while(*((char *)s2)++=*((char *)s1)++,--n);
}else
{ (char *)s1+=n;
(char *)s2+=n;
if((long)s1&1)
{ *--((char *)s2)=*--((char *)s1);
n--; }
if(!((long)s2&1))
{ m=n/sizeof(long);
n&=sizeof(long)-1;
for(;m;m--)
*--((long *)s2)=*--((long *)s1);
}
for(;n;n--)
*--((char *)s2)=*--((char *)s1);
if(n>15)
{ if((long)s1&1)
{ *--((char *)s2)=*--((char *)s1);
n--; }
if(!((long)s2&1))
{ if((long)s1&2)
{ *--((short *)s2)=*--((short *)s1);
n-=2; }
for(m=n/(8*sizeof(long));m;--m)
{ *--((long *)s2)=*--((long *)s1); *--((long *)s2)=*--((long *)s1);
*--((long *)s2)=*--((long *)s1); *--((long *)s2)=*--((long *)s1);
*--((long *)s2)=*--((long *)s1); *--((long *)s2)=*--((long *)s1);
*--((long *)s2)=*--((long *)s1); *--((long *)s2)=*--((long *)s1); }
n&=8*sizeof(long)-1;
for(m=n/sizeof(long);m;--m)
*--((long *)s2)=*--((long *)s1);
n&=sizeof(long)-1; }
if(!n) return;
} do;while(*--((char *)s2)=*--((char *)s1),--n);
}
}
+20 -11
View File
@@ -1,14 +1,23 @@
#include <string.h>
void bzero(void *b,size_t len)
{ size_t n;
if((unsigned long)b&1)
{ *((char *)b)++=0;
len--; }
n=len/sizeof(long);
len-=n*sizeof(long);
while(n--)
*((long *)b)++=0;
while(len--)
*((char *)b)++=0;
void bzero(void *b,size_t n)
{ size_t m;
if(!n)
return;
if(n>15)
{ if((long)b&1)
{ *((char *)b)++=0;
n--; }
if((long)b&2)
{ *((short *)b)++=0;
n-=2; }
for(m=n/(8*sizeof(long));m;--m)
{ *((long *)b)++=0; *((long *)b)++=0; *((long *)b)++=0; *((long *)b)++=0;
*((long *)b)++=0; *((long *)b)++=0; *((long *)b)++=0; *((long *)b)++=0; }
n&=8*sizeof(long)-1;
for(m=n/sizeof(long);m;--m)
*((long *)b)++=0;
if((n&=sizeof(long)-1)==0) return;
}
do;while(*((char *)b)++=0,--n);
}
+9 -13
View File
@@ -3,27 +3,23 @@
#include <unistd.h>
int __fflush(FILE *stream) /* fflush exactly one file */
{
{ unsigned char *subbuf;
long size,subsize;
unsigned char *subbuf;
if(stream->flags&0x40) /* Error on stream */
if(stream->flags&__SERR) /* Error on stream */
{ errno=EPERM;
return EOF; }
if(stream->flags&8) /* Works only on output streams */
{
size=stream->p-stream->buffer; /* calculate size */
if(stream->flags&__SWR) /* Works only on output streams */
{ size=stream->p-stream->buffer; /* calculate size */
subbuf=stream->buffer;
while(size)
{
if((subsize=write(stream->file,subbuf,size))<0)
{
stream->flags|=64; /* error flag */
return EOF;
}
{ if((subsize=write(stream->file,subbuf,size))<0)
{ stream->flags|=__SERR; /* error flag */
return EOF; }
size-=subsize;
subbuf+=subsize;
}
stream->flags&=~8; /* unset write state */
stream->flags&=~__SWR; /* unset write state */
stream->outcount=0;
stream->linebufsize=0;
} /* Nothing to be done for input streams */
+9 -9
View File
@@ -4,13 +4,13 @@
int __srget(FILE *stream) /* Get next input block */
{
if(stream->flags&96) /* Error on stream / EOF */
if(stream->flags&(__SERR|__SEOF)) /* Error on stream / EOF */
{
stream->incount=0;
errno=EPERM;
return EOF;
}
if(stream->flags&8)
if(stream->flags&__SWR)
{
if(__fflush(stream))
return EOF;
@@ -22,28 +22,28 @@ int __srget(FILE *stream) /* Get next input block */
if(--stream->incount>=0)
return *stream->p++;
}
if(stream->flags&0x200) /* Is a sscanf buffer */
if(stream->flags&__SSTR) /* it's a sscanf buffer */
return EOF;
if(stream->flags&3) /* Before reading from line- or unbuffered input file */
if(stream->flags&(__SNBF|__SLBF)) /* Before reading from line- or unbuffered input file */
{ /* fflush all line buffered output files (ANSI) */
struct filenode *fp=(struct filenode *)__filelist.mlh_Head;
while(fp->node.mln_Succ)
{
if((fp->FILE.flags&9)==9)
if((fp->FILE.flags&(__SWR|__SLBF))==(__SWR|__SLBF))
__fflush(&fp->FILE); /* Don't return EOF if this fails */
fp=(struct filenode *)fp->node.mln_Succ;
}
}
stream->flags|=4;
stream->flags|=__SRD;
stream->incount=read(stream->file,stream->buffer,stream->bufsize);
if(stream->incount==0) /* EOF found */
if(!stream->incount) /* EOF found */
{
stream->flags|=32;
stream->flags|=__SEOF;
return EOF;
}else if(stream->incount<0) /* Error */
{
stream->incount=0;
stream->flags|=64;
stream->flags|=__SERR;
return EOF;
}
stream->incount--;
+12 -8
View File
@@ -1,19 +1,23 @@
#include <stdio.h>
#include <stabs.h>
#include <stdlib.h>
#include <unistd.h>
#include "stabs.h"
static FILE *__files[3];
FILE **__sF=__files; /* stdin, stdout, stderr */
void __initstdfio(void)
{ FILE **f=__sF;
{ FILE **f=__sF, *err;
if((*f++=fopen((char *)1,NULL))!=NULL)
if((*f++=fopen((char *)2,NULL))!=NULL)
if((*f=fopen((char *)3,NULL))!=NULL)
return;
exit(20);
if(((*f++=fdopen(STDIN_FILENO,"r"))==NULL)||
((*f++=fdopen(STDOUT_FILENO,"w"))==NULL)||
((*f=err=fdopen(STDERR_FILENO,"w"))==NULL))
exit(20);
free(err->buffer);
err->flags&=~(__SMBF|__SLBF); err->flags|=__SNBF;
err->buffer=NULL;
}
/* Call our private constructor */
ADD2INIT(__initstdfio,-10);
ADD2INIT(__initstdfio,-20);
+10 -10
View File
@@ -2,24 +2,24 @@
#include <errno.h>
int __swbuf(int c,FILE *stream) /* Get next output block */
{
int out,lbs;
if(stream->flags&0x240) /* sprintf buffer | error on stream */
{ int out,lbs;
if(stream->flags&(__SSTR|__SERR)) /* sprintf buffer | error on stream */
{ stream->outcount=0;
errno=EPERM;
return EOF;
}else if(stream->flags&4)
}else if(stream->flags&__SRD)
{
stream->incount=0; /* throw away input buffer */
stream->tmpp=NULL;
stream->flags&=~4;
stream->flags&=~__SRD;
}
lbs=stream->flags&_IOLBF?-stream->bufsize:0;
out=(stream->flags&_IONBF?0:stream->bufsize-1)+lbs;
if(!(stream->flags&8)) /* File wasn't in write mode */
lbs=stream->flags&__SLBF?-stream->bufsize:0;
out=(stream->flags&__SNBF?0:stream->bufsize-1)+lbs;
if(!(stream->flags&__SWR)) /* File wasn't in write mode */
{ stream->p=stream->buffer; /* set buffer */
stream->outcount=--out; /* and buffercount */
stream->flags|=8; } /* and write mode */
stream->flags|=__SWR; } /* and write mode */
*stream->p++=c; /* put this character */
if(stream->outcount<0&&(stream->outcount<lbs||(char)c=='\n'))
{ if(__fflush(stream)) /* Buffer full */
@@ -28,6 +28,6 @@ int __swbuf(int c,FILE *stream) /* Get next output block */
}
stream->linebufsize=lbs;
stream->outcount=out;
stream->flags|=8;
stream->flags|=__SWR;
return c;
}
+1 -1
View File
@@ -1,4 +1,4 @@
#include <stdio.h>
void clearerr(FILE *stream)
{ stream->flags&=~96; }
{ stream->flags&=~(__SERR|__SEOF); }
+32
View File
@@ -0,0 +1,32 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <proto/exec.h>
FILE *fdopen(int filedes,const char *mode)
{ extern int _lx_addflags(int,int);
if (mode!=NULL)
{ struct filenode *node = (struct filenode *)calloc(1,sizeof(*node));
if(node!=NULL)
{ if((node->FILE.buffer=(char *)malloc(BUFSIZ))!=NULL)
{ node->FILE.bufsize=BUFSIZ;
node->FILE.file=filedes;
node->FILE.flags|=__SMBF; /* Buffer is malloc'ed */
if(isatty(filedes))
node->FILE.flags|=__SLBF; /* set linebuffered flag */
if(_lx_addflags(filedes,*mode=='a'?O_APPEND:0)&O_WRONLY)
node->FILE.flags|=__SWO; /* set write-only flag */
AddHead((struct List *)&__filelist,(struct Node *)&node->node);
return &node->FILE;
}
else
errno=ENOMEM;
free(node);
}
else
errno=ENOMEM;
}
return NULL;
}
+1 -3
View File
@@ -1,8 +1,6 @@
#include <stdio.h>
#ifdef feof
#undef feof
#endif
int feof(FILE *stream)
{ return (stream->flags&32)!=0; }
{ return (stream->flags&__SEOF)!=0; }
+1 -3
View File
@@ -1,8 +1,6 @@
#include <stdio.h>
#ifdef ferror
#undef ferror
#endif
int ferror(FILE *stream)
{ return (stream->flags&64)!=0; }
{ return (stream->flags&__SERR)!=0; }
+2 -3
View File
@@ -1,11 +1,10 @@
#include <stdio.h>
#include <exec/nodes.h>
#include <exec/lists.h>
int fflush(FILE *stream) /* fflush one or all files */
{
{ struct MinNode *node,*nextnode;
int retval;
struct MinNode *node,*nextnode;
if(stream!=NULL)
return __fflush(stream);
retval=0;
+4 -7
View File
@@ -1,15 +1,12 @@
#include <stdio.h>
char *fgets(char *s,int n,FILE *stream)
{
int c;
char *s2=s;
{ char *s2=s;
while(--n)
{
c=fgetc(stream);
{ int c=fgetc(stream);
if(c==EOF)
{
if(s2==s)
{ if(s2==s)
return NULL;
break;
}
+1 -3
View File
@@ -1,6 +1,4 @@
#include <stdio.h>
int fileno(FILE *file)
{
return file->file;
}
{ return file->file; }
+17 -28
View File
@@ -1,29 +1,24 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h> /* If you use normal file I/O,
the memory functions don't count that much on memory */
#include <debuglib.h>
#include <errno.h>
#include <proto/exec.h>
#include <exec/lists.h>
#include <exec/nodes.h>
#include <stabs.h>
#include <proto/exec.h>
#include "debuglib.h"
#include "stabs.h"
struct MinList __filelist= /* list of open files (fflush() needs also access) */
{
struct MinList __filelist = { /* list of open files (fflush() needs also access) */
(struct MinNode *)&__filelist.mlh_Tail,
NULL,
(struct MinNode *)&__filelist.mlh_Head
};
FILE *fopen(const char *filename,const char *mode)
{
struct filenode *node;
if((node=(struct filenode *)calloc(1,sizeof(struct filenode)))!=NULL)
{
if((node->FILE.buffer=(char *)malloc(BUFSIZ))!=NULL)
{
node->FILE.bufsize=BUFSIZ;
node->FILE.flags|=0x80; /* Buffer is malloc'ed */
{ struct filenode *node = (struct filenode *)calloc(1,sizeof(*node));
if(node!=NULL)
{ if((node->FILE.buffer=(char *)malloc(BUFSIZ))!=NULL)
{ node->FILE.bufsize=BUFSIZ;
node->FILE.flags|=__SMBF; /* Buffer is malloc'ed */
if(freopen(filename,mode,&node->FILE)!=NULL)
{ AddHead((struct List *)&__filelist,(struct Node *)&node->node);
return &node->FILE; }
@@ -39,18 +34,13 @@ FILE *fopen(const char *filename,const char *mode)
}
int fclose(FILE *stream)
{
int retval=0;
struct filenode *node;
if(stream==NULL)
{
#ifdef DEBUG_LIB
FATALERROR("NULL pointer fclose'd\n");
#endif
return EOF;
}
{ struct filenode *node;
int retval;
if(!stream)
{ DB( BUG("NULL pointer fclose'd\n"); )
return EOF; }
retval=freopen(NULL,NULL,stream)==NULL?EOF:0;
if(stream->flags&0x80) /* Free buffer if necessary */
if(stream->flags&__SMBF) /* Free buffer if necessary */
{ free(stream->buffer);
stream->buffer=NULL; }
node=(struct filenode *)((struct MinNode *)stream-1);
@@ -60,8 +50,7 @@ int fclose(FILE *stream)
}
void __exitstdfio(void)
{
struct MinNode *node;
{ struct MinNode *node;
while((node=__filelist.mlh_Head)->mln_Succ!=NULL)
fclose(&((struct filenode *)node)->FILE);
}
+1 -1
View File
@@ -24,7 +24,7 @@ int fread(void *ptr,size_t size,size_t nmemb,FILE *stream)
{
int c;
if((c=__srget(stream))==EOF)
break;
break;
*b++=c;
total--;
}
+41 -57
View File
@@ -1,81 +1,65 @@
#include <dos/dos.h>
#include <proto/dos.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
extern void __seterrno(void);
FILE *freopen(const char *filename,const char *mode,FILE *stream)
{ int error;
error=__fflush(stream);
if(stream->file>2)
{ close(stream->file);
if(stream->name!=NULL) /* file is temporary */
{ BPTR cd;
cd=CurrentDir(stream->tmpdir); /* cd t: */
if(!DeleteFile(stream->name)) /* delete file */
{ __seterrno();
error=1; }
free(stream->name); /* free filename */
stream->name=NULL;
UnLock(CurrentDir(cd)); /* cd back, unlock t: */
}
stream->file=0l;
{ int error=__fflush(stream);
close(stream->file);
if(stream->name!=NULL) /* file is temporary */
{ BPTR cd=CurrentDir(stream->tmpdir); /* cd t: */
if(!DeleteFile(stream->name)) /* delete file */
{ __seterrno();
error=1; }
free(stream->name); /* free filename */
stream->name=NULL;
UnLock(CurrentDir(cd)); /* cd back, unlock t: */
}
stream->file=0;
if(error)
return NULL;
if(filename!=NULL)
{ long file;
long flags=O_RDONLY;
int append=0,plus=1;
if(mode!=NULL)
{ switch(mode[0])
{
case 'r':
break;
case 'w':
flags=O_WRONLY|O_CREAT|O_TRUNC;
break;
case 'a':
flags=O_WRONLY|O_CREAT;
append=1;
break;
default:
{ long file,flags=O_RDONLY;
char ch;
if(mode==NULL)
return NULL;
if(ch=*mode++,ch!='r')
if(flags=O_WRONLY|O_CREAT|O_TRUNC,ch!='w')
if(flags=O_WRONLY|O_CREAT|O_APPEND,ch!='a')
return NULL;
}
if(mode[1]=='b')
plus=2;
switch(mode[plus])
{
case '+':
flags=(flags&~O_ACCMODE)|O_RDWR;
if(mode[plus+1])
return NULL;
break;
case '\0':
break;
default:
if((ch=*mode++))
{ if(ch=='+')
{ if((ch=*mode++) && (ch!='b'||*mode))
return NULL;
}
flags=(flags&~O_ACCMODE)|O_RDWR; }
else if(ch!='b')
return NULL;
else if((ch=*mode++))
{ if(ch!='+'||*mode)
return NULL;
flags=(flags&~O_ACCMODE)|O_RDWR; }
}
if((long)filename<4)
file=(long)filename-1;
else
if((file=open(filename,flags,0777))<0)
return NULL;
if(append&&lseek(file,0,SEEK_END)<0)
if((file=open(filename,flags,0777))<0)
return NULL;
stream->flags&=~0x6f; /* clear a lot of flags */
if(flags&O_APPEND)
(void)lseek(file,0,SEEK_END);
/* clear a lot of flags */
stream->flags&=~(__SWO|__SERR|__SEOF|__SWR|__SRD|__SNBF|__SLBF);
if(flags&O_WRONLY)
stream->flags|=__SWO; /* set write-only flag */
if(isatty(file))
stream->flags|=1; /* set linebuffered flag */
stream->flags|=__SLBF; /* set linebuffered flag */
stream->file=file;
}
+5 -7
View File
@@ -4,21 +4,19 @@
int fseek(FILE *stream,long int offset,int whence)
{
if(stream->flags&64) /* Error on stream */
if(stream->flags&__SERR) /* Error on stream */
{ errno=EPERM;
return EOF; }
if(stream->flags&8)
if(stream->flags&__SWR)
if(__fflush(stream))
return EOF;
if(whence==SEEK_CUR)
offset-=stream->incount+(stream->tmpp!=NULL?stream->tmpinc:0);
stream->incount=0;
stream->tmpp=NULL;
stream->flags&=~36;
stream->flags&=~(__SEOF|__SRD);
if(lseek(stream->file,offset,whence)==EOF)
{
stream->flags|=64;
return EOF;
}
{ stream->flags|=__SERR;
return EOF; }
return 0;
}
+1 -2
View File
@@ -1,5 +1,4 @@
#include <stdio.h>
int fgetpos(FILE *stream,fpos_t *pos)
{ *pos=ftell(stream);
return 0; }
{ *pos=ftell(stream); return 0; }
+5 -6
View File
@@ -3,17 +3,16 @@
#include <unistd.h>
long ftell(FILE *stream)
{
long pos;
if(stream->flags&64) /* Error on stream */
{ long pos;
if(stream->flags&__SERR) /* Error on stream */
{ errno=EPERM;
return EOF; }
if((pos=lseek(stream->file,0,SEEK_CUR))==EOF)
{ stream->flags|=64;
{ stream->flags|=__SERR;
return pos; }
if(stream->flags&4)
if(stream->flags&__SRD)
pos-=stream->incount+(stream->tmpp!=NULL?stream->tmpinc:0);
else if(stream->flags&8)
else if(stream->flags&__SWR)
pos+=stream->p-stream->buffer;
return pos;
}
+1 -1
View File
@@ -25,7 +25,7 @@ int fwrite(const void *ptr,size_t size,size_t nmemb,FILE *stream)
int c;
c=*b++;
if(putc(c,stream)==EOF)
break;
break;
total--;
}
}while(total);
+4 -7
View File
@@ -1,15 +1,12 @@
#include <stdio.h>
char *gets(char *s)
{
int c;
char *s2=s;
{ char *s2=s;
for(;;)
{
c=fgetc(stdin);
{ int c=fgetc(stdin);
if(c==EOF)
{
if(s2==s)
{ if(s2==s)
return NULL;
break;
}

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