mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Compare commits
93 Commits
BEFORE_CON
...
V1_193
| Author | SHA1 | Date | |
|---|---|---|---|
| 1aadee2d9d | |||
| 6a13b08f40 | |||
| 59807dbff1 | |||
| 414e07aa20 | |||
| 2a22c4ff0d | |||
| 576660ca0a | |||
| 5451d3a694 | |||
| c26da2c5e8 | |||
| c3975b1e6e | |||
| a79b05194d | |||
| 3975d234bd | |||
| 3c220c3939 | |||
| 49e98713d4 | |||
| 505c23237a | |||
| ffeb475873 | |||
| c3a10b88b5 | |||
| 2ced1d3293 | |||
| fb4dae84aa | |||
| a03ced93b0 | |||
| a19d60f524 | |||
| f6d20fee01 | |||
| d4aa0b04af | |||
| df05c80c57 | |||
| a1ffc20864 | |||
| 13c857ba0a | |||
| 5ecfdf33c6 | |||
| fa31c468dc | |||
| feb29fa334 | |||
| d0a4e057bc | |||
| c5087c78ce | |||
| c5c6492868 | |||
| 539cc3553d | |||
| bc65dd2877 | |||
| ec027fa510 | |||
| 65484eac3c | |||
| 2be60de3e7 | |||
| 89b568bcb8 | |||
| 2548af2b4b | |||
| a1b39c4d01 | |||
| 9e32991a6d | |||
| c8d29ea9c1 | |||
| 28f561c61b | |||
| 07056f3e26 | |||
| 3bd6766484 | |||
| e01d58319d | |||
| ec4fd3c2cb | |||
| df89c636db | |||
| 90a192134e | |||
| 3660b26c9f | |||
| 9f3d5e50b4 | |||
| 876039440f | |||
| 0c553faff1 | |||
| 1d611fefbe | |||
| a50aba0b64 | |||
| 2e9ac7d003 | |||
| 0a440c8405 | |||
| f63a0788d5 | |||
| 431dd488a1 | |||
| 15c16efd07 | |||
| 6e39efe7d7 | |||
| 92cc3e9a79 | |||
| a18f415374 | |||
| 3096691d75 | |||
| d5c36d66e4 | |||
| 7f9fbc453b | |||
| 6f010ddf87 | |||
| 09b52e077f | |||
| 9c2c44b008 | |||
| df01f27551 | |||
| 58d26ce8cb | |||
| b1ac45a0b9 | |||
| aafda37c84 | |||
| 3eb15a612f | |||
| 590d1b8eec | |||
| 1fbe4bd0a5 | |||
| 8edfcc3f86 | |||
| a6daababe7 | |||
| 5695784272 | |||
| 5eefcf4555 | |||
| d85d6648ea | |||
| c471c50784 | |||
| cd10dc9a1a | |||
| 7d3ea7fae6 | |||
| ead29c1850 | |||
| f492e6a6c0 | |||
| dc80018239 | |||
| 966851e8bd | |||
| a60623bbc6 | |||
| d8bf652ae6 | |||
| b048323196 | |||
| 08cc54d3fa | |||
| 419172fb0e | |||
| f289140266 |
@ -1,13 +0,0 @@
|
||||
# The "checkoutlist" file is used to support additional version controlled
|
||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
||||
#
|
||||
# The first entry on a line is a filename which will be checked out from
|
||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
||||
# The remainder of the line is an error message to use if the file cannot
|
||||
# be checked out.
|
||||
#
|
||||
# File format:
|
||||
#
|
||||
# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line>
|
||||
#
|
||||
# comment lines begin with '#'
|
||||
@ -1,15 +0,0 @@
|
||||
# The "commitinfo" file is used to control pre-commit checks.
|
||||
# The filter on the right is invoked with the repository and a list
|
||||
# of files to check. A non-zero exit of the filter program will
|
||||
# cause the commit to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@ -1,21 +0,0 @@
|
||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
||||
#SystemAuth=no
|
||||
|
||||
# Put CVS lock files in this directory rather than directly in the repository.
|
||||
#LockDir=/var/lock/cvs
|
||||
|
||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
||||
# level of the new working directory when using the `cvs checkout'
|
||||
# command.
|
||||
#TopLevelAdmin=no
|
||||
|
||||
# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the
|
||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
||||
#LogHistory=TOEFWUPCGMAR
|
||||
|
||||
# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg
|
||||
# script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra
|
||||
# second per directory being committed, so it is not recommended for large
|
||||
# repositories. Set it to `never' (the previous CVS behavior) to prevent
|
||||
# verifymsg scripts from changing the log message.
|
||||
#RereadLogAfterVerify=always
|
||||
@ -1,19 +0,0 @@
|
||||
# This file affects handling of files based on their names.
|
||||
#
|
||||
# The -m option specifies whether CVS attempts to merge files.
|
||||
#
|
||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
||||
#
|
||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
||||
#
|
||||
# wildcard [option value][option value]...
|
||||
#
|
||||
# where option is one of
|
||||
# -f from cvs filter value: path to filter
|
||||
# -t to cvs filter value: path to filter
|
||||
# -m update methodology value: MERGE or COPY
|
||||
# -k expansion mode value: b, o, kkv, &c
|
||||
#
|
||||
# and value is a single-quote delimited value.
|
||||
# For example:
|
||||
#*.gif -k 'b'
|
||||
@ -1,21 +0,0 @@
|
||||
# The "editinfo" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@ -1,27 +0,0 @@
|
||||
# The "loginfo" file controls where "cvs commit" log information
|
||||
# is sent. The first entry on a line is a regular expression which must match
|
||||
# the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
||||
# program that should expect log information on its standard input.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name ALL appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or DEFAULT.
|
||||
#
|
||||
# You may specify a format string as part of the
|
||||
# filter. The string is composed of a `%' followed
|
||||
# by a single format character, or followed by a set of format
|
||||
# characters surrounded by `{' and `}' as separators. The format
|
||||
# characters are:
|
||||
#
|
||||
# s = file name
|
||||
# V = old version number (pre-checkin)
|
||||
# v = new version number (post-checkin)
|
||||
# t = tag or branch name
|
||||
#
|
||||
# For example:
|
||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
# or
|
||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
||||
@ -1,26 +0,0 @@
|
||||
# Three different line formats are valid:
|
||||
# key -a aliases...
|
||||
# key [options] directory
|
||||
# key [options] directory files...
|
||||
#
|
||||
# Where "options" are composed of:
|
||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
||||
# -o prog Run "prog" on "cvs checkout" of module.
|
||||
# -e prog Run "prog" on "cvs export" of module.
|
||||
# -t prog Run "prog" on "cvs rtag" of module.
|
||||
# -u prog Run "prog" on "cvs update" of module.
|
||||
# -d dir Place module in directory "dir" instead of module name.
|
||||
# -l Top-level directory only -- do not recurse.
|
||||
#
|
||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
||||
# release and re-checkout any working directories of these modules.
|
||||
#
|
||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
||||
#
|
||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
||||
# everything on the right of the "-a" had been typed on the command line.
|
||||
#
|
||||
# You can encode a module within a module by using the special '&'
|
||||
# character to interpose another module into the current module. This
|
||||
# can be useful for creating a module that consists of many directories
|
||||
# spread out over the entire source repository.
|
||||
@ -1,12 +0,0 @@
|
||||
# The "notify" file controls where notifications from watches set by
|
||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
||||
# a regular expression which is tested against the directory that the
|
||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
||||
# then the remainder of the line is a filter program that should contain
|
||||
# one occurrence of %s for the user to notify, and information on its
|
||||
# standard input.
|
||||
#
|
||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
||||
#
|
||||
# For example:
|
||||
#ALL mail -s "CVS notification" %s
|
||||
@ -1,13 +0,0 @@
|
||||
# The "rcsinfo" file is used to control templates with which the editor
|
||||
# is invoked on commit and import.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being made to, relative to the
|
||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
||||
# line is the name of the file that contains the template.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@ -1,20 +0,0 @@
|
||||
# The "taginfo" file is used to control pre-tag checks.
|
||||
# The filter on the right is invoked with the following arguments:
|
||||
#
|
||||
# $1 -- tagname
|
||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
||||
# $3 -- repository
|
||||
# $4-> file revision [file revision ...]
|
||||
#
|
||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
||||
#
|
||||
# The first entry on a line is a regular expression which is tested
|
||||
# against the directory that the change is being committed to, relative
|
||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
||||
# of the line is the name of the filter to run.
|
||||
#
|
||||
# If the repository name does not match any of the regular expressions in this
|
||||
# file, the "DEFAULT" line is used, if it is specified.
|
||||
#
|
||||
# If the name "ALL" appears as a regular expression it is always used
|
||||
# in addition to the first matching regex or "DEFAULT".
|
||||
@ -1,21 +0,0 @@
|
||||
# The "verifymsg" file is used to allow verification of logging
|
||||
# information. It works best when a template (as specified in the
|
||||
# rcsinfo file) is provided for the logging procedure. Given a
|
||||
# template with locations for, a bug-id number, a list of people who
|
||||
# reviewed the code before it can be checked in, and an external
|
||||
# process to catalog the differences that were code reviewed, the
|
||||
# following test can be applied to the code:
|
||||
#
|
||||
# Making sure that the entered bug-id number is correct.
|
||||
# Validating that the code that was reviewed is indeed the code being
|
||||
# checked in (using the bug-id number or a seperate review
|
||||
# number to identify this particular code set.).
|
||||
#
|
||||
# If any of the above test failed, then the commit would be aborted.
|
||||
#
|
||||
# Actions such as mailing a copy of the report to each reviewer are
|
||||
# better handled by an entry in the loginfo file.
|
||||
#
|
||||
# One thing that should be noted is the the ALL keyword is not
|
||||
# supported. There can be only one entry that matches a given
|
||||
# repository.
|
||||
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE html public "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Notes on building the library</title>
|
||||
<body>
|
||||
|
||||
<h1>Notes on building the library</h1>
|
||||
|
||||
<p>In order to build the library, you need a 'C' compiler (obvious, isn't it?) and
|
||||
a set of header files for the networking API definitions. The networking header
|
||||
files go into a directory <tt>netinclude</tt> which has to sit in the same directory as
|
||||
the source code and the <tt>include</tt> directory you find in there. I'm not currently
|
||||
supplying these header files here. Drop me a line, and I'll take care of that.</p>
|
||||
|
||||
<p>The SAS/C flavour (<tt>smakefile</tt>) should get the library built using the "large data"
|
||||
model. This rules out the use of residentable programs as the startup code I'm
|
||||
using is very primitive (<tt>startup.o</tt>) and doesn't tinker with A4 relative data
|
||||
addressing (and how this may be set up).</p>
|
||||
|
||||
<p>There are two makefiles for GCC, each a different flavour. There is <tt>GNUmakefile.68k</tt>,
|
||||
which will build the library for GCC on the 68k platform ("classic" Amiga). This
|
||||
builds all variants of the library, for large data, small data, resident, whatever
|
||||
model. It's a lot of work and I don't recommend you do this on a plain 68k machine.
|
||||
It will literally (!) take hours. The other makefile flavour is for AmigaOS4 using
|
||||
the PowerPC hosted GCC system (<tt>GNUmakefile.os4</tt>). This builds only the large data
|
||||
version of the library, but this is usually all you need. Small data support is
|
||||
currently not implemented but might follow in the future.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,67 +0,0 @@
|
||||
<!DOCTYPE html public "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Notes on using the library with Amiga GCC (68k)</title>
|
||||
<body>
|
||||
|
||||
<h1>Notes on using the library with Amiga GCC (68k)</h1>
|
||||
|
||||
<p>You can use the 68k build of clib2 with the existing Amiga 68k ports of the
|
||||
GNU 'C' compiler. In order to do so, you need to modify the <tt>specs</tt> file which
|
||||
controls how the compiler(s) and the linker interact, and where the linker
|
||||
will look for the program startup code and library files. Also, you will need
|
||||
to copy the header files, startup code and library files to the locations
|
||||
where the 'C' compiler and linker expects them.</p>
|
||||
|
||||
<p>Please read the following description before you follow the instructions. The
|
||||
changes suggested may have unexpected side-effects!</p>
|
||||
|
||||
<p>I have provided a working <tt>specs</tt> file with this documentation file. To switch
|
||||
over an existing Amiga 68k port of GCC to use clib2, you would proceed as
|
||||
follows:</p>
|
||||
|
||||
<ul>
|
||||
<li> Locate the directory within which GCC is installed. For example, this
|
||||
could be within a directory to which the name <tt>ADE:</tt>, <tt>GG:</tt> or <tt>GCC:</tt>
|
||||
is assigned. For the sake of simplicity, the following notes assume
|
||||
that the assignment name is <tt>GCC:</tt>
|
||||
|
||||
<li> Make backup copies of the following directories and files:
|
||||
<ol>
|
||||
<li> <tt>GCC:lib/gcc-lib/amigaos/2.95.3/specs</tt><br>
|
||||
|
||||
<p>(NOTE: Check the directory called <tt>GCC:lib/gcc-lib/amigaos</tt>
|
||||
first; the "2.95.3" quoted above refers to the version,
|
||||
revision and patch number of the GCC installed and your
|
||||
version number may differ!)</p>
|
||||
|
||||
<li> <tt>GCC:include</tt>
|
||||
<li> <tt>GCC:lib</tt>
|
||||
|
||||
</ol>
|
||||
|
||||
<li> Now you can proceed to install clib2; just copy the <tt>include</tt> and <tt>lib</tt>
|
||||
directories over, like this:
|
||||
<ol>
|
||||
<li><kbd>Copy include GCC:include all quiet</kbd>
|
||||
<li><kbd>Copy lib GCC:lib all quiet</kbd>
|
||||
</ol>
|
||||
|
||||
<li> Finally, replace the <tt>specs</tt> file with the one provided:
|
||||
<ol>
|
||||
|
||||
<li> <kbd>Copy specs GCC:lib/gcc-lib/amigaos/2.95.3/specs</kbd><br>
|
||||
|
||||
<p>(NOTE: Check the directory called <tt>GCC:lib/gcc-lib/amigaos</tt>
|
||||
first; the "2.95.3" quoted above refers to the version,
|
||||
revision and patch number of the GCC installed and your
|
||||
version number may differ!)</p>
|
||||
</ol>
|
||||
</ul>
|
||||
|
||||
<p>Once you have completed these steps you should be able to build programs using
|
||||
the 68k build of clib2 and you currently installed GCC. Note that these
|
||||
changes may have the effect of rendering your C++ compiler unusable, so make
|
||||
sure that you've made backup copies of all files and directories first!</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,250 +0,0 @@
|
||||
<!DOCTYPE html public "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>An ISO 'C' (1994) compliant runtime library for the Amiga</title>
|
||||
<body>
|
||||
|
||||
<h1>An ISO 'C' (1994) compliant runtime library for the Amiga</h1>
|
||||
|
||||
<h2>1. What is this?</h2>
|
||||
|
||||
<p>This is my attempt to get Samba 2.2.x ported to the Amiga. My first Amiga
|
||||
port required SAS/C and a number of strange tricks had to be pulled to get
|
||||
it to support the kind of environment Samba needed. But with the
|
||||
introduction of Samba 2.2.x many of those tricks did not work any more,
|
||||
which is why I decided to attack the problem at the root, namely the
|
||||
runtime library.</p>
|
||||
|
||||
<p>Because it was no longer possible to build Samba with SAS/C on the new
|
||||
Amiga platform, the idea came up to move development to the GNU 'C'
|
||||
compiler. This turned out to be a challenge due to its somewhat
|
||||
underdeveloped runtime library and header files. Eventually, I decided to
|
||||
rewrite that library from scratch.</p>
|
||||
|
||||
|
||||
<h2>2. What does it do?</h2>
|
||||
|
||||
<p>Using <i>'C' - A reference manual</i> (4th edition) as a reference I wrote a set of
|
||||
header files, then proceeded to implement each single function referenced in
|
||||
them. With few exceptions in the area of wide character support, the result
|
||||
should be a feature complete implementation of the ISO 'C' (1994) runtime
|
||||
library.</p>
|
||||
|
||||
<p>Because Samba needs a few POSIX-like routines to be supported, the library
|
||||
functionality is complemented by a set of routines described in <i>Advanced
|
||||
programming in the Unix environent</i>.</p>
|
||||
|
||||
<p>This is not a portable implementation of the library in the sense that you
|
||||
could move it from one 'C' compiler on one operating system to another.
|
||||
This is an Amiga specific implementation.</p>
|
||||
|
||||
<p>The library supports floating point math, which, for the 68k platform, is
|
||||
limited to IEEE single and double precision or M68881 inline math. There is no
|
||||
support for the fast floating point (FFP) format or exclusive IEEE single
|
||||
precision. You either get double precision (IEEE math) or extended precision
|
||||
(M68881 inline math). What it is that you get is determined at compile time.
|
||||
Use the <tt>IEEE_FLOATING_POINT_SUPPORT</tt> preprocessor symbol to activate IEEE math
|
||||
code and the <tt>M68881_FLOATING_POINT_SUPPORT</tt> symbol for M68881 inline math.</p>
|
||||
|
||||
<p>For the PowerPC platform, the library uses code borrowed from fdlibm 5.3,
|
||||
which is a portable library of arithmetic functions developed by Sun
|
||||
Microsystems which, for example, is also used within the Java platform.</p>
|
||||
|
||||
<p>Not unlike SAS/C, you can configure a minimum stack size the program is to use
|
||||
when it starts up. This is controlled via the <tt>__stack_size</tt> variable (see
|
||||
<tt>stdlib_main.c</tt>).</p>
|
||||
|
||||
<p>I added some <tt>amiga.lib</tt> and <tt>debug.lib</tt> functionality to the library, but don't
|
||||
count on it to be complete.</p>
|
||||
|
||||
<p>The library code is supposed to be thread-safe if built with the <tt>__THREAD_SAFE</tt>
|
||||
preprocesssor symbold defined. Note that 'thread-safe' does <em>not</em> mean
|
||||
'reentrant'. Multiple callers for certain library functions are permitted, but
|
||||
not for all of them. For example, <tt>mkdtemp()</tt> is not thread-safe, and neither is
|
||||
<tt>rand()</tt> or <tt>localtime()</tt>. But as per POSIX 1003.1c-1995 there are thread-safe
|
||||
variants of <tt>rand()</tt> and <tt>localtime()</tt> called <tt>rand_r()</tt>, <tt>localtime_r()</tt>, and others.
|
||||
The use of the socket I/O functions is still problematic because the
|
||||
underlying <tt>bsdsocket.library</tt> API is not supposed to be used by any process
|
||||
other than the one that opened it. Also yet unsolved is the issue of reading
|
||||
error codes from the <tt>errno</tt> variable which currently always contains the
|
||||
error code left by the last caller.</p>
|
||||
|
||||
<p>Take care: thread-safety does not imply that you can have multiple callers
|
||||
access and close the same file. There is no resource tracking to that degree
|
||||
yet. All the thread-safety tries to afford you is not to get into big trouble
|
||||
if simultaneous and overlapping accesses to files, memory allocation and other
|
||||
resources are taking place.</p>
|
||||
|
||||
|
||||
<h2>3. What does it not do?</h2>
|
||||
|
||||
<p>This library is a departure from the typical 'C' runtime environments of the
|
||||
past which had to run on all AmigaOS releases, down to Kickstart 1.1. This
|
||||
very library was designed to take advantage of the routines available since
|
||||
Kickstart 2.04 was introduced and virtually nobody ever put to use. This helps
|
||||
to cut the code size, and it also helps to keep bugs out of the library by
|
||||
falling back onto well-tested implementations. However, the catch is that the
|
||||
code won't run under Kickstart 1.3 and below. But then these operating system
|
||||
releases have been obsolete for more than a decade, and you can always go back
|
||||
to a compiler environment which supports them.</p>
|
||||
|
||||
<p>There is very little support for <tt>amiga.lib</tt> functionality. There is <tt>NewList()</tt>,
|
||||
<tt>HookEntry()</tt>, <tt>CallHook()</tt>, <tt>CallHookA()</tt>, the <tt>DoMethod()</tt> family, the RexxVars
|
||||
family, but that's all. If you need more, you would have to implement it
|
||||
yourself. Put another way, if you absolutely need functionality that is only
|
||||
found in <tt>amiga.lib</tt>, you really shouldn't need in in the first place.</p>
|
||||
|
||||
|
||||
<h2>4. Where does the source code come from?</h2>
|
||||
|
||||
<p>I originally thought that it might be helpful to piece this library together
|
||||
from various sources, such as the BSD libc. Turned out that this code was so
|
||||
'portable' that it became much more complex than it ought to be. Also, some
|
||||
side-effects were present which considerably changed the behaviour of the
|
||||
library. For example, the BSD libc uses <tt>bcopy()</tt> as an alias for <tt>memcpy()</tt>, and
|
||||
unlike <tt>memcpy()</tt> is documented to, <tt>bcopy()</tt> supports overlapping copies.</p>
|
||||
|
||||
<p>Eventually, I wrote virtually all the code myself, borrowing algorithmic ideas
|
||||
from the BSD libc and the Manx Aztec 'C' runtime library. Because I don't know
|
||||
much about the environment GCC expects, I borrowed code snippets from libnix,
|
||||
which was written by Matthias Fleischer and Gunther Nikl. This in particular
|
||||
concerns the integer and floating point math support, the <tt>setjmp</tt>/<tt>longjmp</tt>
|
||||
routines and the startup code. The M68881 inline math code comes from the
|
||||
<tt><math-68881.h></tt> file written by Matthew Self <tt>(self@bayes.arc.nasa.gov)</tt>.</p>
|
||||
|
||||
|
||||
<h2>5. Limitations and caveats</h2>
|
||||
|
||||
<p>There is hardly any documentation on the code I wrote. In part this is due to
|
||||
the fact that the code itself is very simple in design. It should speak for
|
||||
itself. However, to make a usable runtime library you have to have a user
|
||||
documentation as in man pages or autodocs. We will eventually have to have
|
||||
autodocs for this library.</p>
|
||||
|
||||
<p>The code is currently plastered with assertions and debug code. It is
|
||||
therefore much larger than it ought to be and runs much slower than it ought
|
||||
to be. For example, the <tt>malloc()</tt> routine will set the contents of the memory
|
||||
allocated to a 'dirty' bit pattern which is likely to break software which
|
||||
makes assumptions about its contents. Likewise, the <tt>free()</tt> routine will trash
|
||||
the memory to deallocate with a different 'dirty' bit pattern to turn up reuse
|
||||
of memory after deallocation. All these debugging features can be disabled by
|
||||
defining the <tt>NDEBUG</tt> preprocessor symbol at compile time (see <tt><assert.h></tt>).</p>
|
||||
|
||||
<p>The exception handling in the math code is not particularly effective. For one
|
||||
part this is due to the fact that there is no exception handler installed by
|
||||
the runtime library when it starts up which could catch and process the error
|
||||
conditions the CPU or FPU generates. The idea was to provide for a portable
|
||||
runtime library with little to no assembly language involved. To make the
|
||||
exception handling complete, such code would be necessary.</p>
|
||||
|
||||
<p>The library currently builds under SAS/C, but because the 'normal' program
|
||||
startup code is not utilized, the base relative (A4) addressing does not work.
|
||||
If you are going to test it, use the <tt>data=faronly</tt> option to compile the
|
||||
library and the programs.</p>
|
||||
|
||||
<p>Different build makefiles are supplied for use with GCC. There is
|
||||
<tt>GNUmakefile.68k</tt> for the 68k platform and <tt>GNUmakefile.os4</tt> for the AmigaOS4
|
||||
PowerPC version.</p>
|
||||
|
||||
|
||||
<h2>6. Conventions and design issues</h2>
|
||||
|
||||
<p>You will have noticed the 330+ files in this directory. This is not the best
|
||||
way to organize a runtime library, but at least all the bits and pieces are in
|
||||
plain sight. Each file stands for the one or two routines it contains. The
|
||||
name indicates what routine(s) that might be. Each file name is prefixed by
|
||||
the name of the header file in which the corresponding routine is defined. So,
|
||||
for example, you will find that <tt>unistd_lchown.c</tt> contains the definition of
|
||||
the <tt>lchown()</tt> routine, which has its prototype defined in the <tt><unistd.h></tt> header
|
||||
file.</p>
|
||||
|
||||
<p>Internal function and variables which need to be visible across several
|
||||
modules have names prefixed with two underscores, as in <tt>__stdio_init()</tt>.</p>
|
||||
|
||||
<p>All routines attempt to do error checking on their parameters. They will
|
||||
either drop into an <tt>assert()</tt> or set an errno value and refuse to go any
|
||||
further. This cuts performance but should help to catch the simple bugs quite
|
||||
easily (<tt>NULL</tt> pointers).</p>
|
||||
|
||||
<p>Just like any halfway sane Amiga 'C' runtime library, this one performs its <tt>^C</tt>
|
||||
checking in the I/O routines. Typically once upon entry and in every iteration
|
||||
of the loop there might be it will quickly poll the <tt>^C</tt> signal and drop into
|
||||
<tt>raise(SIGINT)</tt> in case the signal is set. This is just about the safest method
|
||||
to solve the problem and should be much more robust than the ixemul approach
|
||||
of 'interrupt anywhere - crash anywhere' using the task switch/launch hooks to
|
||||
test for signals.</p>
|
||||
|
||||
<p>By default all library routines follow the ISO 'C' conventions in that where
|
||||
implementation defined behaviour is permitted, the AmigaOS rules are followed.
|
||||
For example, <tt>unlink()</tt> will by default operate like <tt>DeleteFile()</tt> and <tt>rename()</tt>
|
||||
will return with an error code set if the name of the file/directory to be
|
||||
renamed would collide with an existing directory entry. However, your program
|
||||
can set a global variable <tt>__unix_semantics</tt> which will cause some routines to
|
||||
perform like their Unix counterparts. This is necessary for Samba to work but
|
||||
not a generally desirable feature. You have some Unix-like behaviour, but the
|
||||
environment itself is not completely Unix- or POSIX-compliant. And it
|
||||
shouldn't be. Don't make the mistake of trying to mold the environment into a
|
||||
POSIX emulation. It doesn't work; AmigaOS is not Unix.</p>
|
||||
|
||||
|
||||
<h2>7. The startup code</h2>
|
||||
|
||||
<p>There are three program startup files provided. The most simplistic is in
|
||||
<tt>startup.c</tt> which I use for SAS/C. It just invokes the setup routine which
|
||||
eventually calls <tt>main()</tt> and drops straight into <tt>exit()</tt>.</p>
|
||||
|
||||
<p>The <tt>ncrt0.S</tt> file was adapted from the libnix startup code which sets up the
|
||||
base relative data area, if necessary (the <tt>SMALL_DATA</tt> preprocessor symbol must
|
||||
be defined).</p>
|
||||
|
||||
<p>The <tt>nrcrt0.S</tt> file was adapted from libnix startup code, too, and sets up the
|
||||
base relative data area for programs to be made resident. Note that the
|
||||
<tt>geta4()</tt> stub is missing here; it wouldn't work in a resident program anyway.</p>
|
||||
|
||||
<p>The <tt>ncrt0.S</tt> and <tt>nrcrt0.S</tt> files are considerably smaller and less complex than
|
||||
the libnix code they are based on. This is because in this library design all
|
||||
the more complex tasks are performed in the <tt>stdlib_main.c</tt> file rather than in
|
||||
assembly language.</p>
|
||||
|
||||
|
||||
<h2>8. Documentation</h2>
|
||||
|
||||
<p>Well, you're reading it. There isn't anything much yet. You can consult the book
|
||||
<i>'C' - A reference manual</i> and you could look at the
|
||||
<a href="http://www.opengroup.org/onlinepubs/007904975">Open Group's Single Unix
|
||||
Specification</a>.</p>
|
||||
|
||||
|
||||
<h2>9. Legal status</h2>
|
||||
|
||||
<p>Because this library is in part based upon free software it would be
|
||||
uncourteous not to make it free software itself. The BSD license would
|
||||
probably be appropriate here.</p>
|
||||
|
||||
<p>The PowerPC math library is based in part on work by Sun Microsystems:</p>
|
||||
|
||||
<pre>
|
||||
====================================================
|
||||
Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
||||
|
||||
Developed at SunPro, a Sun Microsystems, Inc. business.
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software is freely granted, provided that this notice
|
||||
is preserved.
|
||||
====================================================
|
||||
</pre>
|
||||
|
||||
<h2>10. Contacting the author</h2>
|
||||
|
||||
<p>The basic work was done by Olaf Barthel during two weeks in July 2002. You
|
||||
can reach me at:</p>
|
||||
|
||||
<p>Olaf Barthel<br>
|
||||
Gneisenaustr. 43<br>
|
||||
D-31275 Lehrte<br></p>
|
||||
|
||||
<p>Or via e-mail:</p>
|
||||
|
||||
<p>olsen@sourcery.han.de</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,64 +0,0 @@
|
||||
*asm:
|
||||
%{m68000:-mc68010} %{mc68000:-mc68010} %{m68020:-mc68020} %{mc68020:-mc68020} %{m68030:-mc68030} %{m68040:-mc68040} %{m68060:-mc68060} %{m68020-40:-mc68020} %{m68020-60:-mc68020} %{!mc68000:%{!m68000:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68060:%{!m68020-40:%{!m68020-60:-mc68010}}}}}}}}} %{msmall-code:-sc}
|
||||
|
||||
*asm_final:
|
||||
|
||||
|
||||
*cpp:
|
||||
%{m68881:-D__HAVE_68881__} %{!ansi:%{m68020:-Dmc68020} %{mc68020:-Dmc68020} %{m68020-40:-Dmc68020} %{m68020-60:-Dmc68020} %{m68030:-Dmc68030} %{m68040:-Dmc68040} %{m68060:-Dmc68060}} %{m68020:-D__mc68020__ -D__mc68020} %{mc68020:-D__mc68020__ -D__mc68020} %{m68020-40:-D__mc68020__ -D__mc68020} %{m68020-60:-D__mc68020__ -D__mc68020} %{m68030:-D__mc68030__ -D__mc68030} %{m68040:-D__mc68040__ -D__mc68040} %{m68060:-D__mc68060__ -D__mc68060}
|
||||
|
||||
*cc1:
|
||||
%{resident:-fbaserel} %{resident32:-fbaserel32} %{msmall-code:-fno-function-cse}
|
||||
|
||||
*cc1plus:
|
||||
|
||||
|
||||
*endfile:
|
||||
|
||||
|
||||
*link:
|
||||
%{fbaserel:%{!resident:-m amiga_bss -fl libb}} %{resident:-m amiga_bss -amiga-datadata-reloc -fl libb} %{fbaserel32:%{!resident32:-m amiga_bss -fl libb32}} %{resident32:-m amiga_bss -amiga-datadata-reloc -fl libb32} %{g:-amiga-debug-hunk} %{m68020:-fl libm020} %{mc68020:-fl libm020} %{m68030:-fl libm020} %{m68040:-fl libm020} %{m68060:-fl libm020} %{m68020-40:-fl libm020} %{m68020-60:-fl libm020} %{m68881:-fl libm881}
|
||||
|
||||
*lib:
|
||||
%{mstackextend:-lstack} -lc -lamiga -ldebug -lgcc -lc
|
||||
|
||||
*libgcc:
|
||||
|
||||
|
||||
*startfile:
|
||||
%{resident32:nr32crt0.o%s mainb32.o%s}%{!resident32:%{fbaserel32:nb32crt0.o%s mainb32.o%s}%{!fbaserel32:%{resident:nrcrt0.o%s mainb.o%s}%{!resident:%{fbaserel:nbcrt0.o%s mainb.o%s}%{!fbaserel:ncrt0.o%s mainnb.o%s}}}}
|
||||
|
||||
*switches_need_spaces:
|
||||
|
||||
|
||||
*signed_char:
|
||||
%{funsigned-char:-D__CHAR_UNSIGNED__}
|
||||
|
||||
*predefines:
|
||||
-Dmc68000 -Damiga -Damigaos -DMCH_AMIGA -DAMIGA -D__chip=__attribute__((__chip__)) -D__saveds=__attribute__((__saveds__)) -D__interrupt=__attribute__((__interrupt__)) -D__stackext=__attribute__((__stackext__)) -D__regargs=__attribute__((__regparm__)) -D__stdargs=__attribute__((__stkparm__)) -D__aligned=__attribute__((__aligned__(4))) -Asystem(amigaos) -Acpu(m68k) -Amachine(m68k)
|
||||
|
||||
*cross_compile:
|
||||
0
|
||||
|
||||
*version:
|
||||
2.95.3
|
||||
|
||||
*multilib:
|
||||
. ;
|
||||
|
||||
*multilib_defaults:
|
||||
|
||||
|
||||
*multilib_extra:
|
||||
|
||||
|
||||
*multilib_matches:
|
||||
|
||||
|
||||
*linker:
|
||||
collect2
|
||||
|
||||
*link_command:
|
||||
%{!fsyntax-only: %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:} %{L*} %D %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*}
|
||||
}}}}}}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.68k,v 1.40 2005-03-11 09:37:27 obarthel Exp $
|
||||
# $Id: GNUmakefile.68k,v 1.59 2005-06-04 10:46:21 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@ -12,7 +12,7 @@ RANLIB = ranlib
|
||||
COPY = copy clone buf=0
|
||||
DELETE = delete all quiet
|
||||
MAKEDIR = makedir
|
||||
MAKE = make -f GNUmakefile.68k
|
||||
MAKE = $(MAKE_COMMAND) -f GNUmakefile.68k
|
||||
|
||||
##############################################################################
|
||||
|
||||
@ -110,12 +110,13 @@ WARNINGS = \
|
||||
# -Wconversion -Wshadow
|
||||
|
||||
INCLUDES = -Iinclude -I. -Inetinclude
|
||||
OPTIONS = -DNDEBUG -fno-builtin
|
||||
#OPTIONS = -D__MEM_DEBUG -fno-builtin
|
||||
#OPTIONS = -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG -fno-builtin
|
||||
#OPTIONS = -fno-builtin -fno-common -DDEBUG
|
||||
OPTIONS = -fno-builtin -fno-common -DNDEBUG
|
||||
#OPTIONS = -fno-builtin -fno-common -D__MEM_DEBUG
|
||||
#OPTIONS = -fno-builtin -fno-common -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG
|
||||
OPTIMIZE = -O -fomit-frame-pointer -fstrength-reduce -finline-functions
|
||||
#OPTIMIZE = -O2 -fomit-frame-pointer
|
||||
#DEBUG = -g2
|
||||
#DEBUG = -g
|
||||
|
||||
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(CODE_FLAGS) $(CODE_TYPE) $(INCLUDES)
|
||||
|
||||
@ -126,6 +127,7 @@ C_LIB = \
|
||||
ctype_isalnum.o \
|
||||
ctype_isalpha.o \
|
||||
ctype_isascii.o \
|
||||
ctype_isblank.o \
|
||||
ctype_iscntrl.o \
|
||||
ctype_isdigit.o \
|
||||
ctype_isgraph.o \
|
||||
@ -154,6 +156,10 @@ C_LIB = \
|
||||
fcntl_write.o \
|
||||
ftw_ftw.o \
|
||||
ftw_nftw.o \
|
||||
inttypes_imaxdiv.o \
|
||||
inttypes_imaxabs.o \
|
||||
inttypes_strtoimax.o \
|
||||
inttypes_strtoumax.o \
|
||||
libgen_basename.o \
|
||||
libgen_dirname.o \
|
||||
locale_init_exit.o \
|
||||
@ -201,6 +207,7 @@ C_LIB = \
|
||||
stdio_findvacantiobentry.o \
|
||||
stdio_flockfile.o \
|
||||
stdio_flush.o \
|
||||
stdio_flush_all_files.o \
|
||||
stdio_flushiobwritebuffer.o \
|
||||
stdio_fopen.o \
|
||||
stdio_fprintf.o \
|
||||
@ -267,6 +274,8 @@ C_LIB = \
|
||||
stdio_vsnprintf_hook_entry.o \
|
||||
stdio_vsprintf.o \
|
||||
stdio_vsprintf_hook_entry.o \
|
||||
stdio_vsscanf.o \
|
||||
stdio_vscanf.o \
|
||||
stdlib_abort.o \
|
||||
stdlib_abs.o \
|
||||
stdlib_alloca.o \
|
||||
@ -298,8 +307,11 @@ C_LIB = \
|
||||
stdlib_init_exit.o \
|
||||
stdlib_isresident.o \
|
||||
stdlib_labs.o \
|
||||
stdlib_llabs.o \
|
||||
stdlib_ldiv.o \
|
||||
stdlib_lldiv.o \
|
||||
stdlib_machine_test.o \
|
||||
stdlib_main.o \
|
||||
stdlib_malloc.o \
|
||||
stdlib_math.o \
|
||||
stdlib_mkdtemp.o \
|
||||
@ -325,7 +337,6 @@ C_LIB = \
|
||||
stdlib_set_process_window.o \
|
||||
stdlib_shell_escape.o \
|
||||
stdlib_showerror.o \
|
||||
stdlib_socket.o \
|
||||
stdlib_srand.o \
|
||||
stdlib_stackargbytes.o \
|
||||
stdlib_stackcheck.o \
|
||||
@ -344,6 +355,7 @@ C_LIB = \
|
||||
stdlib_system.o \
|
||||
stdlib_termination_message.o \
|
||||
stdlib_threshold.o \
|
||||
stdlib_utilitybase.o \
|
||||
stdlib_udivsi3.o \
|
||||
stdlib_udivsi4.o \
|
||||
stdlib_umodsi3.o \
|
||||
@ -403,6 +415,8 @@ C_LIB = \
|
||||
time_strftime.o \
|
||||
time_time.o \
|
||||
time_weekday.o \
|
||||
uio_readv.o \
|
||||
uio_writev.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@ -454,6 +468,7 @@ UNIX_LIB = \
|
||||
stat_mkdir.o \
|
||||
stat_rmdir.o \
|
||||
stat_stat.o \
|
||||
stdio_ctermid.o \
|
||||
stdio_fdhookentry.o \
|
||||
stdio_fflush.o \
|
||||
stdio_fopen.o \
|
||||
@ -469,6 +484,20 @@ UNIX_LIB = \
|
||||
stdlib_mkstemp.o \
|
||||
stdlib_mktemp.o \
|
||||
stdlib_system.o \
|
||||
termios_cfgetispeed.o \
|
||||
termios_cfgetospeed.o \
|
||||
termios_cfmakeraw.o \
|
||||
termios_cfsetispeed.o \
|
||||
termios_cfsetospeed.o \
|
||||
termios_console_fdhookentry.o \
|
||||
termios_tcdrain.o \
|
||||
termios_tcflow.o \
|
||||
termios_tcflush.o \
|
||||
termios_tcgetattr.o \
|
||||
termios_tcsendbreak.o \
|
||||
termios_tcsetattr.o \
|
||||
uio_readv.o \
|
||||
uio_writev.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@ -485,44 +514,120 @@ UNIX_LIB = \
|
||||
unistd_translaterel.o \
|
||||
unistd_translateu2a.o \
|
||||
unistd_truncate.o \
|
||||
unistd_ttyname.o \
|
||||
unistd_ttyname_r.o \
|
||||
unistd_unix_path_semantics.o \
|
||||
unistd_unlink.o \
|
||||
unistd_wildcard_expand.o \
|
||||
utime_utime.o
|
||||
|
||||
MATH_LIB = \
|
||||
complex_carg.o \
|
||||
complex_cargf.o \
|
||||
complex_cargl.o \
|
||||
complex_cimag.o \
|
||||
complex_cimagf.o \
|
||||
complex_cimagl.o \
|
||||
complex_conj.o \
|
||||
complex_conjf.o \
|
||||
complex_conjl.o \
|
||||
complex_creal.o \
|
||||
complex_crealf.o \
|
||||
complex_creall.o \
|
||||
math_acos.o \
|
||||
math_acosf.o \
|
||||
math_acosh.o \
|
||||
math_acoshf.o \
|
||||
math_asin.o \
|
||||
math_asinf.o \
|
||||
math_asinh.o \
|
||||
math_asinhf.o \
|
||||
math_atan.o \
|
||||
math_atan2.o \
|
||||
math_atan2f.o \
|
||||
math_atanf.o \
|
||||
math_cbrt.o \
|
||||
math_cbrtf.o \
|
||||
math_ceil.o \
|
||||
math_ceilf.o \
|
||||
math_copysign.o \
|
||||
math_copysignf.o \
|
||||
math_cos.o \
|
||||
math_cosf.o \
|
||||
math_cosh.o \
|
||||
math_coshf.o \
|
||||
math_erf.o \
|
||||
math_erfc.o \
|
||||
math_erfcf.o \
|
||||
math_erff.o \
|
||||
math_exp.o \
|
||||
math_expf.o \
|
||||
math_expm1.o \
|
||||
math_expm1f.o \
|
||||
math_fabs.o \
|
||||
math_fabsf.o \
|
||||
math_floor.o \
|
||||
math_floorf.o \
|
||||
math_fmod.o \
|
||||
math_fmodf.o \
|
||||
math_fpclassify.o \
|
||||
math_frexp.o \
|
||||
math_frexpf.o \
|
||||
math_huge_val.o \
|
||||
math_huge_valf.o \
|
||||
math_hypot.o \
|
||||
math_hypotf.o \
|
||||
math_ilogb.o \
|
||||
math_ilogbf.o \
|
||||
math_inf.o \
|
||||
math_inff.o \
|
||||
math_init_exit.o \
|
||||
math_isinf.o \
|
||||
math_isnan.o \
|
||||
math_isfinite.o \
|
||||
math_isunordered.o \
|
||||
math_kernel_cosf.o \
|
||||
math_kernel_sinf.o \
|
||||
math_kernel_tanf.o \
|
||||
math_ldexp.o \
|
||||
math_ldexpf.o \
|
||||
math_lgamma.o \
|
||||
math_lgammaf.o \
|
||||
math_log.o \
|
||||
math_log10.o \
|
||||
math_log10f.o \
|
||||
math_log1p.o \
|
||||
math_log1pf.o \
|
||||
math_logb.o \
|
||||
math_logbf.o \
|
||||
math_logf.o \
|
||||
math_modf.o \
|
||||
math_modff.o \
|
||||
math_nan.o \
|
||||
math_nanf.o \
|
||||
math_nextafter.o \
|
||||
math_nextafterf.o \
|
||||
math_pow.o \
|
||||
math_powf.o \
|
||||
math_remainder.o \
|
||||
math_remainderf.o \
|
||||
math_rem_pio2f.o \
|
||||
math_rint.o \
|
||||
math_rintf.o \
|
||||
math_scalbn.o \
|
||||
math_scalbnf.o \
|
||||
math_signbit.o \
|
||||
math_sin.o \
|
||||
math_sinf.o \
|
||||
math_sinh.o \
|
||||
math_sinhf.o \
|
||||
math_sqrt.o \
|
||||
math_sqrtf.o \
|
||||
math_tan.o \
|
||||
math_tanf.o \
|
||||
math_tanh.o \
|
||||
math_tanhf.o \
|
||||
stdio_asprintf.o \
|
||||
stdio_flush.o \
|
||||
stdio_flush_all_files.o \
|
||||
stdio_fprintf.o \
|
||||
stdio_fscanf.o \
|
||||
stdio_printf.o \
|
||||
@ -533,16 +638,18 @@ MATH_LIB = \
|
||||
stdio_vasprintf.o \
|
||||
stdio_vfprintf.o \
|
||||
stdio_vfscanf.o \
|
||||
stdio_vsscanf.o \
|
||||
stdio_vscanf.o \
|
||||
stdio_vprintf.o \
|
||||
stdio_vsnprintf.o \
|
||||
stdio_vsprintf.o \
|
||||
stdlib_atof.o \
|
||||
stdlib_strtod.o \
|
||||
stdlib_strtof.o \
|
||||
time_difftime.o
|
||||
|
||||
MATH_LIB_881 = \
|
||||
m881.lib_rev.o \
|
||||
stdlib_machine_test.o \
|
||||
$(MATH_LIB)
|
||||
|
||||
MATH_LIB_IEEE = \
|
||||
@ -757,7 +864,7 @@ endif
|
||||
|
||||
##############################################################################
|
||||
|
||||
STARTUPS := nrcrt0.o nbcrt0.o nr32crt0.o nb32crt0.o ncrt0.o mainnb.o mainb.o mainb32.o
|
||||
STARTUPS := nrcrt0.o nbcrt0.o nr32crt0.o nb32crt0.o ncrt0.o
|
||||
|
||||
##############################################################################
|
||||
|
||||
@ -767,9 +874,6 @@ all: \
|
||||
lib/ncrt0.o \
|
||||
lib/n32bcrt0.o \
|
||||
lib/n32rcrt0.o \
|
||||
lib/mainnb.o \
|
||||
lib/mainb.o \
|
||||
lib/mainb32.o \
|
||||
lib/libm020/libm.a \
|
||||
lib/libm.a \
|
||||
lib/libb/libm.a \
|
||||
@ -879,15 +983,6 @@ lib/n32bcrt0.o : lib nb32crt0.o
|
||||
lib/n32rcrt0.o : lib nr32crt0.o
|
||||
@$(COPY) nr32crt0.o lib
|
||||
|
||||
lib/mainnb.o : lib mainnb.o
|
||||
@$(COPY) mainnb.o lib
|
||||
|
||||
lib/mainb.o : lib mainb.o
|
||||
@$(COPY) mainb.o lib
|
||||
|
||||
lib/mainb32.o : lib mainb32.o
|
||||
@$(COPY) mainb32.o lib
|
||||
|
||||
##############################################################################
|
||||
|
||||
$(LIBAMIGA_OBJS)/amiga_hookentry.o : amiga_hookentry.c
|
||||
@ -922,43 +1017,49 @@ $(LIBAMIGA_OBJS)/amiga.lib_rev.o : amiga.lib_rev.c amiga.lib_rev.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_stacksize.o : stdlib_stacksize.c stdlib_gcc_help.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_getdefstacksize.o : stdlib_getdefstacksize.c stdlib_gcc_help.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_shell_escape.o : stdlib_shell_escape.c stdlib_gcc_help.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_memory.h
|
||||
|
||||
##############################################################################
|
||||
|
||||
# The -fbaserel32 option requires the CPU type to be 68010/68020, too.
|
||||
# The -fbaserel32 option requires the CPU type to be 68020, too.
|
||||
ifneq (,$(findstring fbaserel32,$(CODE_FLAGS)))
|
||||
LOCAL_CODE_FLAGS := $(CODE_FLAGS) $(CODE_TYPE)
|
||||
else
|
||||
LOCAL_CODE_FLAGS := $(CODE_FLAGS)
|
||||
endif
|
||||
|
||||
$(LIBM881_OBJS)/math_init_exit.o : math_init_exit.c
|
||||
@echo "Compiling $< [$(TYPE):m881]"
|
||||
@$(CC) -o $(LIBM881_OBJS)/math_init_exit.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(LOCAL_CODE_FLAGS) -DM68881_FLOATING_POINT_SUPPORT $(INCLUDES) $<
|
||||
|
||||
$(LIBC_OBJS)/stdlib_machine_test.o : stdlib_machine_test.c
|
||||
@echo "Compiling $< [$(TYPE):c]"
|
||||
@$(CC) -o $(LIBC_OBJS)/stdlib_machine_test.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(LOCAL_CODE_FLAGS) $(INCLUDES) $<
|
||||
|
||||
$(LIBM881_OBJS)/stdlib_machine_test.o : stdlib_machine_test.c
|
||||
@echo "Compiling $< [$(TYPE):c]"
|
||||
@$(CC) -o $(LIBM881_OBJS)/stdlib_machine_test.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(LOCAL_CODE_FLAGS) $(INCLUDES) -DM68881_FLOATING_POINT_SUPPORT $<
|
||||
|
||||
$(LIBC_OBJS)/stdlib_showerror.o : stdlib_showerror.c
|
||||
@echo "Compiling $< [$(TYPE):c]"
|
||||
@$(CC) -o $(LIBC_OBJS)/stdlib_showerror.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(LOCAL_CODE_FLAGS) $(INCLUDES) $<
|
||||
|
||||
$(LIBC_OBJS)/stdlib_main.o : stdlib_main.c
|
||||
@echo "Compiling $< [$(TYPE):c]"
|
||||
@$(CC) -o $(LIBC_OBJS)/stdlib_main.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(LOCAL_CODE_FLAGS) $(INCLUDES) stdlib_main.c
|
||||
|
||||
##############################################################################
|
||||
|
||||
$(LIBC_OBJS)/stdlib_alloca_debug.o : stdlib_alloca.c
|
||||
@ -1107,30 +1208,22 @@ ncrt0.o : ncrt0.S
|
||||
@echo "Assembling $< [large_data]"
|
||||
@$(CC) -traditional -o $@ -c ncrt0.S
|
||||
|
||||
mainb32.o : stdlib_main.c
|
||||
@echo "Compiling $< [small_data32]"
|
||||
@$(CC) -o mainb32.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -fbaserel32 -DSMALL_DATA32 -m68020-60 -DM68020 stdlib_main.c
|
||||
|
||||
mainb.o : stdlib_main.c
|
||||
@echo "Compiling $< [small_data]"
|
||||
@$(CC) -o mainb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -fbaserel -DSMALL_DATA -m68000 stdlib_main.c
|
||||
|
||||
mainnb.o : stdlib_main.c
|
||||
@echo "Compiling $< [large_data]"
|
||||
@$(CC) -o mainnb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -m68000 stdlib_main.c
|
||||
|
||||
##############################################################################
|
||||
|
||||
CONSTRUCTOR_FILES = \
|
||||
amiga_rexxvars.c \
|
||||
amiga_rexxvars.c \
|
||||
dirent_closedir.c \
|
||||
locale_init_exit.c \
|
||||
math_init_exit.c \
|
||||
sas_profile.c \
|
||||
socket_init_exit.c \
|
||||
stdio_file_init.c \
|
||||
stdio_init_exit.c \
|
||||
stdlib_alloca.c \
|
||||
stdlib_arg.c \
|
||||
stdlib_init_exit.c \
|
||||
stdlib_setenv.c \
|
||||
stdlib_stackcheck.c \
|
||||
stdlib_stackextension.c \
|
||||
time_clock.c \
|
||||
unistd_chdir_exit.c \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: GNUmakefile.os4,v 1.41 2005-03-11 09:37:28 obarthel Exp $
|
||||
# $Id: GNUmakefile.os4,v 1.64 2005-06-04 14:16:58 obarthel Exp $
|
||||
#
|
||||
# :ts=8
|
||||
#
|
||||
@ -16,7 +16,7 @@ CC = ppc-amigaos-gcc
|
||||
AR = ppc-amigaos-ar -q
|
||||
RANLIB = ppc-amigaos-ranlib
|
||||
COPY = cp -a
|
||||
DELETE = rm -r
|
||||
DELETE = rm -rf
|
||||
MAKEDIR = mkdir
|
||||
|
||||
# The following are for the native OS4 compiler
|
||||
@ -27,7 +27,7 @@ MAKEDIR = mkdir
|
||||
# DELETE = delete all quiet
|
||||
# MAKEDIR = makedir
|
||||
|
||||
MAKE = make -f GNUmakefile.os4
|
||||
MAKE = $(MAKE_COMMAND) -f GNUmakefile.os4
|
||||
|
||||
##############################################################################
|
||||
|
||||
@ -101,7 +101,6 @@ CODE_TYPE := -mbaserel -DBASEREL_DATA
|
||||
FLOAT_TYPE := -DPPC_FLOATING_POINT_SUPPORT
|
||||
endif
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
||||
WARNINGS = \
|
||||
@ -111,9 +110,10 @@ WARNINGS = \
|
||||
# -Wconversion -Wshadow
|
||||
|
||||
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
|
||||
OPTIONS = -D__THREAD_SAFE -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
|
||||
OPTIMIZE = -O -fomit-frame-pointer -funroll-loops
|
||||
#DEBUG = -g
|
||||
#OPTIONS = -D__THREAD_SAFE -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames -fno-common -std=gnu99
|
||||
OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames -fno-common -std=gnu99
|
||||
OPTIMIZE = -O3
|
||||
#DEBUG = -ggdb
|
||||
|
||||
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(CODE_TYPE) $(INCLUDES)
|
||||
|
||||
@ -125,6 +125,7 @@ C_LIB = \
|
||||
ctype_isalnum.o \
|
||||
ctype_isalpha.o \
|
||||
ctype_isascii.o \
|
||||
ctype_isblank.o \
|
||||
ctype_iscntrl.o \
|
||||
ctype_isdigit.o \
|
||||
ctype_isgraph.o \
|
||||
@ -153,6 +154,10 @@ C_LIB = \
|
||||
fcntl_write.o \
|
||||
ftw_ftw.o \
|
||||
ftw_nftw.o \
|
||||
inttypes_imaxdiv.o \
|
||||
inttypes_imaxabs.o \
|
||||
inttypes_strtoimax.o \
|
||||
inttypes_strtoumax.o \
|
||||
libgen_basename.o \
|
||||
libgen_dirname.o \
|
||||
locale_init_exit.o \
|
||||
@ -200,6 +205,7 @@ C_LIB = \
|
||||
stdio_findvacantiobentry.o \
|
||||
stdio_flockfile.o \
|
||||
stdio_flush.o \
|
||||
stdio_flush_all_files.o \
|
||||
stdio_flushiobwritebuffer.o \
|
||||
stdio_fopen.o \
|
||||
stdio_fprintf.o \
|
||||
@ -261,6 +267,8 @@ C_LIB = \
|
||||
stdio_vasprintf_hook_entry.o \
|
||||
stdio_vfprintf.o \
|
||||
stdio_vfscanf.o \
|
||||
stdio_vsscanf.o \
|
||||
stdio_vscanf.o \
|
||||
stdio_vprintf.o \
|
||||
stdio_vsnprintf.o \
|
||||
stdio_vsnprintf_hook_entry.o \
|
||||
@ -297,8 +305,11 @@ C_LIB = \
|
||||
stdlib_init_exit.o \
|
||||
stdlib_isresident.o \
|
||||
stdlib_labs.o \
|
||||
stdlib_llabs.o \
|
||||
stdlib_ldiv.o \
|
||||
stdlib_lldiv.o \
|
||||
stdlib_machine_test.o \
|
||||
stdlib_main.o \
|
||||
stdlib_malloc.o \
|
||||
stdlib_math.o \
|
||||
stdlib_mkdtemp.o \
|
||||
@ -324,7 +335,6 @@ C_LIB = \
|
||||
stdlib_set_process_window.o \
|
||||
stdlib_shell_escape.o \
|
||||
stdlib_showerror.o \
|
||||
stdlib_socket.o \
|
||||
stdlib_srand.o \
|
||||
stdlib_stackargbytes.o \
|
||||
stdlib_stackcheck.o \
|
||||
@ -343,6 +353,7 @@ C_LIB = \
|
||||
stdlib_system.o \
|
||||
stdlib_termination_message.o \
|
||||
stdlib_threshold.o \
|
||||
stdlib_utilitybase.o \
|
||||
stdlib_udivsi3.o \
|
||||
stdlib_udivsi4.o \
|
||||
stdlib_umodsi3.o \
|
||||
@ -402,6 +413,8 @@ C_LIB = \
|
||||
time_strftime.o \
|
||||
time_time.o \
|
||||
time_weekday.o \
|
||||
uio_readv.o \
|
||||
uio_writev.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@ -454,6 +467,7 @@ UNIX_LIB = \
|
||||
stat_mkdir.o \
|
||||
stat_rmdir.o \
|
||||
stat_stat.o \
|
||||
stdio_ctermid.o \
|
||||
stdio_fdhookentry.o \
|
||||
stdio_fflush.o \
|
||||
stdio_fopen.o \
|
||||
@ -469,6 +483,21 @@ UNIX_LIB = \
|
||||
stdlib_mkstemp.o \
|
||||
stdlib_mktemp.o \
|
||||
stdlib_system.o \
|
||||
termios_cfgetispeed.o \
|
||||
termios_cfgetospeed.o \
|
||||
termios_cfmakeraw.o \
|
||||
termios_cfsetispeed.o \
|
||||
termios_cfsetospeed.o \
|
||||
termios_console_fdhookentry.o \
|
||||
termios_openserial.o \
|
||||
termios_tcdrain.o \
|
||||
termios_tcflow.o \
|
||||
termios_tcflush.o \
|
||||
termios_tcgetattr.o \
|
||||
termios_tcsendbreak.o \
|
||||
termios_tcsetattr.o \
|
||||
uio_readv.o \
|
||||
uio_writev.o \
|
||||
unistd_access.o \
|
||||
unistd_chdir.o \
|
||||
unistd_chdir_exit.o \
|
||||
@ -485,6 +514,8 @@ UNIX_LIB = \
|
||||
unistd_translaterel.o \
|
||||
unistd_translateu2a.o \
|
||||
unistd_truncate.o \
|
||||
unistd_ttyname.o \
|
||||
unistd_ttyname_r.o \
|
||||
unistd_unix_path_semantics.o \
|
||||
unistd_unlink.o \
|
||||
unistd_wildcard_expand.o \
|
||||
@ -492,44 +523,118 @@ UNIX_LIB = \
|
||||
|
||||
# All objects files which make up libm.a
|
||||
MATH_LIB = \
|
||||
complex_carg.o \
|
||||
complex_cargf.o \
|
||||
complex_cargl.o \
|
||||
complex_cimag.o \
|
||||
complex_cimagf.o \
|
||||
complex_cimagl.o \
|
||||
complex_conj.o \
|
||||
complex_conjf.o \
|
||||
complex_conjl.o \
|
||||
complex_creal.o \
|
||||
complex_crealf.o \
|
||||
complex_creall.o \
|
||||
math_acos.o \
|
||||
math_acosf.o \
|
||||
math_acosh.o \
|
||||
math_acoshf.o \
|
||||
math_asin.o \
|
||||
math_asinf.o \
|
||||
math_asinh.o \
|
||||
math_asinhf.o \
|
||||
math_atan.o \
|
||||
math_atan2.o \
|
||||
math_atan2f.o \
|
||||
math_atanf.o \
|
||||
math_cbrt.o \
|
||||
math_cbrtf.o \
|
||||
math_ceil.o \
|
||||
math_ceilf.o \
|
||||
math_copysign.o \
|
||||
math_copysignf.o \
|
||||
math_cos.o \
|
||||
math_cosf.o \
|
||||
math_cosh.o \
|
||||
math_coshf.o \
|
||||
math_erf.o \
|
||||
math_erfc.o \
|
||||
math_erfcf.o \
|
||||
math_erff.o \
|
||||
math_exp.o \
|
||||
math_expf.o \
|
||||
math_expm1.o \
|
||||
math_expm1f.o \
|
||||
math_fabs.o \
|
||||
math_fabsf.o \
|
||||
math_floor.o \
|
||||
math_floorf.o \
|
||||
math_fmod.o \
|
||||
math_fmodf.o \
|
||||
math_fpclassify.o \
|
||||
math_frexp.o \
|
||||
math_frexpf.o \
|
||||
math_huge_val.o \
|
||||
math_huge_valf.o \
|
||||
math_hypot.o \
|
||||
math_hypotf.o \
|
||||
math_ilogb.o \
|
||||
math_ilogbf.o \
|
||||
math_inf.o \
|
||||
math_inff.o \
|
||||
math_init_exit.o \
|
||||
math_isnan.o \
|
||||
math_isinf.o \
|
||||
math_isfinite.o \
|
||||
math_isunordered.o \
|
||||
math_kernel_cos.o \
|
||||
math_kernel_cosf.o \
|
||||
math_kernel_expm1.o \
|
||||
math_kernel_rem_pio2.o \
|
||||
math_kernel_scalbn.o \
|
||||
math_kernel_sin.o \
|
||||
math_kernel_sinf.o \
|
||||
math_kernel_tan.o \
|
||||
math_kernel_tanf.o \
|
||||
math_ldexp.o \
|
||||
math_ldexpf.o \
|
||||
math_lgamma.o \
|
||||
math_lgammaf.o \
|
||||
math_log.o \
|
||||
math_log10.o \
|
||||
math_log10f.o \
|
||||
math_log1p.o \
|
||||
math_log1pf.o \
|
||||
math_logb.o \
|
||||
math_logbf.o \
|
||||
math_logf.o \
|
||||
math_modf.o \
|
||||
math_modff.o \
|
||||
math_nan.o \
|
||||
math_nanf.o \
|
||||
math_nextafter.o \
|
||||
math_nextafterf.o \
|
||||
math_pow.o \
|
||||
math_powf.o \
|
||||
math_remainder.o \
|
||||
math_remainderf.o \
|
||||
math_rem_pio2f.o \
|
||||
math_rint.o \
|
||||
math_rintf.o \
|
||||
math_scalbn.o \
|
||||
math_scalbnf.o \
|
||||
math_signbit.o \
|
||||
math_sin.o \
|
||||
math_sinf.o \
|
||||
math_sinh.o \
|
||||
math_sinhf.o \
|
||||
math_sqrt.o \
|
||||
math_sqrtf.o \
|
||||
math_tan.o \
|
||||
math_tanf.o \
|
||||
math_tanh.o \
|
||||
math_kernel_expm1.o \
|
||||
math_kernel_scalbn.o \
|
||||
math_kernel_tan.o \
|
||||
math_kernel_cos.o \
|
||||
math_kernel_rem_pio2.o \
|
||||
math_kernel_sin.o \
|
||||
math_tanhf.o \
|
||||
stdio_asprintf.o \
|
||||
stdio_flush.o \
|
||||
stdio_flush_all_files.o \
|
||||
stdio_fprintf.o \
|
||||
stdio_fscanf.o \
|
||||
stdio_printf.o \
|
||||
@ -540,12 +645,14 @@ MATH_LIB = \
|
||||
stdio_vasprintf.o \
|
||||
stdio_vfprintf.o \
|
||||
stdio_vfscanf.o \
|
||||
stdio_vsscanf.o \
|
||||
stdio_vscanf.o \
|
||||
stdio_vprintf.o \
|
||||
stdio_vsnprintf.o \
|
||||
stdio_vsprintf.o \
|
||||
stdlib_atof.o \
|
||||
stdlib_machine_test.o \
|
||||
stdlib_strtod.o \
|
||||
stdlib_strtof.o \
|
||||
time_difftime.o
|
||||
|
||||
# All objects files which make up libnet.a
|
||||
@ -714,7 +821,7 @@ LIBS := \
|
||||
##############################################################################
|
||||
|
||||
# The startup object files to be built
|
||||
STARTUPS := bcrt0.o bcrtbegin.o bcrtend.o crt0.o crtbegin.o crtend.o mainb.o mainnb.o
|
||||
STARTUPS := crt0.o crtbegin.o crtend.o
|
||||
|
||||
##############################################################################
|
||||
|
||||
@ -729,22 +836,18 @@ all: \
|
||||
large_data \
|
||||
large_data_softfloat \
|
||||
baserel \
|
||||
lib/bcrt0.o \
|
||||
lib/bcrtbegin.o \
|
||||
lib/bcrtend.o \
|
||||
lib/crt0.o \
|
||||
lib/crtbegin.o \
|
||||
lib/crtend.o \
|
||||
lib/mainb.o \
|
||||
lib/mainnb.o \
|
||||
lib/libm.a \
|
||||
lib/small-data/crt0.o \
|
||||
lib/small-data/crtbegin.o \
|
||||
lib/small-data/crtend.o \
|
||||
lib/small-data/libm.a \
|
||||
lib/soft-float/libm.a \
|
||||
lib/baserel/crt0.o \
|
||||
lib/baserel/crtbegin.o \
|
||||
lib/baserel/crtend.o \
|
||||
lib/baserel/mainb.o \
|
||||
lib/baserel/mainnb.o \
|
||||
lib/baserel/libm.a
|
||||
|
||||
##############################################################################
|
||||
@ -868,20 +971,14 @@ lib/crtbegin.o : lib crtbegin.o
|
||||
lib/crtend.o : lib crtend.o
|
||||
$(COPY) crtend.o lib
|
||||
|
||||
lib/mainnb.o : lib mainnb.o
|
||||
$(COPY) mainnb.o lib
|
||||
lib/small-data/crt0.o : lib small_data/crt0.o
|
||||
$(COPY) small_data/crt0.o lib/small-data
|
||||
|
||||
lib/mainb.o : lib mainb.o
|
||||
$(COPY) mainb.o lib
|
||||
lib/small-data/crtbegin.o : lib small_data/crtbegin.o
|
||||
$(COPY) small_data/crtbegin.o lib/small-data
|
||||
|
||||
lib/bcrt0.o : lib bcrt0.o
|
||||
$(COPY) bcrt0.o lib
|
||||
|
||||
lib/bcrtbegin.o : lib bcrtbegin.o
|
||||
$(COPY) bcrtbegin.o lib
|
||||
|
||||
lib/bcrtend.o : lib bcrtend.o
|
||||
$(COPY) bcrtend.o lib
|
||||
lib/small-data/crtend.o : lib small_data/crtend.o
|
||||
$(COPY) small_data/crtend.o lib/small-data
|
||||
|
||||
lib/baserel/crt0.o : lib baserel/crt0.o
|
||||
$(COPY) baserel/crt0.o lib/baserel
|
||||
@ -892,13 +989,6 @@ lib/baserel/crtbegin.o : lib baserel/crtbegin.o
|
||||
lib/baserel/crtend.o : lib baserel/crtend.o
|
||||
$(COPY) baserel/crtend.o lib/baserel
|
||||
|
||||
lib/baserel/mainnb.o : lib baserel/mainnb.o
|
||||
$(COPY) baserel/mainnb.o lib/baserel
|
||||
|
||||
lib/baserel/mainb.o : lib baserel/mainb.o
|
||||
$(COPY) baserel/mainb.o lib/baserel
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
||||
# Individual dependencies which tell make to build the object files from
|
||||
@ -929,20 +1019,20 @@ $(LIBAMIGA_OBJS)/amiga.lib_rev.o : amiga.lib_rev.c amiga.lib_rev.h
|
||||
|
||||
# Build rules for the debug version of the library which has special
|
||||
# memory allocation debugging code, controlled by the contents of
|
||||
# the stdlib_mem_debug.h file.
|
||||
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_mem_debug.h
|
||||
# the stdlib_memory.h file.
|
||||
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_memory.h
|
||||
|
||||
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_mem_debug.h
|
||||
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_memory.h
|
||||
|
||||
##############################################################################
|
||||
|
||||
@ -1065,38 +1155,27 @@ crt0.o : crt0.S
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -Wa,-mregnames -o crt0.o -c crt0.S
|
||||
|
||||
bcrt0.o : crt0.S
|
||||
small_data/crt0.o : crt0.S
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -DSMALL_DATA -Wa,-mregnames -o bcrt0.o -c crt0.S
|
||||
@$(CC) -DSMALL_DATA -Wa,-mregnames -o small_data/crt0.o -c crt0.S
|
||||
|
||||
mainnb.o : stdlib_main.c
|
||||
@echo "Compiling $<"
|
||||
@$(CC) -o mainnb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=data stdlib_main.c
|
||||
small_data/crtbegin.o : crtbegin.c
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -o small_data/crtbegin.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=sysv -DSMALL_DATA crtbegin.c
|
||||
|
||||
mainb.o : stdlib_main.c
|
||||
@echo "Compiling $<"
|
||||
@$(CC) -o mainb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=sysv -DSMALL_DATA stdlib_main.c
|
||||
|
||||
bcrtbegin.o : crtbegin.c
|
||||
$(CC) -o bcrtbegin.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=sysv -DSMALL_DATA crtbegin.c
|
||||
|
||||
bcrtend.o : crtend.c
|
||||
$(CC) -o bcrtend.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=sysv -DSMALL_DATA crtend.c
|
||||
small_data/crtend.o : crtend.c
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -o small_data/crtend.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -msdata=sysv -DSMALL_DATA crtend.c
|
||||
|
||||
baserel/crt0.o : crt0.S
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -Wa,-mregnames -o baserel/crt0.o -mbaserel -DBASEREL_DATA -c crt0.S
|
||||
|
||||
baserel/mainnb.o : stdlib_main.c
|
||||
@echo "Compiling $<"
|
||||
@$(CC) -o baserel/mainnb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA stdlib_main.c
|
||||
|
||||
baserel/mainb.o : stdlib_main.c
|
||||
@echo "Compiling $<"
|
||||
@$(CC) -o baserel/mainb.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA stdlib_main.c
|
||||
|
||||
baserel/crtbegin.o : crtbegin.c
|
||||
$(CC) -o baserel/crtbegin.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA crtbegin.c
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -o baserel/crtbegin.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA crtbegin.c
|
||||
|
||||
baserel/crtend.o : crtend.c
|
||||
$(CC) -o baserel/crtend.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA crtend.c
|
||||
@echo "Assembling $<"
|
||||
@$(CC) -o baserel/crtend.o -c $(WARNINGS) $(OPTIMIZE) $(DEBUG) $(OPTIONS) $(INCLUDES) -mbaserel -DBASEREL_DATA crtend.c
|
||||
|
||||
|
||||
23
library/TODO
Executable file
23
library/TODO
Executable file
@ -0,0 +1,23 @@
|
||||
C99 math functions:
|
||||
|
||||
(functions generally missing, including their "float" counterparts)
|
||||
exp2
|
||||
exp2f
|
||||
fma
|
||||
fmaf
|
||||
log2
|
||||
log2f
|
||||
lrint
|
||||
lrintf
|
||||
lround
|
||||
lroundf
|
||||
nearbyint
|
||||
nearbyintf
|
||||
remquo
|
||||
remquof
|
||||
round
|
||||
roundf
|
||||
tgamma
|
||||
tgammaf
|
||||
trunc
|
||||
truncf
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 189
|
||||
#define DATE "5.3.2005"
|
||||
#define VERS "amiga.lib 1.189"
|
||||
#define VSTRING "amiga.lib 1.189 (5.3.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.189 (5.3.2005)"
|
||||
#define REVISION 193
|
||||
#define DATE "4.6.2005"
|
||||
#define VERS "amiga.lib 1.193"
|
||||
#define VSTRING "amiga.lib 1.193 (4.6.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: amiga.lib 1.193 (4.6.2005)"
|
||||
|
||||
@ -1 +1 @@
|
||||
189
|
||||
193
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: amiga_acrypt.c,v 1.2 2005-01-02 09:07:06 obarthel Exp $
|
||||
* $Id: amiga_acrypt.c,v 1.3 2005-05-30 14:01:20 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -31,10 +31,14 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define ACrypt __ACrypt
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <string.h>
|
||||
#include <clib/alib_protos.h>
|
||||
|
||||
#undef ACrypt
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: amiga_createtask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: amiga_createtask.c,v 1.4 2005-03-18 12:38:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,6 +46,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_PROFILE_H
|
||||
#include "stdlib_profile.h"
|
||||
#endif /* _STDLIB_PROFILE_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "macros.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: amiga_dotimer.c,v 1.3 2005-03-06 09:00:16 obarthel Exp $
|
||||
* $Id: amiga_dotimer.c,v 1.4 2005-03-18 12:38:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -44,6 +44,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_PROFILE_H
|
||||
#include "stdlib_profile.h"
|
||||
#endif /* _STDLIB_PROFILE_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "macros.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: amiga_rexxvars.c,v 1.3 2005-01-09 10:10:40 obarthel Exp $
|
||||
* $Id: amiga_rexxvars.c,v 1.6 2005-03-18 12:38:21 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -34,12 +34,20 @@
|
||||
/* We don't want to pull in <clib/alib_protos.h> */
|
||||
#define CLIB_ALIB_PROTOS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_CONSTRUCTOR_H
|
||||
#include "stdlib_constructor.h"
|
||||
#endif /* _STDLIB_CONSTRUCTOR_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <rexx/rxslib.h>
|
||||
#include <rexx/errors.h>
|
||||
|
||||
@ -60,7 +68,7 @@ static struct RexxSysIFace * IRexxSys;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
CLIB_CONSTRUCTOR(__rexxvars_init)
|
||||
CLIB_CONSTRUCTOR(rexxvars_init)
|
||||
{
|
||||
ENTER();
|
||||
|
||||
@ -80,12 +88,14 @@ CLIB_CONSTRUCTOR(__rexxvars_init)
|
||||
}
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
LEAVE();
|
||||
|
||||
CONSTRUCTOR_SUCCEED();
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
CLIB_DESTRUCTOR(__rexxvars_exit)
|
||||
CLIB_DESTRUCTOR(rexxvars_exit)
|
||||
{
|
||||
ENTER();
|
||||
|
||||
|
||||
31
library/build_archive_amiga
Executable file
31
library/build_archive_amiga
Executable file
@ -0,0 +1,31 @@
|
||||
; Simple release archive build script for Amiga systems.
|
||||
|
||||
; Set the name of the archive and the directory the
|
||||
; files go into
|
||||
set dir_name clib2-1.`type c.lib_rev.rev`
|
||||
|
||||
; Start with a clean slate
|
||||
delete all quiet ram:$dir_name
|
||||
|
||||
; Create the directory, copy all the libraries, header files
|
||||
; and release note files inside.
|
||||
makedir ram:$dir_name
|
||||
copy lib ram:${dir_name}/lib all clone quiet
|
||||
copy include ram:${dir_name}/include all clone quiet
|
||||
copy changes ram:$dir_name clone
|
||||
|
||||
; Delete the CVS data from the include directory
|
||||
delete ram:${dir_name}/include/CVS ram:${dir_name}/include/sys/CVS all quiet
|
||||
|
||||
; Finally, create an lha archive in RAM:
|
||||
pushcd ram:
|
||||
lha -r -x -a a ${dir_name}-gcc-68k.lha ${dir_name}
|
||||
popcd
|
||||
|
||||
; Move the archive back to this directory
|
||||
copy ram:${dir_name}-gcc-68k.lha "" clone
|
||||
|
||||
; Clean up...
|
||||
delete ram:$dir_name all quiet
|
||||
unset dir_name
|
||||
|
||||
27
library/build_archive_unix.sh
Executable file
27
library/build_archive_unix.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Simple release archive build script for Unix systems.
|
||||
# I typically build the library with a cross compiler.
|
||||
|
||||
# Set the name of the archive and the directory the
|
||||
# files go into
|
||||
export dir_name=clib2-1.`cat c.lib_rev.rev`
|
||||
|
||||
# Start with a clean slate
|
||||
rm -rf $dir_name
|
||||
|
||||
# Create the directory, copy all the libraries, header files
|
||||
# and release note files inside.
|
||||
mkdir $dir_name
|
||||
cp -a lib $dir_name
|
||||
cp -a lib.threadsafe $dir_name
|
||||
cp -a include $dir_name
|
||||
cp changes $dir_name
|
||||
|
||||
# Delete the CVS data from the include directory
|
||||
rm -rf ${dir_name}/include/CVS ${dir_name}/include/sys/CVS
|
||||
|
||||
# Finally, create an lha type 5 archive; the Amiga LhA port
|
||||
# can unpack it.
|
||||
lha ao5q ${dir_name}-gcc-os4.lha ${dir_name}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 189
|
||||
#define DATE "5.3.2005"
|
||||
#define VERS "c.lib 1.189"
|
||||
#define VSTRING "c.lib 1.189 (5.3.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.189 (5.3.2005)"
|
||||
#define REVISION 193
|
||||
#define DATE "4.6.2005"
|
||||
#define VERS "c.lib 1.193"
|
||||
#define VSTRING "c.lib 1.193 (4.6.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: c.lib 1.193 (4.6.2005)"
|
||||
|
||||
@ -1 +1 @@
|
||||
189
|
||||
193
|
||||
|
||||
327
library/changes
327
library/changes
@ -1,3 +1,256 @@
|
||||
c.lib 1.193 (4.6.2005)
|
||||
|
||||
- fpclassify() now returns FP_ZERO both for 0 and -0.
|
||||
|
||||
- nan() and nanf() now return quiet NaNs.
|
||||
|
||||
- Added internal __inf() and __inff() functions.
|
||||
|
||||
- strtof() now calls nanf() and __inff(), respectively, to produce
|
||||
the special floating point values for nan/inf/infinity.
|
||||
|
||||
- strtod() now calls nan() and __inf(), respectively, to produce
|
||||
the special floating point values for nan/inf/infinity.
|
||||
|
||||
- The scanf() family now calls nan() and __inf(), respectively, to
|
||||
produce the special floating point values for nan/inf/infinity.
|
||||
|
||||
- Added %D, %e, %F, %g, %G and %h for strftime(); repaired %I.
|
||||
|
||||
- Documented __strip_double_slash() and plugged in a memmove()
|
||||
in place of the copying loop.
|
||||
|
||||
- Modified __translate_unix_to_amiga_path_name() and
|
||||
__translate_amiga_to_unix_path_name() to not to call strlen()
|
||||
on the results of __strip_double_slash().
|
||||
|
||||
- For %C strtime() should return the century number, not the
|
||||
year number mod 100.
|
||||
|
||||
- The record locking code in fcntl() is no longer part of the
|
||||
regular libc.a, but only of libunix.a.
|
||||
|
||||
- Changed the definition of the D_S() macro to cast the pointer
|
||||
address to an unsigned 32 bit integer.
|
||||
|
||||
- Modified the locale-aware isalnum(), isalpha(), iscntrl(),
|
||||
isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(),
|
||||
isupper(), isxdigit(), tolower() and toupper() functions
|
||||
to clamp the input parameter to the "unsigned char" range before
|
||||
it is submitted to the respective locale.library function. This
|
||||
should be in sync with what the specs demand, which state that
|
||||
if the input parameter is neither EOF nor in the range of an
|
||||
"unsigned char" variable, then the results are undefined.
|
||||
|
||||
- ungetc() now returns the input character, clamped to an unsigned
|
||||
char value, upon success. Previously, if the input parameter was
|
||||
negative and not EOF, the result was identical to the input, which
|
||||
could have had negative side-effects.
|
||||
|
||||
-<2D>Added NAN, INFINITY, FLT_EVAL_METHOD, float_t and double_t to
|
||||
<math.h> (C99).
|
||||
|
||||
- Added skeleton code for acosf(), acosh(), acoshf(), asinf(), asinh(),
|
||||
asinhf(), atan2f(), atanf(), atanh(), atanhf(), cbrt(), cbrtf(),
|
||||
ceilf(), cosf(), coshf(), erf(), erfc(), erfcf(), erff(),
|
||||
exp2(), exp2f(), expf(), expm1(), expm1f(), fdim(), fdimf(),
|
||||
floorf(), fma(), fmaf(), fmax(), fmaxf(), fmin(), fminf(),
|
||||
fmodf(), frexpf(), hypotf(), ilogb(), ilogbf(), ldexpf(), lgamma(),
|
||||
lgammaf(), log10f(), log1p(), log1pf(), log2(), log2f(), logbf(),
|
||||
logf(), lrint(), lrintf(), lround(), lroundf(), modff(), nearbyint(),
|
||||
nearbyintf(), powf(), remainder(), remainderf(), remquo(), remquof(), round(),
|
||||
roundf(), scalbn(), scalbnf(), sinf(), sinhf(), sqrtf(), tanf(),
|
||||
tanhf(), tgamma(), tgammaf(), trunc() and truncf(), to be filled in
|
||||
later...
|
||||
|
||||
- Implemented fmin()/fminf(), fmax()/fmaxf(), fdim()/fdimf() for C99.
|
||||
|
||||
- Ported acosf(), asinf(), atan2f(), atanf(), ceilf(), expf(), floorf(),
|
||||
fmodf(), frexpf(), ldexpf(), log10f(), logbf(), logf(), modff(), powf(), sqrtf(),
|
||||
scalbn() and scalbnf() for C99.
|
||||
|
||||
- Ported cbrt(), cbrtf(), erf(), erff(), erfc(), erfcf(), expm1(),
|
||||
expm1f(), ilogb(), ilogbf(), log1p() and log1pf() for C99.
|
||||
|
||||
- Ported cosf(), coshf(), sinf(), sinhf(), tanf(), tanhf()
|
||||
and hypotf() for C99.
|
||||
|
||||
- Ported acosh(), acoshf(), asinh(), asinhf(), lgamma(), lgammaf(),
|
||||
remainder() and remainderf() for C99.
|
||||
|
||||
- The scanf() family now supports character ranges for the %[
|
||||
conversion. Note that this is a non-standard feature!
|
||||
|
||||
- Integrated Peter Bengtsson's termios code. Thank you very much! I chose
|
||||
to add it to libunix.a rather than keeping it in a separate libtermios.a
|
||||
library.
|
||||
|
||||
|
||||
c.lib 1.192 (12.5.2005)
|
||||
|
||||
- Changed how errors are detected, as returned by Write(), Read() and
|
||||
Seek(). Seek() is particularly challenging because the value it
|
||||
returns might be a valid file position and not an error.
|
||||
|
||||
- Replaced numeric function return codes of 0 and -1 with macros OK,
|
||||
SEEK_ERROR/ERROR to clarify the respective purposes.
|
||||
|
||||
- Changed how ftell() and fseek() are used, double-checking the return
|
||||
value and the errno code.
|
||||
|
||||
- The record locking semaphore could wind up getting added to the public
|
||||
list twice. Fixed.
|
||||
|
||||
- Fixed two linker errors which were caused by duplicate symbol definitions.
|
||||
|
||||
- Added code to the startup routine which allows you to monitor where a command
|
||||
was started from and which parameters it was invoked with.
|
||||
|
||||
- If fread()/fwrite() fail to read/write any data because either the number
|
||||
of records or the size of each record is zero, both now call clearerr() to
|
||||
avoid giving the caller the wrong impression that an EOF or error occured.
|
||||
|
||||
- The libunix.a flavour of system() no longer attempts to translate the name
|
||||
of a command unless it contains path separator characters.
|
||||
|
||||
- Added strtof(), llabs(), lldiv(), vsscanf() and vscanf() for C99.
|
||||
|
||||
- strftime() now supports %C, %n, %r, %R, %t, %T, %u, %V, and %z for C99.
|
||||
And it ignores the E and O modifiers.
|
||||
|
||||
- The printf() family now supports the %hh, %j, %t and %z modifiers and the
|
||||
%a/%A conversions for C99. The %j is treated like %ll; %t and %z are treated
|
||||
like %l. Also, the "infinity"/"not a number" signals now come out as the
|
||||
strings "inf" and "nan".
|
||||
|
||||
- Added HUGE_VALF to <math.h>.
|
||||
|
||||
- For the printf() "%a" conversion the exponent now comes out as a binary
|
||||
number rather than a decimal one. Now how odd is that?
|
||||
|
||||
- strtod() and strtof() now support "inf"/"infinity"/"nan"/"nan(..)" and
|
||||
hexadecimal floating point numbers, for C99.
|
||||
|
||||
- Added the fpclassify(), isfinite(), isnormal() and signbit() macros for C99.
|
||||
|
||||
- Reimplemented isnan() and isinf() as macros for C99. The corresponding
|
||||
functions will be dropped from the library. Note that the isinf() macro
|
||||
does not return -1, 0 or 1 like the old function did, but only 0 or 1
|
||||
depending upon whether the parameter represents +/- infinity or not.
|
||||
|
||||
- Added fabsf() for C99.
|
||||
|
||||
- The scanf() family now supports the %hh, %j, %t and %z modifiers and the
|
||||
%a/%A conversions for C99. The %j is treated like %ll; %t and %z are treated
|
||||
like %l. Also, the "inf"/"infinity"/"nan"/"nan()" keywords are processed.
|
||||
|
||||
- The strftime() %z conversion now prints the time zone difference as a
|
||||
"decimal" number. That is, if the difference is 5 hours and 30 minutes,
|
||||
then %z will now print "530" rather than "330".
|
||||
|
||||
- mktime() now handles one leap second gracefully.
|
||||
|
||||
- Added isblank().
|
||||
|
||||
- Added isunordered(), isgreater(), isgreaterequal(), isless(),
|
||||
islessequal() and islessgreater() to <math.h> for C99.
|
||||
|
||||
- The wchar_t type is now an 'unsigned short' integer (16 bits wide).
|
||||
|
||||
- Added PTRDIFF_MIN/PTRDIFF_MAX, WCHAR_MIN/WCHAR_MAX and
|
||||
WINT_MIN/WINT_MAX to <stdint.h> for C99.
|
||||
|
||||
- Added imaxdiv() and imaxabs() for C99.
|
||||
|
||||
- Added strtoimax() and strtoumax() for C99.
|
||||
|
||||
- Added nextafter() and nextafterf() for C99.
|
||||
|
||||
- Added copysign() and copysignf() for C99.
|
||||
|
||||
- Unless I missed something, clib2 should now be functionally complete
|
||||
with regard to C99, except for the floating point operations covered.
|
||||
These are a major challenge all by themselves, and I wonder both
|
||||
whether they are worth the effort and how one could implement them
|
||||
correctly.
|
||||
|
||||
- fflush() now consistently supports a NULL parameter, causing all
|
||||
streams to be flushed for which this behaviour is defined.
|
||||
|
||||
- The printf() family can now produce output for floating point
|
||||
numbers with more than about 77 characters, provided sufficient
|
||||
memory is available. C99 calls for a minimum of 4095 characters,
|
||||
but we're trying to allocate the space required dynamically.
|
||||
|
||||
|
||||
c.lib 1.191 (9.4.2005)
|
||||
|
||||
- The name of the public record locking semaphore has to be preallocated
|
||||
for OS4 if the AllocSysObject() function is used to create it.
|
||||
|
||||
- Moved the signal block mask and the signal function table out of
|
||||
signal_data.c and into signal_raise.c where they are actually used.
|
||||
This makes it possible to override the default definition of the
|
||||
__check_abort_enabled variable in your own programs.
|
||||
|
||||
- raise() no longer resets the signal handler before it invokes the one
|
||||
currently configured. It merely blocks the delivery of the respective
|
||||
signal to prevent recursion.
|
||||
|
||||
- raise() now drops into abort() if a signal handler is set to
|
||||
SIG_DFL. The exception is in SIGINT delivery, which has the
|
||||
effect of printing a different termination message but otherwise
|
||||
program flow takes the same path as abort().
|
||||
|
||||
- Moved the __UtilityBase/__IUtility variable declarations into
|
||||
a separate file.
|
||||
|
||||
- Simplified the library/open close code in "stdlib_main.c".
|
||||
|
||||
- File descriptors produced by dup() or dup2() now work exactly like
|
||||
the original file descriptors they are duplicates of. I modified the
|
||||
function which maps file descriptor numbers to file descriptor
|
||||
table entries to return the table entries of the original files.
|
||||
|
||||
- In the thread-safe library, duplicated stdin/stdout/stderr
|
||||
descriptors now work like the "real" ones. This is true even if
|
||||
the "real" ones were closed and only their former aliases remain.
|
||||
|
||||
- Invoking fstat() on what maps to a con-handler stream now produces
|
||||
information identifying it as a character special file.
|
||||
|
||||
- Added more code and changes contributed by Peter Bengtsson, thank you
|
||||
very much! This includes the following:
|
||||
|
||||
- Added SSIZE_MAX to <limits.h>.
|
||||
|
||||
- Added <sys/uio.h>, readv() and writev().
|
||||
|
||||
- Cut back the soft link resolution code in lstat().
|
||||
|
||||
- In <fcntl.h> O_NDELAY is now an alias for O_NONBLOCK.
|
||||
|
||||
- Added <complex.h>, carg(), cargf(), cargl(), cimag(), cimagf(),
|
||||
cimagl(), conj(), conjf(), conjl(), creal(), crealf() and creall().
|
||||
|
||||
Note that the C99 support for the complex floating point data
|
||||
types is limited to GCC 3.x for now.
|
||||
|
||||
- Added va_copy() to <stdarg.h>.
|
||||
|
||||
- Added _Exit() to <stdlib.h>.
|
||||
|
||||
- Added <stdbool.h>.
|
||||
|
||||
- Added vfscanf() to <stdio.h>.
|
||||
|
||||
- The stdio locking in fcntl() wasn't working correctly. Fixed.
|
||||
|
||||
- Made the clearerr(), feof() and ferror() macros thread-safe.
|
||||
|
||||
|
||||
c.lib 1.190 (25.3.2005)
|
||||
|
||||
- DoTimer() now calls AllocSysObject() rather than making up
|
||||
a MsgPort locally.
|
||||
|
||||
@ -62,6 +315,80 @@
|
||||
- Introduced new constructor types and changed the overall priority
|
||||
order.
|
||||
|
||||
- Switched over the startup code and the library itself to use
|
||||
constructor/destructor functions for initialization and cleanup
|
||||
purposes.
|
||||
|
||||
- The destructor function invocation code no longer calls
|
||||
setjmp(). This is now done within stdlib_main.c prior to
|
||||
calling the destructor function invocation code.
|
||||
|
||||
- Fixed the SAS/C destructor function prototypes and verified
|
||||
that the constructors/destructors are called in the proper
|
||||
order, too.
|
||||
|
||||
- Aliases of file descriptors are now using the signal semaphore
|
||||
of the original file descriptor.
|
||||
|
||||
- close() did not return 0 if the file descriptor in question
|
||||
was really just an alias. Fixed.
|
||||
|
||||
- Added a feature which makes it possible to have several clients
|
||||
use the standard I/O streams (stdin/stdout/stderr) and have these
|
||||
referring to their process' Input()/Output()/ErrorOutput()
|
||||
streams. This is intended to support the upcoming shared
|
||||
library feature.
|
||||
|
||||
- Turns out that the 68k GCC port does not sort constructor and
|
||||
destructor functions in any way at all. I reimplemented the
|
||||
entire library constructor/destructor functionality to use the
|
||||
same approach as libnix.
|
||||
|
||||
- ftruncate() ended up changing the current file position, contrary
|
||||
to what it is supposed to do. Fixed.
|
||||
|
||||
- fcntl() did not work for sockets. Fixed.
|
||||
|
||||
- Reorganized the local header files, removing redundancies.
|
||||
|
||||
- Dropped unused stub code which is now redundant because of
|
||||
the constructor/destructor mechanism.
|
||||
|
||||
- Moved the call chain printing out of stdlib_main.c and into
|
||||
separate files.
|
||||
|
||||
- Removed some more redundant data from stdlib_main.c.
|
||||
|
||||
- Added the first "real" C99 function: _Exit() ;-)
|
||||
|
||||
- assertion failures early on during program initialization
|
||||
should no longer spell big trouble on account of the stdio
|
||||
data structures possibly not being in a well-defined and
|
||||
initialized state.
|
||||
|
||||
- Turns out that the constructor/destructor calling sequence
|
||||
was still wrongish for the OS4 library. So I had to change
|
||||
it *again*. Which probably means that the 68k library will
|
||||
need further changes...
|
||||
|
||||
- Moved stdlib_main.o into the regular libc.a, at least for
|
||||
the 68k build. The PowerPC build may follow later, provided
|
||||
I manage to get the specs file fixed. Actually, stdlib_main.o
|
||||
is in the libc.a library already. Now about that specs file...
|
||||
|
||||
- Moved the check for the presence of an FPU into the
|
||||
math_init.c code. I am far from certain whether this will
|
||||
have the desired effect, though. Due to how the GNU ld linker
|
||||
works, libraries are scanned once only. And the FPU check will
|
||||
be pulled in only if something references the HUGE_VAL
|
||||
constant.
|
||||
|
||||
- Activated the dormant thread-safe standard input/output/error
|
||||
handling code.
|
||||
|
||||
- Small fixes to fcntl() and select() to cover the thread-safe
|
||||
fd->fd_DefaultFile == ZERO case.
|
||||
|
||||
|
||||
c.lib 1.189 (5.3.2005)
|
||||
|
||||
|
||||
52
library/complex_carg.c
Normal file
52
library/complex_carg.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_carg.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
double
|
||||
carg(double complex z)
|
||||
{
|
||||
return(atan2(IMAG(z),REAL(z)));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_cargf.c
Normal file
52
library/complex_cargf.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_cargf.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float
|
||||
cargf(float complex z)
|
||||
{
|
||||
return(atan2(IMAG(z),REAL(z))); /* ZZZ this really needs to call ata2f(). */
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_cargl.c
Normal file
52
library/complex_cargl.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_cargl.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
long double
|
||||
cargl(long double complex z)
|
||||
{
|
||||
return(atan2(IMAG(z),REAL(z))); /* ZZZ this really needs to call atan2l(). */
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_cimag.c
Normal file
52
library/complex_cimag.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_cimag.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
double
|
||||
cimag(double complex z)
|
||||
{
|
||||
return(IMAG(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_cimagf.c
Normal file
52
library/complex_cimagf.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_cimagf.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float
|
||||
cimagf(float complex z)
|
||||
{
|
||||
return(IMAG(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_cimagl.c
Normal file
52
library/complex_cimagl.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_cimagl.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
long double
|
||||
cimagl(long double complex z)
|
||||
{
|
||||
return(IMAG(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_conj.c
Normal file
52
library/complex_conj.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_conj.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
double complex
|
||||
conj(double complex z)
|
||||
{
|
||||
return(CONJ(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_conjf.c
Normal file
52
library/complex_conjf.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_conjf.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float complex
|
||||
conjf(float complex z)
|
||||
{
|
||||
return(CONJ(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_conjl.c
Normal file
52
library/complex_conjl.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_conjl.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
long double complex
|
||||
conjl(long double complex z)
|
||||
{
|
||||
return(CONJ(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_creal.c
Normal file
52
library/complex_creal.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_creal.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
double
|
||||
creal(double complex z)
|
||||
{
|
||||
return(REAL(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_crealf.c
Normal file
52
library/complex_crealf.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_crealf.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
float
|
||||
crealf(float complex z)
|
||||
{
|
||||
return(REAL(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
52
library/complex_creall.c
Normal file
52
library/complex_creall.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: complex_creall.c,v 1.1 2005-04-03 10:22:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#include "complex_headers.h"
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(COMPLEX_SUPPORT)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
long double
|
||||
creall(long double complex z)
|
||||
{
|
||||
return(REAL(z));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* COMPLEX_SUPPORT */
|
||||
68
library/complex_headers.h
Executable file
68
library/complex_headers.h
Executable file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* $Id: complex_headers.h,v 1.3 2005-05-12 14:50:06 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_HEADERS_H
|
||||
#define _COMPLEX_HEADERS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MATH_FP_SUPPORT_H
|
||||
#include "math_fp_support.h"
|
||||
#endif /* _MATH_FP_SUPPORT_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(FLOATING_POINT_SUPPORT) && defined(__GNUC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <complex.h>
|
||||
#include <math.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define COMPLEX_SUPPORT
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define REAL(z) (__real__ (z))
|
||||
#define IMAG(z) (__imag__ (z))
|
||||
#define CONJ(z) (~(z))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* FLOATING_POINT_SUPPORT && __GNUC__ && __STDC_VERSION__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _COMPLEX_HEADERS_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: crtbegin.c,v 1.8 2005-03-10 13:30:11 obarthel Exp $
|
||||
* $Id: crtbegin.c,v 1.10 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -10,12 +10,9 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef EXEC_TYPES_H
|
||||
#include <exec/types.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
#endif /* EXEC_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -48,16 +45,9 @@ _init(void)
|
||||
void
|
||||
_fini(void)
|
||||
{
|
||||
extern jmp_buf __exit_jmp_buf;
|
||||
|
||||
int num_dtors,i;
|
||||
static int j;
|
||||
|
||||
/* If one of the destructors drops into
|
||||
exit(), processing will continue with
|
||||
the next following destructor. */
|
||||
(void)setjmp(__exit_jmp_buf);
|
||||
|
||||
for(i = 1, num_dtors = 0 ; __DTOR_LIST__[i] != NULL ; i++)
|
||||
num_dtors++;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: ctype_headers.h,v 1.5 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -42,18 +42,25 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_LOCALE_UTILITY_H
|
||||
#include "stdlib_locale_utility.h"
|
||||
#endif /* _STDLIB_LOCALE_UTILITY_H */
|
||||
#ifndef _STDLIB_LOCALEBASE_H
|
||||
#include "stdlib_localebase.h"
|
||||
#endif /* _STDLIB_LOCALEBASE_H */
|
||||
|
||||
#ifndef _STDLIB_UTILITYBASE_H
|
||||
#include "stdlib_utilitybase.h"
|
||||
#endif /* _STDLIB_UTILITYBASE_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <locale.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isalnum.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isalnum.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -55,7 +55,13 @@ isalnum(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsAlNum(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsAlNum(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isalpha.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isalpha.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isalpha(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsAlpha(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsAlpha(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
52
library/ctype_isblank.c
Normal file
52
library/ctype_isblank.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: ctype_isblank.c,v 1.2 2005-05-29 08:19:36 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _CTYPE_HEADERS_H
|
||||
#include "ctype_headers.h"
|
||||
#endif /* _CTYPE_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#undef isblank
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int
|
||||
isblank(int c)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = (c == '\t' || c == ' ');
|
||||
|
||||
return(result);
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_iscntrl.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_iscntrl.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ iscntrl(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsCntrl(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsCntrl(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isdigit.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isdigit.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isdigit(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsDigit(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsDigit(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isgraph.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isgraph.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isgraph(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsGraph(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsGraph(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_islower.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_islower.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ islower(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsLower(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsLower(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isprint.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isprint.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isprint(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsPrint(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsPrint(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_ispunct.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_ispunct.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ ispunct(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsPunct(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsPunct(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isspace.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isspace.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isspace(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsSpace(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsSpace(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isupper.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isupper.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isupper(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsUpper(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsUpper(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_isxdigit.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_isxdigit.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,13 @@ isxdigit(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = IsXDigit(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = IsXDigit(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_tolower.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_tolower.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -49,7 +49,13 @@ tolower(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = ConvToLower(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = ConvToLower(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype_toupper.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: ctype_toupper.c,v 1.4 2005-05-29 09:56:09 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -49,7 +49,13 @@ toupper(int c)
|
||||
{
|
||||
assert( LocaleBase != NULL );
|
||||
|
||||
result = ConvToUpper(__locale_table[LC_CTYPE],(ULONG)c);
|
||||
/* The parameter must be either EOF or in the range of an
|
||||
'unsigned char'. If it's not, then the behaviour is
|
||||
undefined. */
|
||||
if(c != EOF && ((0 <= c && c <= UCHAR_MAX) || ((c + 256) <= UCHAR_MAX)))
|
||||
result = ConvToUpper(__locale_table[LC_CTYPE],(ULONG)(c & 255));
|
||||
else
|
||||
result = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#define VERSION 1
|
||||
#define REVISION 189
|
||||
#define DATE "5.3.2005"
|
||||
#define VERS "debug.lib 1.189"
|
||||
#define VSTRING "debug.lib 1.189 (5.3.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.189 (5.3.2005)"
|
||||
#define REVISION 193
|
||||
#define DATE "4.6.2005"
|
||||
#define VERS "debug.lib 1.193"
|
||||
#define VSTRING "debug.lib 1.193 (4.6.2005)\r\n"
|
||||
#define VERSTAG "\0$VER: debug.lib 1.193 (4.6.2005)"
|
||||
|
||||
@ -1 +1 @@
|
||||
189
|
||||
193
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: debug_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: debug_headers.h,v 1.3 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -36,14 +36,15 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef EXEC_LIBRARIES_H
|
||||
#include <exec/libraries.h>
|
||||
#endif /* EXEC_LIBRARIES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__SASC)
|
||||
|
||||
#include <clib/exec_protos.h>
|
||||
/*#include <pragmas/exec_sysbase_pragmas.h>*/
|
||||
#include <pragmas/exec_pragmas.h>
|
||||
|
||||
LONG RawMayGetChar(VOID);
|
||||
@ -57,7 +58,11 @@ VOID RawPutChar(UBYTE c);
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__amigaos4__)
|
||||
|
||||
#ifndef EXEC_EMULATION_H
|
||||
#include <exec/emulation.h>
|
||||
#endif /* EXEC_EMULATION_H */
|
||||
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/****************************************************************************/
|
||||
@ -106,11 +111,13 @@ VOID RawPutChar(UBYTE c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#include "debug.h"
|
||||
#endif /* _DEBUG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_closedir.c,v 1.8 2005-03-09 10:48:59 obarthel Exp $
|
||||
* $Id: dirent_closedir.c,v 1.13 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -31,24 +31,30 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _STDLIB_MEM_DEBUG_H
|
||||
#include "stdlib_mem_debug.h"
|
||||
#endif /* _STDLIB_MEM_DEBUG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _DIRENT_HEADERS_H
|
||||
#include "dirent_headers.h"
|
||||
#endif /* _DIRENT_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEMORY_H
|
||||
#include "stdlib_memory.h"
|
||||
#endif /* _STDLIB_MEMORY_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_CONSTRUCTOR_H
|
||||
#include "stdlib_constructor.h"
|
||||
#endif /* _STDLIB_CONSTRUCTOR_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Directories being scanned whose locks need to be freed when shutting down. */
|
||||
struct MinList NOCOMMON __directory_list;
|
||||
struct MinList __directory_list;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -82,7 +88,7 @@ __dirent_unlock(void)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
CLIB_CONSTRUCTOR(__dirent_init)
|
||||
CLIB_CONSTRUCTOR(dirent_init)
|
||||
{
|
||||
BOOL success = FALSE;
|
||||
|
||||
@ -102,7 +108,8 @@ CLIB_CONSTRUCTOR(__dirent_init)
|
||||
|
||||
out:
|
||||
|
||||
RETURN(success);
|
||||
SHOWVALUE(success);
|
||||
LEAVE();
|
||||
|
||||
if(success)
|
||||
CONSTRUCTOR_SUCCEED();
|
||||
@ -112,7 +119,7 @@ CLIB_CONSTRUCTOR(__dirent_init)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
CLIB_DESTRUCTOR(__dirent_exit)
|
||||
CLIB_DESTRUCTOR(dirent_exit)
|
||||
{
|
||||
ENTER();
|
||||
|
||||
@ -138,7 +145,7 @@ int
|
||||
closedir(DIR * directory_pointer)
|
||||
{
|
||||
struct DirectoryHandle * dh;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -197,7 +204,7 @@ closedir(DIR * directory_pointer)
|
||||
|
||||
free(dh);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_headers.h,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: dirent_headers.h,v 1.8 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,6 +48,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_PROFILE_H
|
||||
#include "stdlib_profile.h"
|
||||
#endif /* _STDLIB_PROFILE_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_opendir.c,v 1.8 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: dirent_opendir.c,v 1.9 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -37,18 +37,18 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEM_DEBUG_H
|
||||
#include "stdlib_mem_debug.h"
|
||||
#endif /* _STDLIB_MEM_DEBUG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _DIRENT_HEADERS_H
|
||||
#include "dirent_headers.h"
|
||||
#endif /* _DIRENT_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEMORY_H
|
||||
#include "stdlib_memory.h"
|
||||
#endif /* _STDLIB_MEMORY_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_close.c,v 1.10 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: fcntl_close.c,v 1.12 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@ close(int file_descriptor)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -59,7 +59,9 @@ close(int file_descriptor)
|
||||
if(__check_abort_enabled)
|
||||
__check_abort();
|
||||
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
/* We want to affect this very file descriptor and not the
|
||||
original one associated with an alias of it. */
|
||||
fd = __get_file_descriptor_dont_resolve(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
@ -76,7 +78,7 @@ close(int file_descriptor)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_creat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_creat.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
creat(const char * path_name, mode_t mode)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_fcntl.c,v 1.12 2005-03-04 09:07:09 obarthel Exp $
|
||||
* $Id: fcntl_fcntl.c,v 1.18 2005-05-27 13:19:30 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -47,7 +47,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
struct file_action_message fam;
|
||||
struct flock * l;
|
||||
int vacant_slot;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd = NULL;
|
||||
va_list arg;
|
||||
int error;
|
||||
@ -67,6 +67,12 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
if(__check_abort_enabled)
|
||||
__check_abort();
|
||||
|
||||
/* F_DUPFD will need to modify the file descriptor table, which is why
|
||||
the stdio lock needs to be obtained here, before the individual
|
||||
file descriptor lock is held. */
|
||||
if(cmd == F_DUPFD)
|
||||
__stdio_lock();
|
||||
|
||||
fd = __get_file_descriptor(file_descriptor);
|
||||
if(fd == NULL)
|
||||
{
|
||||
@ -78,6 +84,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
|
||||
switch(cmd)
|
||||
{
|
||||
#if defined(UNIX_PATH_SEMANTICS)
|
||||
case F_GETLK:
|
||||
case F_SETLK:
|
||||
case F_SETLKW:
|
||||
@ -90,6 +97,12 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(fd->fd_DefaultFile == ZERO)
|
||||
{
|
||||
__set_errno(EBADF);
|
||||
goto out;
|
||||
}
|
||||
|
||||
va_start(arg,cmd);
|
||||
l = va_arg(arg,struct flock *);
|
||||
va_end(arg);
|
||||
@ -118,27 +131,22 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
case F_GETFL:
|
||||
|
||||
SHOWMSG("cmd=F_GETFL");
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET))
|
||||
{
|
||||
__set_errno(EINVAL);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING))
|
||||
SET_FLAG(result,O_NONBLOCK);
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_ASYNC_IO))
|
||||
SET_FLAG(result,O_ASYNC);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
@ -146,9 +154,10 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
|
||||
SHOWMSG("cmd=F_SETFL");
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET))
|
||||
/* If this is a file, make sure that we don't hit a zero file handle. */
|
||||
if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET) && fd->fd_DefaultFile == ZERO)
|
||||
{
|
||||
__set_errno(EINVAL);
|
||||
__set_errno(EBADF);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -198,7 +207,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
CLEAR_FLAG(fd->fd_Flags,FDF_ASYNC_IO);
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
@ -267,6 +276,9 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
|
||||
__fd_unlock(fd);
|
||||
|
||||
if(cmd == F_DUPFD)
|
||||
__stdio_unlock();
|
||||
|
||||
RETURN(result);
|
||||
return(result);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_get_default_file.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ int
|
||||
__get_default_file(int file_descriptor,long * file_ptr)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
assert( file_descriptor >= 0 && file_descriptor < __num_fd );
|
||||
assert( __fd[file_descriptor] != NULL );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_headers.h,v 1.4 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,4 +48,10 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_PROFILE_H
|
||||
#include "stdlib_profile.h"
|
||||
#endif /* _STDLIB_PROFILE_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _FCNTL_HEADERS_H */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_lock.c,v 1.1 2005-02-28 13:22:53 obarthel Exp $
|
||||
* $Id: fcntl_lock.c,v 1.3 2005-04-01 18:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_lseek.c,v 1.7 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: fcntl_lseek.c,v 1.9 2005-04-24 09:53:11 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ off_t
|
||||
lseek(int file_descriptor, off_t offset, int mode)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
off_t result = -1;
|
||||
off_t result = SEEK_ERROR;
|
||||
off_t position;
|
||||
struct fd * fd;
|
||||
|
||||
@ -83,13 +83,23 @@ lseek(int file_descriptor, off_t offset, int mode)
|
||||
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
/* Note that a return value of -1 (= SEEK_ERROR) may be a
|
||||
valid file position in files larger than 2 GBytes. Just
|
||||
to be sure, we therefore also check the secondary error
|
||||
to verify that what could be a file position is really
|
||||
an error indication. */
|
||||
position = (*fd->fd_Action)(fd,&fam);
|
||||
if(position < 0)
|
||||
if(position == SEEK_ERROR && fam.fam_Error != OK)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* If this is a valid file position, clear 'errno' so that
|
||||
it cannot be mistaken for an error. */
|
||||
if(position < 0)
|
||||
__set_errno(OK);
|
||||
|
||||
result = position;
|
||||
|
||||
out:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_open.c,v 1.14 2005-03-04 09:07:09 obarthel Exp $
|
||||
* $Id: fcntl_open.c,v 1.16 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -37,18 +37,18 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEM_DEBUG_H
|
||||
#include "stdlib_mem_debug.h"
|
||||
#endif /* _STDLIB_MEM_DEBUG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _FCNTL_HEADERS_H
|
||||
#include "fcntl_headers.h"
|
||||
#endif /* _FCNTL_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_MEMORY_H
|
||||
#include "stdlib_memory.h"
|
||||
#endif /* _STDLIB_MEMORY_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
@ -104,7 +104,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
int fd_slot_number;
|
||||
struct fd * fd;
|
||||
int access_mode;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
int i;
|
||||
|
||||
ENTER();
|
||||
@ -456,7 +456,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
|
||||
handle = ZERO;
|
||||
|
||||
assert( result != -1 );
|
||||
assert( result != ERROR );
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_read.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: fcntl_read.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ ssize_t
|
||||
read(int file_descriptor, void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t num_bytes_read;
|
||||
ssize_t result = -1;
|
||||
ssize_t result = EOF;
|
||||
struct fd * fd;
|
||||
|
||||
ENTER();
|
||||
@ -110,7 +110,7 @@ read(int file_descriptor, void * buffer, size_t num_bytes)
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
num_bytes_read = (*fd->fd_Action)(fd,&fam);
|
||||
if(num_bytes_read < 0)
|
||||
if(num_bytes_read == EOF)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_write.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: fcntl_write.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ ssize_t
|
||||
write(int file_descriptor, const void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t num_bytes_written;
|
||||
ssize_t result = -1;
|
||||
ssize_t result = EOF;
|
||||
struct fd * fd;
|
||||
|
||||
ENTER();
|
||||
@ -110,7 +110,7 @@ write(int file_descriptor, const void * buffer, size_t num_bytes)
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
num_bytes_written = (*fd->fd_Action)(fd,&fam);
|
||||
if(num_bytes_written < 0)
|
||||
if(num_bytes_written == EOF)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ftw_ftw.c,v 1.2 2005-03-03 10:59:17 obarthel Exp $
|
||||
* $Id: ftw_ftw.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,34 +45,16 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ftw.h>
|
||||
#include <errno.h>
|
||||
#include <dos.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#include "debug.h"
|
||||
#endif /* _DEBUG_H */
|
||||
|
||||
#ifndef _FTW_HEADERS_H
|
||||
#include "ftw_headers.h"
|
||||
#endif /* _FTW_HEADERS_H */
|
||||
|
||||
#ifndef _STDLIB_PROTOS_H
|
||||
#include "stdlib_protos.h" /* get/set errno. */
|
||||
#endif /* _STDLIB_PROTOS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static int
|
||||
walk(const char *path,int (*func)(const char *,const struct stat *,int),int depth,int level)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@ -127,7 +109,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
dp = opendir(path); /* Also takes care of Unix->Amiga pathname conversion. */
|
||||
if(dp == NULL)
|
||||
{
|
||||
result = -1; /* Pass errno from opendir() */
|
||||
result = ERROR; /* Pass errno from opendir() */
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -138,7 +120,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -171,7 +153,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
int
|
||||
ftw(const char *path,int (*func)(const char *,const struct stat *,int),int depth)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
char *base;
|
||||
int len;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ftw_headers.h,v 1.1 2005-03-02 12:57:53 obarthel Exp $
|
||||
* $Id: ftw_headers.h,v 1.2 2005-03-18 12:38:22 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -36,11 +36,30 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <sys/stat.h>
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ftw.h>
|
||||
#include <errno.h>
|
||||
#include <dos.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _MACROS_H
|
||||
#include "macros.h"
|
||||
#endif /* _MACROS_H */
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#include "debug.h"
|
||||
#endif /* _DEBUG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ftw_nftw.c,v 1.2 2005-03-03 10:59:17 obarthel Exp $
|
||||
* $Id: ftw_nftw.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -44,35 +44,16 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ftw.h>
|
||||
#include <errno.h>
|
||||
#include <dos.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#include "debug.h"
|
||||
#endif /* _DEBUG_H */
|
||||
|
||||
#ifndef _FTW_HEADERS_H
|
||||
#include "ftw_headers.h"
|
||||
#endif /* _FTW_HEADERS_H */
|
||||
|
||||
#ifndef _STDLIB_PROTOS_H
|
||||
#include "stdlib_protos.h" /* get/set errno. */
|
||||
#endif /* _STDLIB_PROTOS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static int
|
||||
walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FTW *),const int depth,int level,const int flags,const int base,int * const prune)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@ -150,7 +131,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
dp = opendir(path); /* Also takes care of Unix->Amiga pathname conversion. */
|
||||
if(dp == NULL)
|
||||
{
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -161,7 +142,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -174,7 +155,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -235,7 +216,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
static int
|
||||
index_of_end_part(const char *path)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
int i;
|
||||
|
||||
i = strlen(path) - 1;
|
||||
@ -260,7 +241,7 @@ nftw(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
int len;
|
||||
int base_index;
|
||||
int prune = 0;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
185
library/include/complex.h
Normal file
185
library/include/complex.h
Normal file
@ -0,0 +1,185 @@
|
||||
/*
|
||||
* $Id: complex.h,v 1.3 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
#define _COMPLEX_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef __GNUC__
|
||||
#error Unsupported compiler.
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#warning C99 header file used in C++.
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if !defined(__STDC_VERSION__) || (__GNUC__ < 3 && __STDC_VERSION__ < 199901L)
|
||||
#error Complex numbers are not supported by/for this compiler.
|
||||
#endif /* __GNUC__ && __STDC_VERSION__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Basic types; imaginary is assumed not to be implemented yet. */
|
||||
#define complex _Complex
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Constants */
|
||||
#define _Complex_I (__extension__ 0.0+1.0fi)
|
||||
#define I _Complex_I
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double creal(double complex z);
|
||||
extern float crealf(float complex z);
|
||||
extern long double creall(long double complex z);
|
||||
|
||||
extern double cimag(double complex z);
|
||||
extern float cimagf(float complex z);
|
||||
extern long double cimagl(long double complex z);
|
||||
|
||||
extern double complex conj(double complex z);
|
||||
extern float complex conjf(float complex z);
|
||||
extern long double complex conjl(long double complex z);
|
||||
|
||||
extern double carg(double complex z);
|
||||
extern float cargf(float complex z);
|
||||
extern long double cargl(long double complex z);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Unimplemented functions (so far)... */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if 0
|
||||
|
||||
extern double complex cacos(double complex z);
|
||||
extern float complex cacosf(float complex z);
|
||||
extern long double complex cacosl(long double complex z);
|
||||
|
||||
extern double complex casin(double complex z);
|
||||
extern float complex casinf(float complex z);
|
||||
extern long double complex casinl(long double complex z);
|
||||
|
||||
extern double complex catan(double complex z);
|
||||
extern float complex catanf(float complex z);
|
||||
extern long double complex catanl(long double complex z);
|
||||
|
||||
extern double complex ccos(double complex z);
|
||||
extern float complex ccosf(float complex z);
|
||||
extern long double complex ccosl(long double complex z);
|
||||
|
||||
extern double complex csin(double complex z);
|
||||
extern float complex csinf(float complex z);
|
||||
extern long double complex csinl(long double complex z);
|
||||
|
||||
extern double complex ctan(double complex z);
|
||||
extern float complex ctanf(float complex z);
|
||||
extern long double complex ctanl(long double complex z);
|
||||
|
||||
extern double complex cacosh(double complex z);
|
||||
extern float complex cacoshf(float complex z);
|
||||
extern long double complex cacoshl(long double complex z);
|
||||
|
||||
extern double complex casinh(double complex z);
|
||||
extern float complex casinhf(float complex z);
|
||||
extern long double complex casinhl(long double complex z);
|
||||
|
||||
extern double complex catanh(double complex z);
|
||||
extern float complex catanhf(float complex z);
|
||||
extern long double complex catanhl(long double complex z);
|
||||
|
||||
extern double complex ccosh(double complex z);
|
||||
extern float complex ccoshf(float complex z);
|
||||
extern long double complex ccoshl(long double complex z);
|
||||
|
||||
extern double complex csinh(double complex z);
|
||||
extern float complex csinhf(float complex z);
|
||||
extern long double complex csinhl(long double complex z);
|
||||
|
||||
extern double complex ctanh(double complex z);
|
||||
extern float complex ctanhf(float complex z);
|
||||
extern long double complex ctanhl(long double complex z);
|
||||
|
||||
extern double complex cexp(double complex z);
|
||||
extern float complex cexpf(float complex z);
|
||||
extern long double complex cexpl(long double complex z);
|
||||
|
||||
extern double complex clog(double complex z);
|
||||
extern float complex clogf(float complex z);
|
||||
extern long double complex clogl(long double complex z);
|
||||
|
||||
extern double cabs(double complex z);
|
||||
extern float cabsf(float complex z);
|
||||
extern long double cabsl(long double complex z);
|
||||
|
||||
extern double complex cpow(double complex z);
|
||||
extern float complex cpowf(float complex z);
|
||||
extern long double complex cpowl(long double complex z);
|
||||
|
||||
extern double complex csqrt(double complex z);
|
||||
extern float complex csqrtf(float complex z);
|
||||
extern long double complex csqrtl(long double complex z);
|
||||
|
||||
extern double complex cproj(double complex z);
|
||||
extern float complex cprojf(float complex z);
|
||||
extern long double complex cprojl(long double complex z);
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _COMPLEX_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ctype.h,v 1.5 2005-01-09 15:20:33 obarthel Exp $
|
||||
* $Id: ctype.h,v 1.6 2005-05-11 20:15:28 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -57,6 +57,7 @@ extern int islower(int c);
|
||||
extern int isupper(int c);
|
||||
|
||||
extern int isspace(int c);
|
||||
extern int isblank(int c);
|
||||
|
||||
extern int tolower(int c);
|
||||
extern int toupper(int c);
|
||||
@ -99,6 +100,7 @@ extern const unsigned char __ctype_table[];
|
||||
#define islower(c) ((__ctype_table[(c) & 255] & __CTYPE_LOWER_CASE) != 0)
|
||||
#define isupper(c) ((__ctype_table[(c) & 255] & __CTYPE_UPPER_CASE) != 0)
|
||||
#define isspace(c) ((__ctype_table[(c) & 255] & __CTYPE_WHITE_SPACE) != 0)
|
||||
#define isblank(c) ((c) == ' ' || (c) == '\t')
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
|
||||
* $Id: fcntl.h,v 1.5 2005-04-03 10:22:48 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -65,6 +65,7 @@ extern "C" {
|
||||
#define O_EXCL (1<<4)
|
||||
#define O_TRUNC (1<<5)
|
||||
#define O_NONBLOCK (1<<6)
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
#define O_SYNC (0)
|
||||
#define O_NOCTTY (0)
|
||||
#define O_ASYNC (1<<7)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: inttypes.h,v 1.1 2005-02-04 15:03:13 obarthel Exp $
|
||||
* $Id: inttypes.h,v 1.2 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,6 +50,12 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* printf() format specifications for different types. */
|
||||
|
||||
/* "Decimal" */
|
||||
@ -162,7 +168,7 @@
|
||||
|
||||
/* intmax_t is 32 bits for SAS/C, 64-bits for GCC or if using a conforming C99 compiler. */
|
||||
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define PRIdMAX "lld"
|
||||
#define PRIiMAX "lli"
|
||||
#define PRIuMAX "llu"
|
||||
@ -176,22 +182,22 @@
|
||||
#define PRIxMAX "lx"
|
||||
#define PRIXMAX "lX"
|
||||
#define PRIoMAX "lo"
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
/* scanf() format specifiers. */
|
||||
|
||||
/* "Decimal" */
|
||||
/* #define SCNd8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNd8 "hhd"
|
||||
#define SCNd16 "hd"
|
||||
#define SCNd32 "d"
|
||||
#define SCNd64 "lld"
|
||||
|
||||
/* #define SCNdLEAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNdLEAST8 "hhd"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNdLEAST32 "d"
|
||||
#define SCNdLEAST64 "lld"
|
||||
|
||||
/* #define SCNdFAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNdFAST8 "hhd"
|
||||
#define SCNdFAST16 "d"
|
||||
#define SCNdFAST32 "d"
|
||||
#define SCNdFAST64 "lld"
|
||||
@ -199,17 +205,17 @@
|
||||
#define SCNdPTR "d"
|
||||
|
||||
/* "Integer" */
|
||||
/* #define SCNi8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNi8 "hhi"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNi32 "i"
|
||||
#define SCNi64 "lli"
|
||||
|
||||
/* #define SCNiLEAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNiLEAST8 "hhi"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNiLEAST32 "i"
|
||||
#define SCNiLEAST64 "lli"
|
||||
|
||||
/* #define SCNiFAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNiFAST8 "hhi"
|
||||
#define SCNiFAST16 "i"
|
||||
#define SCNiFAST32 "i"
|
||||
#define SCNiFAST64 "lli"
|
||||
@ -217,17 +223,17 @@
|
||||
#define SCNiPTR "i"
|
||||
|
||||
/* "Unsigned" */
|
||||
/* #define SCNu8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNu8 "hhu"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNu32 "u"
|
||||
#define SCNu64 "llu"
|
||||
|
||||
/* #define SCNuLEAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNuLEAST8 "hhu"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNuLEAST32 "u"
|
||||
#define SCNuLEAST64 "llu"
|
||||
|
||||
/* #define SCNuFAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNuFAST8 "hhu"
|
||||
#define SCNuFAST16 "u"
|
||||
#define SCNuFAST32 "u"
|
||||
#define SCNuFAST64 "llu"
|
||||
@ -235,17 +241,17 @@
|
||||
#define SCNuPTR "u"
|
||||
|
||||
/* "Hexadecimal" */
|
||||
/* #define SCNx8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNx8 "hhx"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNx32 "x"
|
||||
#define SCNx64 "llx"
|
||||
|
||||
/* #define SCNxLEAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNxLEAST8 "hhx"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNxLEAST32 "x"
|
||||
#define SCNxLEAST64 "llx"
|
||||
|
||||
/* #define SCNxFAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNxFAST8 "hhx"
|
||||
#define SCNxFAST16 "x"
|
||||
#define SCNxFAST32 "x"
|
||||
#define SCNxFAST64 "llx"
|
||||
@ -253,24 +259,24 @@
|
||||
#define SCNxPTR "x"
|
||||
|
||||
/* "Octal" */
|
||||
/* #define SCNo8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNo8 "hho"
|
||||
#define SCNo16 "ho"
|
||||
#define SCNo32 "o"
|
||||
#define SCNo64 "llo"
|
||||
|
||||
/* #define SCNoLEAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNoLEAST8 "hho"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNoLEAST32 "o"
|
||||
#define SCNoLEAST64 "llo"
|
||||
|
||||
/* #define SCNoFAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
|
||||
#define SCNoFAST8 "hho"
|
||||
#define SCNoFAST16 "o"
|
||||
#define SCNoFAST32 "o"
|
||||
#define SCNoFAST64 "llo"
|
||||
|
||||
#define SCNoPTR "o"
|
||||
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define SCNdMAX "lld"
|
||||
#define SCNiMAX "lli"
|
||||
#define SCNuMAX "llu"
|
||||
@ -282,14 +288,30 @@
|
||||
#define SCNuMAX "lu"
|
||||
#define SCNxMAX "lx"
|
||||
#define SCNoMAX "lo"
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
/* TODO: Add the rest of inttypes.h here + in the library. */
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Missing stuff is among other things atoll(), strtoll(), ...
|
||||
* Then there is the matter of wchar support - Zzzz.
|
||||
*/
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
typedef struct { long long quot; long long rem; } imaxdiv_t;
|
||||
#else
|
||||
typedef struct { long quot; long rem; } imaxdiv_t;
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern intmax_t imaxabs(intmax_t x);
|
||||
extern imaxdiv_t imaxdiv(intmax_t n,intmax_t d);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern intmax_t strtoimax(const char *str, char **ptr, int base);
|
||||
extern uintmax_t strtoumax(const char *str, char **ptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern intmax_t wcstoimax(const wchar_t *str, char **ptr, int base);
|
||||
extern uintmax_t wcstoumax(const wchar_t *str, char **ptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: limits.h,v 1.5 2005-01-09 09:40:33 obarthel Exp $
|
||||
* $Id: limits.h,v 1.8 2005-06-04 10:46:23 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -83,13 +83,26 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define LLONG_MIN (-0x7fffffffffffffffLL-1)
|
||||
#define LLONG_MAX 0x7fffffffffffffffLL
|
||||
#define ULLONG_MAX 0xffffffffffffffffULL
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MB_LEN_MAX 1
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define LLONG_MIN (-0x7fffffffffffffffLL-1)
|
||||
#define LLONG_MAX 0x7fffffffffffffffLL
|
||||
#define ULLONG_MAX 0xffffffffffffffffULL
|
||||
#define SSIZE_MAX 2147483647L
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -97,4 +110,63 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define WORD_BIT 32
|
||||
#define LONG_BIT 32 /* For now, at least. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* POSIX, POSIX... These are minimum maximum values. I.e. the maximum must be
|
||||
* at least this large. I am not sure all of these make much sense on the Amiga
|
||||
* (yet), but here they are anyway.
|
||||
*
|
||||
* Actually, these symbols should be defined only if the preprocessor symbol
|
||||
* _POSIX_SOURCE is defined. Other symbols which should be defined, too, are
|
||||
* ARG_MAX, CHILD_MAX, LINK_MAX, MAX_CANON, MAX_INPUT, NAME_MAX, NGROUPS_MAX,
|
||||
* OPEN_MAX, PATH_MAX, PIPE_BUF, SSIZE_MAX, STREAM_MAX and TZNAME_MAX.
|
||||
*/
|
||||
|
||||
#define _POSIX_AIO_LISTIO_MAX 2
|
||||
#define _POSIX_AIO_MAX 1
|
||||
#define _POSIX_ARG_MAX 4096
|
||||
#define _POSIX_CHILD_MAX 6
|
||||
#define _POSIX_DELAYTIMER_MAX 32
|
||||
#define _POSIX_LINK_MAX 8
|
||||
#define _POSIX_LOGIN_NAME_MAX 9
|
||||
#define _POSIX_MAX_CANON 255
|
||||
#define _POSIX_MAX_INPUT 255
|
||||
#define _POSIX_MQ_OPEN_MAX 8
|
||||
#define _POSIX_MQ_PRIO_MAX 32
|
||||
#define _POSIX_NAME_MAX 14
|
||||
#define _POSIX_NGROUPS_MAX 0
|
||||
#define _POSIX_OPEN_MAX 16
|
||||
#define _POSIX_PATH_MAX 255
|
||||
#define _POSIX_PIPE_BUF 512
|
||||
#define _POSIX_RTSIG_MAX 8
|
||||
#define _POSIX_SEM_NSEMS_MAX 256
|
||||
#define _POSIX_SEM_VALUE_MAX 32767
|
||||
#define _POSIX_SIGQUEUE_MAX 32
|
||||
#define _POSIX_SSIZE_MAX 32767
|
||||
#define _POSIX_STREAM_MAX 8
|
||||
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
|
||||
#define _POSIX_THREAD_KEYS_MAX 128
|
||||
#define _POSIX_THREADS_MAX 64
|
||||
#define _POSIX_TIMER_MAX 32
|
||||
#define _POSIX_TTY_NAME_MAX 9
|
||||
#define _POSIX_TZNAME_MAX 3
|
||||
#define _POSIX2_BC_BASE_MAX 99
|
||||
#define _POSIX2_BC_DIM_MAX 2048
|
||||
#define _POSIX2_BC_SCALE_MAX 99
|
||||
#define _POSIX2_BC_STRING_MAX 1000
|
||||
#define _POSIX2_COLL_WEIGHTS_MAX 2
|
||||
#define _POSIX2_EXPR_NEST_MAX 32
|
||||
#define _POSIX2_LINE_MAX 2048
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
#define _XOPEN_IOV_MAX 16
|
||||
|
||||
/* And a maximum minimum value. */
|
||||
#define _POSIX_CLOCKRES_MIN 20000000 /* Nanoseconds */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _LIMITS_H */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: math.h,v 1.6 2005-02-25 10:14:22 obarthel Exp $
|
||||
* $Id: math.h,v 1.15 2005-05-30 08:47:41 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -101,12 +101,199 @@ extern double tanh(double x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double rint(double x);
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Note that the comparison operations performed on the floating point
|
||||
data types ought to include float, double and long double. However,
|
||||
because the current (2005-06-12) compiler technology available on the
|
||||
Amiga does not support the long double type yet, this library is
|
||||
restricted to operations on float and double. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float __huge_val_float;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define HUGE_VALF ((const float)__huge_val_float)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float __infinity;
|
||||
extern float __nan;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define INFINITY ((const float)__infinity)
|
||||
#define NAN ((const float)__nan)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define FP_INFINITE 0 /* -/+ infinity */
|
||||
#define FP_NAN 1 /* not a number */
|
||||
#define FP_NORMAL 2 /* normalized floating point number */
|
||||
#define FP_SUBNORMAL 3 /* very small floating point number; special
|
||||
case of IEEE 754 */
|
||||
#define FP_ZERO 4 /* exponent/fraction are zero */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int __fpclassify_float(float x);
|
||||
extern int __fpclassify_double(double x);
|
||||
extern int __isfinite_float(float x);
|
||||
extern int __isfinite_double(double x);
|
||||
extern int __signbit_float(float x);
|
||||
extern int __signbit_double(double x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define fpclassify(x) \
|
||||
(sizeof(x) == sizeof(float) ? \
|
||||
__fpclassify_float(x) : \
|
||||
__fpclassify_double(x))
|
||||
|
||||
#define isfinite(x) \
|
||||
(sizeof(x) == sizeof(float) ? \
|
||||
__isfinite_float(x) : \
|
||||
__isfinite_double(x))
|
||||
|
||||
#define isinf(x) \
|
||||
((sizeof(x) == sizeof(float) ? \
|
||||
__fpclassify_float(x) : \
|
||||
__fpclassify_double(x)) \
|
||||
== FP_INFINITE)
|
||||
|
||||
#define isnan(x) \
|
||||
((sizeof(x) == sizeof(float) ? \
|
||||
__fpclassify_float(x) : \
|
||||
__fpclassify_double(x)) \
|
||||
== FP_NAN)
|
||||
|
||||
#define isnormal(x) \
|
||||
((sizeof(x) == sizeof(float) ? \
|
||||
__fpclassify_float(x) : \
|
||||
__fpclassify_double(x)) \
|
||||
== FP_NORMAL)
|
||||
|
||||
#define signbit(x) \
|
||||
(sizeof(x) == sizeof(float) ? \
|
||||
__signbit_float(x) : \
|
||||
__signbit_double(x))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int __isunordered_float(float x,float y);
|
||||
extern int __isunordered_float_double(float x,double y);
|
||||
extern int __isunordered_double(double x,double y);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define isunordered(x,y) \
|
||||
(sizeof(x) == sizeof(float) ? \
|
||||
(sizeof(y) == sizeof(float) ? \
|
||||
__isunordered_float((x),y) : \
|
||||
__isunordered_float_double((x),(y))) : \
|
||||
(sizeof(y) == sizeof(float) ? \
|
||||
__isunordered_float_double((y),(x)) : \
|
||||
__isunordered_double((x),(y))))
|
||||
|
||||
#define isgreater(x,y) \
|
||||
(isunordered(x,y) ? 0 : (x) > (y))
|
||||
|
||||
#define isgreaterequal(x,y) \
|
||||
(isunordered(x,y) ? 0 : (x) >= (y))
|
||||
|
||||
#define isless(x,y) \
|
||||
(isunordered(x,y) ? 0 : (x) < (y))
|
||||
|
||||
#define islessequal(x,y) \
|
||||
(isunordered(x,y) ? 0 : (x) <= (y))
|
||||
|
||||
#define islessgreater(x,y) \
|
||||
(isunordered(x,y) ? 0 : (x) < (y) || (x) > (y)) /* ZZZ don't evaluate twice! */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float acosf(float x);
|
||||
extern float asinf(float x);
|
||||
extern float atanf(float x);
|
||||
extern float atan2f(float y, float x);
|
||||
extern float ceilf(float x);
|
||||
extern float cosf(float x);
|
||||
extern float coshf(float x);
|
||||
extern float expf(float x);
|
||||
extern float fabsf(float x);
|
||||
extern float floorf(float x);
|
||||
extern float fmodf(float x, float y);
|
||||
extern float frexpf(float x, int *eptr);
|
||||
extern float ldexpf(float x,int exp);
|
||||
extern float logf(float x);
|
||||
extern float log10f(float x);
|
||||
extern float modff(float x, float *iptr);
|
||||
extern float powf(float x, float y);
|
||||
extern float sinf(float x);
|
||||
extern float sinhf(float x);
|
||||
extern float sqrtf(float x);
|
||||
extern float tanf(float x);
|
||||
extern float tanhf(float x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float acoshf(float x);
|
||||
extern float asinhf(float x);
|
||||
extern float cbrtf(float x);
|
||||
extern float copysignf(float x, float y);
|
||||
extern float erfcf(float x);
|
||||
extern float erff(float x);
|
||||
extern float expm1f(float x);
|
||||
extern float fdimf(float x,float y);
|
||||
extern float fmaxf(float x,float y);
|
||||
extern float fminf(float x,float y);
|
||||
extern float hypotf(float x, float y);
|
||||
extern float lgammaf(float x);
|
||||
extern float log1pf(float x);
|
||||
extern float logbf(float x);
|
||||
extern float nanf(const char *tagp);
|
||||
extern float nextafterf(float x,float y);
|
||||
extern float remainderf(float x, float p);
|
||||
extern float rintf(float x);
|
||||
extern int isinf(double x);
|
||||
extern int isnan(double x);
|
||||
extern double logb(double x);
|
||||
extern float scalbnf (float x, int n);
|
||||
extern int ilogbf(float x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double acosh(double x);
|
||||
extern double asinh(double x);
|
||||
extern double cbrt(double x);
|
||||
extern double copysign(double x, double y);
|
||||
extern double erf(double x);
|
||||
extern double erfc(double x);
|
||||
extern double expm1(double x);
|
||||
extern double fdim(double x,double y);
|
||||
extern double fmax(double x,double y);
|
||||
extern double fmin(double x,double y);
|
||||
extern double hypot(double x,double y);
|
||||
extern double lgamma(double x);
|
||||
extern double log1p(double x);
|
||||
extern double logb(double x);
|
||||
extern double nan(const char *tagp);
|
||||
extern double nextafter(double x,double y);
|
||||
extern double remainder(double x, double p);
|
||||
extern double rint(double x);
|
||||
extern double scalbn (double x, int n);
|
||||
extern int ilogb(double x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define FLT_EVAL_METHOD 0
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef float float_t;
|
||||
typedef double double_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
|
||||
* $Id: signal.h,v 1.5 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -62,6 +62,15 @@ extern int raise(int sig);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef int sig_atomic_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
@ -76,10 +85,6 @@ typedef void (*sig_t)(int);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef int sig_atomic_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef int sigset_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdarg.h,v 1.3 2005-01-02 09:07:21 obarthel Exp $
|
||||
* $Id: stdarg.h,v 1.4 2005-04-03 10:22:48 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -56,6 +56,15 @@ typedef char * va_list;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following macro is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define va_copy(dst,src) ((void)((dst) = (src)))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#else
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
81
library/include/stdbool.h
Normal file
81
library/include/stdbool.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* $Id: stdbool.h,v 1.2 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _STDBOOL_H
|
||||
#define _STDBOOL_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__cplusplus) && defined(__GNUC__)
|
||||
#warning C99 header used in C++.
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
|
||||
#warning C99 header file used by non-C99 compliant compiler.
|
||||
#endif /* !__STDC_VERSION__ || __STDC_VERSION__ < 199901L */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define bool _Bool
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define __bool_true_and_false_are_defined 1
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDBOOL_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stddef.h,v 1.3 2005-01-08 10:21:28 obarthel Exp $
|
||||
* $Id: stddef.h,v 1.4 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@ extern "C" {
|
||||
|
||||
typedef int ptrdiff_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned int wchar_t;
|
||||
typedef unsigned short wchar_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdint.h,v 1.1 2005-02-04 15:03:14 obarthel Exp $
|
||||
* $Id: stdint.h,v 1.2 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -77,8 +77,7 @@ typedef unsigned int uint_fast32_t;
|
||||
typedef signed long intptr_t;
|
||||
typedef unsigned long uintptr_t;
|
||||
|
||||
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef signed long long int_least64_t;
|
||||
@ -87,10 +86,10 @@ typedef signed long long int_fast64_t;
|
||||
typedef unsigned long long uint_fast64_t;
|
||||
typedef signed long long intmax_t;
|
||||
typedef unsigned long long uintmax_t;
|
||||
#else /* No 64-bit types for SAS/C */
|
||||
#else
|
||||
typedef signed long intmax_t;
|
||||
typedef unsigned long uintmax_t;
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#define INT8_MIN SCHAR_MIN
|
||||
#define INT8_MAX SCHAR_MAX
|
||||
@ -101,11 +100,11 @@ typedef unsigned long uintmax_t;
|
||||
#define INT32_MIN INT_MIN
|
||||
#define INT32_MAX INT_MAX
|
||||
#define UINT32_MAX UINT_MAX
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define INT64_MIN LLONG_MIN
|
||||
#define INT64_MAX LLONG_MAX
|
||||
#define UINT64_MAX ULLONG_MAX
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#define INT_LEAST8_MIN SCHAR_MIN
|
||||
#define INT_LEAST8_MAX SCHAR_MAX
|
||||
@ -116,11 +115,11 @@ typedef unsigned long uintmax_t;
|
||||
#define INT_LEAST32_MIN INT_MIN
|
||||
#define INT_LEAST32_MAX INT_MAX
|
||||
#define UINT_LEAST32_MAX UINT_MAX
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define INT_LEAST64_MIN LLONG_MIN
|
||||
#define INT_LEAST64_MAX LLONG_MAX
|
||||
#define UINT_LEAST64_MAX ULLONG_MAX
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#define INT_FAST8_MIN SCHAR_MIN
|
||||
#define INT_FAST8_MAX SCHAR_MAX
|
||||
@ -131,17 +130,17 @@ typedef unsigned long uintmax_t;
|
||||
#define INT_FAST32_MIN INT_MIN
|
||||
#define INT_FAST32_MAX INT_MAX
|
||||
#define UINT_FAST32_MAX UINT_MAX
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define INT_FAST64_MIN LLONG_MIN
|
||||
#define INT_FAST64_MAX LLONG_MAX
|
||||
#define UINT_FAST64_MAX ULLONG_MAX
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#define INTPTR_MIN LONG_MIN
|
||||
#define INTPTR_MAX LONG_MAX
|
||||
#define UINTPTR_MAX ULONG_MAX
|
||||
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define INTMAX_MIN LLONG_MIN
|
||||
#define INTMAX_MAX LLONG_MAX
|
||||
#define UINTMAX_MAX ULLONG_MAX
|
||||
@ -149,9 +148,9 @@ typedef unsigned long uintmax_t;
|
||||
#define INTMAX_MIN LONG_MIN
|
||||
#define INTMAX_MAX LONG_MAX
|
||||
#define UINTMAX_MAX ULONG_MAX
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#if !defined(__cpluspluis) || defined(__STDC_LIMIT_MACROS)
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
|
||||
/* sigatomic_t is an int. */
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
@ -171,16 +170,27 @@ typedef unsigned long uintmax_t;
|
||||
#define UINT32_C(x) x ## U
|
||||
#define UINT64_C(x) x ## ULL
|
||||
|
||||
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
#define INTMAX_C(x) x ## LL
|
||||
#define UINTMAX_C(x) x ## ULL
|
||||
#else
|
||||
#define INTMAX_C(x) x ## L
|
||||
#define UINTMAX_C(x) x ## UL
|
||||
#endif
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
#endif /* not C++ or CONSTANT_MACROS */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define PTRDIFF_MIN INT_MIN
|
||||
#define PTRDIFF_MAX INT_MAX
|
||||
|
||||
#define WCHAR_MIN 0
|
||||
#define WCHAR_MAX USHRT_MAX
|
||||
|
||||
#define WINT_MIN INT_MIN
|
||||
#define WINT_MAX INT_MAX
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDINT_H */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio.h,v 1.9 2005-03-06 09:04:44 obarthel Exp $
|
||||
* $Id: stdio.h,v 1.15 2005-06-04 10:46:23 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -306,12 +306,30 @@ extern char *tmpnam(char *buf);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__THREAD_SAFE)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define clearerr(file) ((void)(flockfile(file), (file)->flags &= ~(__FILE_EOF|__FILE_ERROR), funlockfile(file)))
|
||||
#define feof(file) (flockfile(file), __unlockfile((file),((file)->flags & __FILE_EOF) != 0))
|
||||
#define ferror(file) (flockfile(file), __unlockfile((file),((file)->flags & __FILE_ERROR) != 0))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#else
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define clearerr(file) ((void)((file)->flags &= ~(__FILE_EOF|__FILE_ERROR)))
|
||||
#define feof(file) (((file)->flags & __FILE_EOF) != 0)
|
||||
#define ferror(file) (((file)->flags & __FILE_ERROR) != 0)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __THREAD_SAFE */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __C_MACROS__ */
|
||||
|
||||
/****************************************************************************/
|
||||
@ -324,6 +342,14 @@ extern char *tmpnam(char *buf);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define L_ctermid 32
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char *ctermid(char *);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* A special buffer flush routine which returns the last character written
|
||||
* in case of success and EOF in case of failure. This is used by the
|
||||
@ -359,7 +385,6 @@ extern int putchar_unlocked(int c);
|
||||
extern FILE * fdopen(int file_descriptor, const char * type);
|
||||
extern int fileno(FILE * file);
|
||||
extern int asprintf(char **ret, const char *format, ...);
|
||||
extern int snprintf(char *s,size_t size,const char *format,...);
|
||||
extern int vsnprintf(char *s,size_t size,const char *format,va_list arg);
|
||||
extern int pclose(FILE *stream);
|
||||
extern FILE * popen(const char *command, const char *type);
|
||||
@ -400,6 +425,18 @@ extern int __vasprintf(const char *file,int line,char **ret,const char *format,v
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int vfscanf(FILE *stream, const char *format, va_list arg);
|
||||
extern int vsscanf(const char *s, const char *format, va_list arg);
|
||||
extern int vscanf(const char *format,va_list arg);
|
||||
extern int snprintf(char *s,size_t size,const char *format,...);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib.h,v 1.8 2005-03-02 12:57:56 obarthel Exp $
|
||||
* $Id: stdlib.h,v 1.11 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
/****************************************************************************/
|
||||
|
||||
/* Maximum number of bytes in a multibyte character */
|
||||
#define MB_CUR_MAX 4
|
||||
#define MB_CUR_MAX 2
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
@ -153,16 +153,6 @@ extern int rand_r(unsigned int * seed);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* These functions are unavailable under SAS/C for lack of a
|
||||
"long long" data type. */
|
||||
#if ! defined(__SASC)
|
||||
extern long long strtoll(const char *str, char **ptr, int base);
|
||||
extern unsigned long long strtoull(const char *str, char **ptr, int base);
|
||||
extern long long atoll(const char *str);
|
||||
#endif /* __SASC */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#undef alloca
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
@ -187,6 +177,42 @@ extern char * mkdtemp(char *name_template);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__GNUC__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern long long strtoll(const char *str, char **ptr, int base);
|
||||
extern unsigned long long strtoull(const char *str, char **ptr, int base);
|
||||
extern long long atoll(const char *str);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef struct { long long quot; long long rem; } lldiv_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern long long llabs(long long x);
|
||||
extern lldiv_t lldiv(long long n,long long d);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __GNUC__ || (__STDC_VERSION__ && __STDC_VERSION__ >= 199901L) */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern float strtof(const char *str, char ** ptr);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void _Exit(int status);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
63
library/include/sys/clib2_stdc.h
Normal file
63
library/include/sys/clib2_stdc.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* $Id: clib2_stdc.h,v 1.1 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CLIB2_STDC_H
|
||||
#define _SYS_CLIB2_STDC_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Make the "restrict" qualifier work well with 'C' compilers that do
|
||||
not support it. We do assume that __STDC__ is defined, though. */
|
||||
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
|
||||
#define restrict
|
||||
#endif /* !__STDC_VERSION__ || __STDC_VERSION__ < 199901L */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_CLIB2_STDC_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat.h,v 1.4 2005-03-10 11:40:57 obarthel Exp $
|
||||
* $Id: stat.h,v 1.5 2005-04-02 13:25:55 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -88,22 +88,23 @@ extern "C" {
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define S_IFMT 0170000 /* type of file */
|
||||
#define S_IFIFO 0010000 /* named pipe (fifo) */
|
||||
#define S_IFDIR 0040000 /* directory */
|
||||
#define S_IFBLK 0060000 /* block special */
|
||||
#define S_IFREG 0100000 /* regular */
|
||||
#define S_IFLNK 0120000 /* symbolic link */
|
||||
#define S_IFSOCK 0140000 /* socket */
|
||||
#define S_IFMT 0170000 /* type of file */
|
||||
#define S_IFIFO 0010000 /* named pipe (fifo) */
|
||||
#define S_IFCHR 0020000 /* character special */
|
||||
#define S_IFDIR 0040000 /* directory */
|
||||
#define S_IFBLK 0060000 /* block special */
|
||||
#define S_IFREG 0100000 /* regular */
|
||||
#define S_IFLNK 0120000 /* symbolic link */
|
||||
#define S_IFSOCK 0140000 /* socket */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */
|
||||
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* char special */
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* symbolic link */
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo */
|
||||
#define S_ISBLK(m) (0) /* block special */
|
||||
#define S_ISCHR(m) (0) /* character special */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_mem_debug.h,v 1.2 2005-01-02 09:07:18 obarthel Exp $
|
||||
* $Id: uio.h,v 1.1 2005-04-03 10:22:48 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -31,60 +31,54 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _STDLIB_MEM_DEBUG_H
|
||||
#define _STDLIB_MEM_DEBUG_H
|
||||
#ifndef _SYS_UIO_H
|
||||
#define _SYS_UIO_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Uncomment this to build a library which has the memory debugging features
|
||||
* enabled.
|
||||
* The size of MAX_IOVEC is rather arbitrary since there is no kernel support
|
||||
* for vectored I/O and even a single struct iovec can overflow a ssize_t.
|
||||
*/
|
||||
/*#define __MEM_DEBUG */
|
||||
#define MAX_IOVEC 1024
|
||||
|
||||
typedef struct iovec
|
||||
{
|
||||
void * iov_base;
|
||||
size_t iov_len;
|
||||
} iovec_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Uncomment this to see reports of where and how much memory is allocated
|
||||
* or released.
|
||||
*/
|
||||
/*#define __MEM_DEBUG_LOG*/
|
||||
extern ssize_t readv(int file_descriptor,const struct iovec *iov,int vec_count);
|
||||
extern ssize_t writev(int file_descriptor,const struct iovec *iov,int vec_count);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Uncomment this to speed up memory data maintenance operations when
|
||||
* the memory debugging mode is enabled.
|
||||
*/
|
||||
/*#define __USE_MEM_TREES*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Memory debugging parameters; note that the head/tail size must be
|
||||
* multiples of four, or you will break code that depends upon malloc()
|
||||
* and friends to return long word aligned data structures! Better
|
||||
* still, there are assert()s in the library which will blow your code
|
||||
* out of the water if the data returned by malloc() and realloc() is
|
||||
* not long word aligned...
|
||||
*/
|
||||
|
||||
#define MALLOC_HEAD_SIZE 512 /* How many bytes to allocate in front of
|
||||
each memory chunk */
|
||||
#define MALLOC_TAIL_SIZE 512 /* How many bytes to allocate behind each
|
||||
memory chunk */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MALLOC_NEW_FILL 0xA3 /* The byte value to fill newly created
|
||||
memory allocations with */
|
||||
#define MALLOC_FREE_FILL 0xA5 /* The byte value to fill freed memory
|
||||
allocations with */
|
||||
#define MALLOC_HEAD_FILL 0xA7 /* The byte value to fill the memory in
|
||||
front of each allocation with */
|
||||
#define MALLOC_TAIL_FILL 0xA9 /* The byte value to fill the memory behind
|
||||
each allocation with */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDLIB_MEM_DEBUG_H */
|
||||
#endif /* _SYS_UIO_H */
|
||||
189
library/include/termios.h
Normal file
189
library/include/termios.h
Normal file
@ -0,0 +1,189 @@
|
||||
/*
|
||||
* $Id: termios.h,v 1.1 2005-06-04 10:46:23 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Almost-but-not-quite termios.
|
||||
*/
|
||||
|
||||
#ifndef _TERMIOS_H
|
||||
#define _TERMIOS_H
|
||||
|
||||
typedef unsigned int tcflag_t;
|
||||
typedef unsigned char cc_t;
|
||||
typedef unsigned int speed_t;
|
||||
|
||||
#define NCCS 16 /* Number of Control Characters = Length of the c_cc array. */
|
||||
|
||||
enum { /* All the control characters in c_cc[] in a struct termios (below) */
|
||||
VINTR=0, /* ^C (break) */
|
||||
VQUIT, /* ^\ (quit) */
|
||||
VERASE, /* ^H (eraase) */
|
||||
VKILL, /* ^X (erase-line) */
|
||||
VEOF, /* ^D (end-of-file) */
|
||||
VMIN, /* Minimum number of characters to read. Interacts with VTIME. */
|
||||
VEOL, /* NUL */
|
||||
VTIME, /* Timeout in 1/10:ths of a second. Interacts with VMIN. */
|
||||
VSTART, /* ^Q (continue) */
|
||||
VSTOP, /* ^S (stop) */
|
||||
VSUSP, /* ^Z (suspend) */
|
||||
VWERASE, /* ^W (word-erase) */
|
||||
};
|
||||
|
||||
struct termios {
|
||||
tcflag_t c_iflag;
|
||||
tcflag_t c_oflag;
|
||||
tcflag_t c_cflag;
|
||||
tcflag_t c_lflag;
|
||||
cc_t c_cc[NCCS];
|
||||
/* Private */
|
||||
speed_t c_ispeed;
|
||||
speed_t c_ospeed;
|
||||
int type;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
/* c_iflag */
|
||||
|
||||
#define IGNBRK (1<<0L) /* Ignore VINTR */
|
||||
#define BRKINT (1<<1L) /* Unimpl. */
|
||||
#define IGNPAR (1<<2L) /* Unimpl. */
|
||||
#define PARMRK (1<<3L) /* Unimpl. */
|
||||
#define INPCK (1<<4L) /* Unimpl. */
|
||||
#define ISTRIP (1<<5L) /* 7-bit data (strip high bit) */
|
||||
#define INLCR (1<<6L) /* Map NL->CR */
|
||||
#define IGNCR (1<<7L) /* Map CR->nothing */
|
||||
#define ICRNL (1<<8L) /* Map CR->NL */
|
||||
#define IXON (1<<9L) /* Unimpl. Enable XON/XOFF for output. */
|
||||
#define IXOFF (1<<10L) /* Unimpl. Enable XON/XOFF for input. */
|
||||
|
||||
/* c_oflag */
|
||||
|
||||
#define OPOST (1<<0L) /* Enable output processing. */
|
||||
#define ONLCR (1<<1L) /* Map NL->CR+NL */
|
||||
#define OCRNL (1<<2L) /* Map CR->NL */
|
||||
#define ONOCR (1<<3L) /* Map CR->nothing, but only in column 0. */
|
||||
#define ONLRET (1<<4L) /* Map CR->nothing */
|
||||
|
||||
/* c_cflag */
|
||||
|
||||
#define CSIZE (0x07) /* Bit-width mask. */
|
||||
#define CS5 (0x01) /* 5-bits */
|
||||
#define CS6 (0x02) /* 6-bits */
|
||||
#define CS7 (0x03) /* 7-bits */
|
||||
#define CS8 (0x04) /* 8-bits */
|
||||
#define CSTOPB (1<<3L) /* Use 2 stop bits. */
|
||||
#define CREAD (1<<4L) /* Enable reading/receiving. */
|
||||
#define PARENB (1<<5L) /* Enable parity generation/checking. */
|
||||
#define PARODD (1<<6L) /* Parity is odd. */
|
||||
#define HUPCL (1<<7L) /* Hangup on close (when the device is closed). */
|
||||
#define CLOCAL (1<<8L) /* Ignore modem control lines (i.e. a null-modem) */
|
||||
|
||||
/* c_lflag */
|
||||
|
||||
#define ISIG (1<<0L) /* Send SIGINT for ^C, SIGQUIT for ^\ etc. */
|
||||
#define ICANON (1<<1L) /* Canonical mode. Line buffered with EOF, EOL etc. enabled. */
|
||||
#define ECHO (1<<2L) /* Echo input characters. */
|
||||
#define ECHONL (1<<3L) /* Echo newline characters even if ECHO is not set. */
|
||||
#define IEXTEN (1<<4L) /* Enable implementation defined input processing. (none) */
|
||||
|
||||
/* Speeds */
|
||||
|
||||
enum {
|
||||
B0=0, /* 0 baud => disconnect. */
|
||||
B50=50,
|
||||
B75=75,
|
||||
B110=110,
|
||||
B134=134,
|
||||
B150=150,
|
||||
B200=200,
|
||||
B300=300,
|
||||
B600=600,
|
||||
B1200=1200,
|
||||
B1800=1800,
|
||||
B2400=2400,
|
||||
B4800=4800,
|
||||
B9600=9600,
|
||||
B19200=19200,
|
||||
B31250=31250,
|
||||
B38400=38400,
|
||||
B57600=57600,
|
||||
B115200=115200,
|
||||
B230400=230400,
|
||||
B460800=460800,
|
||||
B576000=576000,
|
||||
B1152000=1152000
|
||||
};
|
||||
|
||||
#define EXTA 1 /* Tell applications we have speeds > 9600 baud. */
|
||||
|
||||
/* Action types for tcsetattr() */
|
||||
|
||||
enum {
|
||||
TCSANOW,
|
||||
TCSADRAIN,
|
||||
TCSAFLUSH
|
||||
};
|
||||
|
||||
/* Action types for tcflush() */
|
||||
|
||||
enum {
|
||||
TCIFLUSH,
|
||||
TCOFLUSH,
|
||||
TCIOFLUSH
|
||||
};
|
||||
|
||||
/* Action types for tcflow() */
|
||||
|
||||
enum {
|
||||
TCOOFF,
|
||||
TCOON,
|
||||
TCIOFF,
|
||||
TCION
|
||||
};
|
||||
|
||||
/* Prototypes. */
|
||||
|
||||
extern int tcgetattr(int file_descriptor,struct termios *tios_p);
|
||||
extern int tcsetattr(int file_descriptor,int action,struct termios *tios_p);
|
||||
extern int tcsendbreak(int file_descriptor,int duration);
|
||||
extern int tcdrain(int file_descriptor);
|
||||
extern int tcflush(int file_descriptor,int what);
|
||||
extern int tcflow(int file_descriptor,int action);
|
||||
extern int cfmakeraw(struct termios *tios_p);
|
||||
extern speed_t cfgetispeed(struct termios *tios_p);
|
||||
extern speed_t cfgetospeed(struct termios *tios_p);
|
||||
extern int cfsetispeed(struct termios *tios_p,speed_t input_speed);
|
||||
extern int cfsetospeed(struct termios *tios_p,speed_t output_speed);
|
||||
|
||||
#endif /* _TERMIOS_H */
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: unistd.h,v 1.9 2005-02-04 15:03:14 obarthel Exp $
|
||||
* $Id: unistd.h,v 1.10 2005-06-04 10:46:23 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -100,6 +100,9 @@ extern pid_t getpid(void);
|
||||
extern char *realpath(const char *file_name, char *resolved_name);
|
||||
extern int fsync(int file_descriptor);
|
||||
extern int fdatasync(int file_descriptor);
|
||||
extern char *ttyname(int);
|
||||
extern int ttyname_r(int file_descriptor,char *name,size_t buflen);
|
||||
extern int ttyname_t(int,char *,size_t);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: wchar.h,v 1.2 2005-01-02 09:07:21 obarthel Exp $
|
||||
* $Id: wchar.h,v 1.3 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -162,6 +162,20 @@ extern size_t wcsftime(wchar_t *s, size_t maxsize, const wchar_t *format, const
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' (1994) standard, but it should
|
||||
be part of ISO/IEC 9899:1999, also known as "C99". */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
|
||||
extern long long wcstoll(const wchar_t *str, wchar_t **ptr, int base);
|
||||
extern unsigned long long wcstoull(const wchar_t *str, wchar_t **ptr, int base);
|
||||
|
||||
#endif /* __STDC_VERSION__ && __STDC_VERSION__ >= 199901L */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: wctype.h,v 1.2 2005-01-02 09:07:21 obarthel Exp $
|
||||
* $Id: wctype.h,v 1.3 2005-05-12 13:21:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -68,6 +68,7 @@ extern int iswlower(wint_t c);
|
||||
extern int iswupper(wint_t c);
|
||||
|
||||
extern int iswspace(wint_t c);
|
||||
extern int iswblank(wint_t c);
|
||||
|
||||
extern wint_t towlower(wint_t c);
|
||||
extern wint_t towupper(wint_t c);
|
||||
|
||||
49
library/inttypes_headers.h
Normal file
49
library/inttypes_headers.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* $Id: inttypes_headers.h,v 1.1 2005-05-12 13:21:43 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_HEADERS_H
|
||||
#define _INTTYPES_HEADERS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_HEADERS_H
|
||||
#include "stdlib_headers.h"
|
||||
#endif /* _STDLIB_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _INTTYPES_HEADERS_H */
|
||||
51
library/inttypes_imaxabs.c
Normal file
51
library/inttypes_imaxabs.c
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id: inttypes_imaxabs.c,v 1.1 2005-05-12 13:21:43 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_HEADERS_H
|
||||
#include "inttypes_headers.h"
|
||||
#endif /* _INTTYPES_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
intmax_t
|
||||
imaxabs(intmax_t x)
|
||||
{
|
||||
intmax_t result;
|
||||
|
||||
if(x < 0)
|
||||
result = (-x);
|
||||
else
|
||||
result = x;
|
||||
|
||||
return(result);
|
||||
}
|
||||
51
library/inttypes_imaxdiv.c
Normal file
51
library/inttypes_imaxdiv.c
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* $Id: inttypes_imaxdiv.c,v 1.1 2005-05-12 13:21:43 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_HEADERS_H
|
||||
#include "inttypes_headers.h"
|
||||
#endif /* _INTTYPES_HEADERS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
imaxdiv_t
|
||||
imaxdiv(intmax_t n,intmax_t d)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
assert( d != 0 );
|
||||
|
||||
result.quot = n / d;
|
||||
result.rem = n % d;
|
||||
|
||||
return(result);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user