1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

1 Commits

Author SHA1 Message Date
d56e2c3a62 This commit was manufactured by cvs2svn to create tag 'LIB_V1_1'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/tags/LIB_V1_1@15001 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-07-04 09:39:01 +00:00
906 changed files with 0 additions and 108791 deletions

View File

@ -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 '#'

View File

@ -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".

View File

@ -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

View File

@ -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'

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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".

View File

@ -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".

View File

@ -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.

View File

@ -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>

View File

@ -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>

View File

@ -1,304 +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>
<h3>2.1 Thread-safety</h3>
<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 <b>POSIX 1003.1c-1995</b> 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>
<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>&lt;math-68881.h&gt;</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>&lt;assert.h&gt;</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>
<h3>5.1 Floating point math and functions (<tt>scanf()</tt>, <tt>printf()</tt>, etc.) </h3>
<p>The plain <tt>libc.a</tt>, which your software would be linked against by default, does not contain
any floating point support code. This means, for example, that <tt>printf("%f",...)</tt> will not produce
the desired output and that <tt>scanf("%f",...)</tt> may not read any data at all. If your
program needs functions such as these or <tt>atod()</tt> then you must link against <tt>libm.a</tt> or
the equivalent.</p>
<p>To link the floating point support code with your software, use the <tt>-lm</tt> compiler option. Careful!
The order in which you specify the libraries to link against is important here. Thus, <tt>gcc -o test test.c -lm -lc</tt>
would correctly link the program <tt>test</tt> against the proper floating point math library, but
<tt>gcc -o test test.c -lc -lm</tt> would not.</p>
<h3>5.2 The thread-safe library</h3>
<p>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 that 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>
<p> Also take care with file I/O involving the <tt>stdin</tt>/<tt>stdout</tt>/<tt>stderr</tt>
streams; read/write operations on these streams will be mapped to the <tt>Input()</tt>/</tt>Output()</tt>/<tt>ErrorOutput()</tt>
file handles of the process performing these operations. Since only this small set of
operations is mapped, functions such as <tt>fcntl()</tt> or <tt>select()</tt> will not
work on the <tt>stdin</tt>/<tt>stdout</tt>/<tt>stderr</tt> streams and the corresponding
file descriptors <tt>STDIN_FILENO</tt>/<tt>STDOUT_FILENO</tt>/<tt>STDERR_FILENO</tt>.
It is therefore strongly recommended to use the thread-safe library only for applications
which can cope with the limitations described above.</p>
<h3>5.3 Using gmon (PowerPC only)</h3>
<p>To use profiling, two steps are required. First of all, your program must be compiled with
the gcc command line option <tt>-pg</tt>. This instructs the compiler to generate special
profiling code in the prologue and epilogue of each function. Additionally, the program
must be linked with <tt>libprofile.a</tt>. To do this, either manually add
<tt>-lprofile</tt> to the linker command line, or modify the specs file as follows.
Find the lines that look like this (it may actually differ silghtily from your specs file,
but the important thing is that the line before the line to be modified reads <tt>lib:</tt>):
<pre>
lib:
--start-group -lc --end-group
</pre>
You will have to modify this to look like this:
<pre>
lib:
%{pg: -lprofile} --start-group -lc --end-group
</pre>
Normally, the specs file is located at the compilers installation directory. For cross-compilers,
this is <tt>/usr/local/amiga/lib/gcc/ppc-amigaos/<i>compiler-version</i>/specs</tt>. For a native compiler,
it's in <tt>gcc:lib/gcc/ppc-amigaos/<i>compiler-version</i>/specs</tt>. Most likely, your compiler will already have this added to it's specs file.</p>
<p>Profiling makes use of a special PowerPC facility called the Performance Monitor. It
allows to "mark" tasks and count only during while a marked task is running. This allows
performance analysis to be made independant of the actual system load. The Performace Monitor
is available on all PowerPC models supported by AmigaOS 4 except for the <tt>603e</tt>, and
embedded versions of the PowerPC like the <tt>405</tt> and <tt>440</tt> series. Consult the manual
of the appropriate chip for more information.</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>&lt;unistd.h&gt;</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>

View File

@ -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}
*lib:
%{mstackextend:-lstack} -lc -lamiga -ldebug -lgcc -lc
*libgcc:
*startfile:
%{resident32:nr32crt0.o%s}%{!resident32:%{fbaserel32:nb32crt0.o%s}%{!fbaserel32:%{resident:nrcrt0.o%s}%{!resident:%{fbaserel:nbcrt0.o%s}%{!fbaserel:ncrt0.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*}
}}}}}}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
C99 math functions:
(functions generally missing, including their "float" counterparts)
fma
fmaf
lrint
lrintf
lround
lroundf
nearbyint
nearbyintf
remquo
remquof
round
roundf
tgamma
tgammaf
trunc
truncf

View File

@ -1,38 +0,0 @@
/*
* $Id: amiga.lib_rev.c,v 1.2 2005-01-02 09:07: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.
*/
#include "amiga.lib_rev.h"
/****************************************************************************/
char __amiga_lib_version[] = VERSTAG;

View File

@ -1,6 +0,0 @@
#define VERSION 1
#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)"

View File

@ -1 +0,0 @@
193

View File

@ -1,106 +0,0 @@
/*
* $Id: amiga_acrypt.c,v 1.3 2005-05-30 14:01:20 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.
*/
#define ACrypt __ACrypt
#include <exec/types.h>
#include <string.h>
#include <clib/alib_protos.h>
#undef ACrypt
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#define OSIZE 12
/****************************************************************************/
UBYTE *
ACrypt(UBYTE * buffer, const UBYTE * password, const UBYTE * user)
{
UBYTE * result = NULL;
LONG buf[OSIZE];
LONG i,d,k;
ENTER();
assert( buffer != NULL && password != NULL && user != NULL );
SHOWPOINTER(buffer);
SHOWSTRING(password);
SHOWSTRING(user);
if(buffer == NULL || password == NULL || user == NULL)
{
SHOWMSG("invalid parameters");
goto out;
}
for(i = 0 ; i < OSIZE ; i++)
{
if((*password) != '\0')
d = (*password++);
else
d = i;
if((*user) != '\0')
d += (*user++);
else
d += i;
buf[i] = 'A' + d;
}
for(i = 0 ; i < OSIZE ; i++)
{
for(k = 0 ; k < OSIZE ; k++)
buf[i] = (buf[i] + buf[OSIZE - k - 1]) % 53;
buffer[i] = buf[i] + 'A';
}
buffer[OSIZE-1] = '\0';
SHOWSTRING(buffer);
result = buffer;
out:
RETURN(result);
return(result);
}

View File

@ -1,83 +0,0 @@
/*
* $Id: amiga_addtof.c,v 1.3 2005-02-25 10:14:20 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.
*/
#include <exec/interrupts.h>
#include <hardware/intbits.h>
#include <graphics/graphint.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <proto/graphics.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "macros.h"
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
typedef LONG (* CFUNC)(APTR arg);
/****************************************************************************/
STATIC LONG INTERRUPT ASM
call_routine(REG(a1,struct Isrvstr *i))
{
CFUNC p = (CFUNC)i->ccode;
(*p)(i->Carg);
return(0);
}
/****************************************************************************/
VOID
AddTOF(struct Isrvstr *i,CFUNC p,APTR arg)
{
assert( i != NULL && p != NULL );
i->code = (long (*)())call_routine;
i->Iptr = i;
i->ccode = p;
i->Carg = arg;
AddIntServer(INTB_VERTB,(struct Interrupt *)i);
}

View File

@ -1,71 +0,0 @@
/*
* $Id: amiga_argarraydone.c,v 1.2 2005-01-02 09:07: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.
*/
#include <workbench/workbench.h>
#include <exec/memory.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <proto/icon.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
extern char **CXLIB_argarray;
extern struct DiskObject * CXLIB_disko;
/****************************************************************************/
VOID
ArgArrayDone(VOID)
{
if(CXLIB_argarray != NULL)
{
FreeVec(CXLIB_argarray);
CXLIB_argarray = NULL;
}
if(CXLIB_disko != NULL)
{
FreeDiskObject(CXLIB_disko);
CXLIB_disko = NULL;
}
}

View File

@ -1,99 +0,0 @@
/*
* $Id: amiga_argarrayinit.c,v 1.2 2005-01-02 09:07: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.
*/
#include <libraries/commodities.h>
#include <workbench/workbench.h>
#include <workbench/startup.h>
#include <exec/memory.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/icon.h>
#include <proto/commodities.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
const unsigned char ** CXLIB_argarray;
struct DiskObject * CXLIB_disko;
/****************************************************************************/
STRPTR *
ArgArrayInit(LONG argc, CONST_STRPTR * argv)
{
unsigned char ** result = NULL;
if(argc != 0) /* run from CLI */
{
int i;
if(argc == 1)
goto out; /* skip command name */
CXLIB_argarray = (const unsigned char **)AllocVec(sizeof(char *) * argc,MEMF_ANY|MEMF_CLEAR);
if(CXLIB_argarray == NULL)
goto out;
for(i = 1 ; i < argc ; i++)
CXLIB_argarray[i-1] = argv[i];
result = (unsigned char **)CXLIB_argarray;
}
else if (IconBase != NULL)
{
struct WBStartup * msg;
/* run from WB */
msg = (struct WBStartup *)argv;
CXLIB_disko = GetDiskObject(msg->sm_ArgList[0].wa_Name);
if(CXLIB_disko == NULL)
goto out;
result = (unsigned char **)CXLIB_disko->do_ToolTypes;
}
out:
return(result);
}

View File

@ -1,60 +0,0 @@
/*
* $Id: amiga_argint.c,v 1.2 2005-01-02 09:07: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.
*/
#include <workbench/workbench.h>
#include <exec/memory.h>
#include <string.h>
/****************************************************************************/
#include <proto/dos.h>
#include <proto/icon.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
LONG
ArgInt(CONST_STRPTR *tt,CONST_STRPTR entry,LONG default_val)
{
STRPTR str;
if(tt != NULL && IconBase != NULL && ((str = (STRPTR)FindToolType((STRPTR *)tt,(STRPTR)entry))) != NULL)
StrToLong(str,&default_val);
return(default_val);
}

View File

@ -1,61 +0,0 @@
/*
* $Id: amiga_argstring.c,v 1.2 2005-01-02 09:07: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.
*/
#include <libraries/commodities.h>
#include <workbench/workbench.h>
#include <workbench/startup.h>
#include <exec/memory.h>
#include <string.h>
/****************************************************************************/
#include <proto/icon.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
STRPTR
ArgString(CONST_STRPTR *tt,CONST_STRPTR entry,CONST_STRPTR default_string)
{
STRPTR result;
if(tt != NULL && IconBase != NULL && ((result = (STRPTR)FindToolType((STRPTR *)tt,(STRPTR)entry))) != NULL)
return(result);
else
return((STRPTR)default_string);
}

View File

@ -1,120 +0,0 @@
/*
* $Id: amiga_beginio.c,v 1.3 2005-01-02 09:07: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.
*/
#include <exec/devices.h>
#include <exec/io.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#ifndef __PPC__
/****************************************************************************/
#if defined(__SASC)
VOID __begin_io(struct IORequest * ior);
#pragma libcall DeviceBase __begin_io 01e 901
#endif /* __SASC */
/****************************************************************************/
#if defined(__GNUC__)
#define __begin_io(ior) ({ \
struct IORequest * _BeginIO_ior = (ior); \
{ \
register struct Library * const __BeginIO__bn __asm("a6") = (struct Library *) (DeviceBase);\
register struct IORequest * __BeginIO_ior __asm("a1") = (_BeginIO_ior); \
__asm volatile ("jsr a6@(-30:W)" \
: \
: "r"(__BeginIO__bn), "r"(__BeginIO_ior) \
: "d0", "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
} \
})
#endif /* __GNUC__ */
/****************************************************************************/
VOID
BeginIO(struct IORequest *ior)
{
struct Device * DeviceBase;
ENTER();
assert( ior != NULL && ior->io_Device != NULL );
DeviceBase = ior->io_Device;
__begin_io(ior);
LEAVE();
}
/****************************************************************************/
#else
/****************************************************************************/
#include <proto/exec.h>
/****************************************************************************/
#if defined(BeginIO)
#undef BeginIO
#endif /* BeginIO */
/****************************************************************************/
VOID
BeginIO(struct IORequest *ior)
{
ENTER();
assert( ior != NULL && ior->io_Device != NULL );
IExec->BeginIO(ior);
LEAVE();
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,67 +0,0 @@
/*
* $Id: amiga_callhook.c,v 1.2 2005-01-02 09:07: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 __PPC__
/****************************************************************************/
#include <clib/alib_protos.h>
#include <stdarg.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
ULONG
CallHook(struct Hook *hook_ptr,Object *obj,...)
{
ULONG result;
va_list arg;
assert( hook_ptr != NULL );
va_start(arg,obj);
result = CallHookA(hook_ptr,obj,(APTR)arg);
va_end(arg);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,80 +0,0 @@
*
* $Id: amiga_callhooka.asm,v 1.2 2005-01-02 09:07:06 obarthel Exp $
*
* :ts=8
*
* 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.
*
section text,code
h_Entry equ 8
xdef _CallHookA
****************************************************************************
* new hook standard
* use struct Hook (with minnode at the top)
*
* *** register calling convention: ***
* A0 - pointer to hook itself
* A1 - pointer to parameter packed ("message")
* A2 - Hook specific address data ("object," e.g, gadget )
*
* *** C conventions: ***
* Note that parameters are in unusual register order: a0, a2, a1.
* This is to provide a performance boost for assembly language
* programming (the object in a2 is most frequently untouched).
* It is also no problem in "register direct" C function parameters.
*
* calling through a hook
* CallHook( hook, object, msgid, p1, p2, ... );
* CallHookA( hook, object, msgpkt );
*
* using a C function: CFunction( hook, object, message );
* hook.h_Entry = HookEntry;
* hook.h_SubEntry = CFunction;
*
****************************************************************************
* C calling hook interface for prepared message packet
_CallHookA:
movem.l a2/a6,-(sp)
move.l 12(sp),a0
move.l 16(sp),a2
move.l 20(sp),a1
pea.l hook_return(pc)
move.l h_Entry(a0),-(sp)
rts
hook_return:
movem.l (sp)+,a2/a6
rts
end

View File

@ -1,93 +0,0 @@
/*
* $Id: amiga_callhooka.c,v 1.2 2005-01-02 09:07: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.
*/
#if (defined(__GNUC__) && !defined(__PPC__))
/****************************************************************************/
asm("
h_Entry = 8
.text
.even
|---------------------------------------------------------------------------
| new hook standard
| use struct Hook (with minnode at the top)
|
| *** register calling convention: ***
| A0 - pointer to hook itself
| A1 - pointer to parameter packed ('message')
| A2 - Hook specific address data ('object,' e.g, gadget )
|
| *** C conventions: ***
| Note that parameters are in unusual register order: a0, a2, a1.
| This is to provide a performance boost for assembly language
| programming (the object in a2 is most frequently untouched).
| It is also no problem in 'register direct' C function parameters.
|
| calling through a hook
| CallHook( hook, object, msgid, p1, p2, ... );
| CallHookA( hook, object, msgpkt );
|
| using a C function: CFunction( hook, object, message );
| hook.h_Entry = HookEntry;
| hook.h_SubEntry = CFunction;
|
|---------------------------------------------------------------------------
| C calling hook interface for prepared message packet
.globl _CallHookA
_CallHookA:
moveml a2/a6,sp@-
moveal sp@(12),a0
moveal sp@(16),a2
moveal sp@(20),a1
pea callhooka_return
movel a0@(h_Entry),sp@-
rts
callhooka_return:
moveml sp@+,a2/a6
rts
");
/****************************************************************************/
#endif /* __GNUC__ && !__PPC__ */

View File

@ -1,93 +0,0 @@
/*
* $Id: amiga_coercemethod.c,v 1.2 2005-01-02 09:07:07 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 __PPC__
/****************************************************************************/
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
ULONG
CoerceMethodA(Class * cl,Object * obj,Msg msg)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWPOINTER(msg);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
result = CallHookA(&cl->cl_Dispatcher,obj,msg);
RETURN(result);
return(result);
}
/****************************************************************************/
ULONG
CoerceMethod(Class *cl, Object *obj, ULONG method_id, ...)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWVALUE(method_id);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
result = CoerceMethodA(cl,obj,(Msg)&method_id);
RETURN(result);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,68 +0,0 @@
/*
* $Id: amiga_createextio.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(CreateExtIO)
#undef CreateExtIO
#endif /* CreateExtIO */
/****************************************************************************/
struct IORequest *
CreateExtIO(CONST struct MsgPort * port, LONG io_size)
{
struct IORequest * result = NULL;
assert( port != NULL && io_size > 0 );
if(port == NULL || io_size < (LONG)sizeof(*result))
goto out;
result = CreateIORequest(port,(ULONG)io_size);
out:
return(result);
}

View File

@ -1,75 +0,0 @@
/*
* $Id: amiga_createport.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(CreatePort)
#undef CreatePort
#endif /* CreatePort */
/****************************************************************************/
struct MsgPort *
CreatePort(CONST_STRPTR name, LONG pri)
{
struct MsgPort * result = NULL;
assert( -128 <= pri && pri <= 127 );
if(pri < -128 || pri > 127)
goto out;
result = CreateMsgPort();
if(result != NULL && name != NULL)
{
result->mp_Node.ln_Name = (char *)name;
result->mp_Node.ln_Pri = pri;
AddPort(result);
}
out:
return(result);
}

View File

@ -1,68 +0,0 @@
/*
* $Id: amiga_createstdio.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(CreateStdIO)
#undef CreateStdIO
#endif /* CreateStdIO */
/****************************************************************************/
struct IOStdReq *
CreateStdIO(CONST struct MsgPort * port)
{
struct IOStdReq * result = NULL;
assert( port != NULL );
if(port == NULL)
goto out;
result = (struct IOStdReq *)CreateIORequest((struct MsgPort *)port,sizeof(*result));
out:
return(result);
}

View File

@ -1,242 +0,0 @@
/*
* $Id: amiga_createtask.c,v 1.4 2005-03-18 12:38:21 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.
*/
/****************************************************************************/
#include <exec/libraries.h>
#include <exec/memory.h>
#include <exec/tasks.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#include "macros.h"
#include "debug.h"
/****************************************************************************/
#ifndef __PPC__
/****************************************************************************/
/*
* Create a task with given name, priority, and stack size.
* It will use the default exception and trap handlers for now.
*/
/****************************************************************************/
/* the template for the mementries. Unfortunately, this is hard to
* do from C: mementries have unions, and they cannot be statically
* initialized...
*
* In the interest of simplicity I recreate the mem entry structures
* here with appropriate sizes. We will copy this to a local
* variable and set the stack size to what the user specified,
* then attempt to actually allocate the memory.
*/
#define ME_TASK 0
#define ME_STACK 1
#define NUM_MEM_ENTRIES 2
/****************************************************************************/
struct FakeMemEntry
{
ULONG fme_Reqs;
ULONG fme_Size;
};
/****************************************************************************/
struct FakeMemList
{
struct Node fml_Node;
UWORD fml_NumEntries;
struct FakeMemEntry fml_ME[NUM_MEM_ENTRIES];
};
/****************************************************************************/
struct Task *
CreateTask(CONST_STRPTR name,LONG pri,CONST APTR init_pc,ULONG stack_size)
{
struct Task * new_task;
struct FakeMemList fake_mem_list;
struct MemList * ml = NULL;
APTR result = NULL;
ENTER();
SHOWSTRING(name);
SHOWVALUE(pri);
SHOWPOINTER(init_pc);
SHOWVALUE(stack_size);
assert( name != NULL && (-128 <= pri && pri <= 127) && init_pc != NULL && stack_size > 0 );
if(name == NULL || pri < -128 || pri > 127 || init_pc == NULL || stack_size == 0)
{
SHOWMSG("invalid parameters");
goto out;
}
/* round the stack up to longwords... */
stack_size = (stack_size + 3UL) & ~3UL;
/*
* This will allocate two chunks of memory: task of PUBLIC
* and stack of PRIVATE
*/
memset(&fake_mem_list,0,sizeof(fake_mem_list));
fake_mem_list.fml_NumEntries = NUM_MEM_ENTRIES;
fake_mem_list.fml_ME[ME_TASK].fme_Reqs = MEMF_PUBLIC | MEMF_CLEAR;
fake_mem_list.fml_ME[ME_TASK].fme_Size = sizeof(struct Task);
fake_mem_list.fml_ME[ME_STACK].fme_Reqs = MEMF_ANY | MEMF_CLEAR;
fake_mem_list.fml_ME[ME_STACK].fme_Size = stack_size;
ml = (struct MemList *)AllocEntry((struct MemList *)&fake_mem_list);
/* Did the allocation succeed? */
if(((LONG)ml) < 0)
{
SHOWMSG("memory allocation failed");
/* Note: if AllocEntry() fails, the entire allocation is
* released before the function returns with bit #31
* set and the number of the slot that failed being
* returned. Thus, the return value is not a valid
* address that would need to be freed.
*/
ml = NULL;
goto out;
}
/* set the stack accounting stuff */
new_task = (struct Task *)ml->ml_ME[ME_TASK].me_Addr;
new_task->tc_SPLower = ml->ml_ME[ME_STACK].me_Addr;
new_task->tc_SPUpper = (APTR)((ULONG)(new_task->tc_SPLower) + stack_size);
new_task->tc_SPReg = new_task->tc_SPUpper;
/* misc task data structures */
new_task->tc_Node.ln_Type = NT_TASK;
new_task->tc_Node.ln_Pri = pri;
new_task->tc_Node.ln_Name = (char *)name;
/* add it to the tasks memory list */
NewList(&new_task->tc_MemEntry);
AddHead(&new_task->tc_MemEntry,(struct Node *)ml);
/* add the task to the system -- use the default final PC */
PROFILE_OFF();
result = AddTask(new_task,init_pc,NULL);
PROFILE_ON();
if(result == NULL)
{
SHOWMSG("could not add task");
goto out;
}
/* Gobbled up by task. */
ml = NULL;
out:
if(ml != NULL)
FreeEntry(ml);
RETURN(result);
return(result);
}
/****************************************************************************/
#else
/****************************************************************************/
#if defined(CreateTask)
#undef CreateTask
#endif /* CreateTask */
/****************************************************************************/
struct Task *
CreateTask(CONST_STRPTR name,LONG pri,CONST APTR init_pc,ULONG stack_size)
{
struct Task * result = NULL;
ENTER();
SHOWSTRING(name);
SHOWVALUE(pri);
SHOWPOINTER(init_pc);
SHOWVALUE(stack_size);
assert( name != NULL && (-128 <= pri && pri <= 127) && init_pc != NULL && stack_size > 0 );
if(name == NULL || pri < -128 || pri > 127 || init_pc == NULL || stack_size == 0)
{
SHOWMSG("invalid parameters");
goto out;
}
result = IExec->CreateTask(name,pri,init_pc,stack_size,NULL);
out:
RETURN(result);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,60 +0,0 @@
/*
* $Id: amiga_deleteextio.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(DeleteExtIO)
#undef DeleteExtIO
#endif /* DeleteExtIO */
/****************************************************************************/
VOID
DeleteExtIO(struct IORequest * io)
{
assert(io != NULL);
if(io != NULL)
DeleteIORequest((struct IORequest *)io);
}

View File

@ -1,62 +0,0 @@
/*
* $Id: amiga_deleteport.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(DeletePort)
#undef DeletePort
#endif /* DeletePort */
/****************************************************************************/
VOID
DeletePort(struct MsgPort * port)
{
assert( port != NULL );
if(port->mp_Node.ln_Name != NULL)
RemPort(port);
DeleteMsgPort(port);
}

View File

@ -1,58 +0,0 @@
/*
* $Id: amiga_deletestdio.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#if defined(DeleteStdIO)
#undef DeleteStdIO
#endif /* DeleteStdIO */
/****************************************************************************/
VOID
DeleteStdIO(struct IOStdReq * io)
{
if(io != NULL)
DeleteIORequest((struct IORequest *)io);
}

View File

@ -1,74 +0,0 @@
/*
* $Id: amiga_deletetask.c,v 1.3 2005-01-02 09:07:07 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.
*/
#include <exec/libraries.h>
#include <exec/tasks.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#ifndef __PPC__
/****************************************************************************/
VOID
DeleteTask(struct Task *tc)
{
RemTask(tc);
}
/****************************************************************************/
#else
/****************************************************************************/
#if defined(DeleteTask)
#undef DeleteTask
#endif /* DeleteTask */
/****************************************************************************/
VOID
DeleteTask(struct Task *tc)
{
IExec->DeleteTask(tc);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,100 +0,0 @@
/*
* $Id: amiga_domethod.c,v 1.2 2005-01-02 09:07:07 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 __PPC__
/****************************************************************************/
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
ULONG
DoMethodA(Object * obj,Msg msg)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(obj);
SHOWPOINTER(msg);
assert(obj != NULL);
if(obj != NULL)
{
Class * cl;
cl = OCLASS(obj);
assert( cl != NULL );
if(cl != NULL)
result = CallHookA(&cl->cl_Dispatcher,obj,msg);
}
RETURN(result);
return(result);
}
/****************************************************************************/
ULONG
DoMethod(Object *obj, ULONG method_id, ...)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(obj);
SHOWVALUE(method_id);
assert( obj != NULL );
if(obj != NULL)
result = DoMethodA(obj,(Msg)&method_id);
RETURN(result);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,93 +0,0 @@
/*
* $Id: amiga_dosupermethod.c,v 1.2 2005-01-02 09:07:07 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 __PPC__
/****************************************************************************/
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
ULONG
DoSuperMethodA(Class * cl, Object * obj, Msg msg)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWPOINTER(msg);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
result = CallHookA(&cl->cl_Super->cl_Dispatcher,obj,msg);
RETURN(result);
return(result);
}
/****************************************************************************/
ULONG
DoSuperMethod(Class *cl, Object *obj, ULONG method_id, ...)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWVALUE(method_id);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
result = DoSuperMethodA(cl,obj,(Msg)&method_id);
RETURN(result);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,147 +0,0 @@
/*
* $Id: amiga_dotimer.c,v 1.4 2005-03-18 12:38:21 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.
*/
#include <exec/errors.h>
#include <devices/timer.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#include "macros.h"
#include "debug.h"
/****************************************************************************/
LONG
DoTimer(struct timeval *tv,LONG unit,LONG command)
{
struct timerequest * tr = NULL;
struct MsgPort * mp;
LONG error;
assert( tv != NULL );
#if defined(__amigaos4__)
{
mp = AllocSysObjectTags(ASOT_PORT,
ASOPORT_Action, PA_SIGNAL,
ASOPORT_Signal, SIGB_SINGLE,
ASOPORT_Target, FindTask(NULL),
TAG_DONE);
if(mp == NULL)
{
error = IOERR_OPENFAIL;
goto out;
}
}
#else
{
mp = AllocVec(sizeof(*mp),MEMF_ANY|MEMF_PUBLIC|MEMF_CLEAR);
if(mp == NULL)
{
error = IOERR_OPENFAIL;
goto out;
}
mp->mp_Node.ln_Type = NT_MSGPORT;
mp->mp_Flags = PA_SIGNAL;
mp->mp_SigBit = SIGB_SINGLE;
mp->mp_SigTask = FindTask(NULL);
NewList(&mp->mp_MsgList);
}
#endif /* __amigaos4__ */
tr = (struct timerequest *)CreateIORequest(mp,sizeof(*tr));
if(tr == NULL)
{
error = IOERR_OPENFAIL;
goto out;
}
error = OpenDevice(TIMERNAME,(ULONG)unit,(struct IORequest *)tr,0);
if(error != 0)
goto out;
tr->tr_node.io_Command = command;
tr->tr_time.tv_secs = tv->tv_secs;
tr->tr_time.tv_micro = tv->tv_micro;
PROFILE_OFF();
SetSignal(0,SIGF_SINGLE);
error = DoIO((struct IORequest *)tr);
PROFILE_ON();
tv->tv_secs = tr->tr_time.tv_secs;
tv->tv_micro = tr->tr_time.tv_micro;
out:
if(tr != NULL)
{
if(tr->tr_node.io_Device != NULL)
CloseDevice((struct IORequest *)tr);
DeleteIORequest((struct IORequest *)tr);
}
#if defined(__amigaos4__)
{
if(mp != NULL)
FreeSysObject(ASOT_PORT,mp);
}
#else
{
FreeVec(mp);
}
#endif /* __amigaos4__ */
return(error);
}

View File

@ -1,52 +0,0 @@
/*
* $Id: amiga_fastrand.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <exec/types.h>
/****************************************************************************/
#include <clib/alib_protos.h>
/****************************************************************************/
ULONG
FastRand(ULONG seed)
{
ULONG value;
value = seed + seed;
if(value < seed)
value ^= 0x1D872B41;
return(value);
}

View File

@ -1,62 +0,0 @@
/*
* $Id: amiga_freeievents.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <devices/inputevent.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
VOID
FreeIEvents(struct InputEvent * ie)
{
struct InputEvent * next;
while(ie != NULL)
{
next = ie->ie_NextEvent;
FreeVec(ie);
ie = next;
}
}

View File

@ -1,51 +0,0 @@
*
* $Id: amiga_hookentry.asm,v 1.2 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=8
*
* 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.
*
section text,code
h_SubEntry equ 12
xdef _HookEntry
_HookEntry:
move.l a1,-(sp)
move.l a2,-(sp)
move.l a0,-(sp)
move.l h_SubEntry(a0),a0
jsr (a0)
lea 12(sp),sp
rts
end

View File

@ -1,61 +0,0 @@
/*
* $Id: amiga_hookentry.c,v 1.2 2005-01-02 09:07:07 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.
*/
#if (defined(__GNUC__) && !defined(__PPC__))
/****************************************************************************/
asm("
h_SubEntry = 12
.text
.even
.globl _HookEntry
_HookEntry:
movel a1,sp@-
movel a2,sp@-
movel a0,sp@-
movel a0@(h_SubEntry:W),a0
jsr a0@
lea sp@(12:W),sp
rts
");
/****************************************************************************/
#endif /* __GNUC__ && !__PPC__ */

View File

@ -1,78 +0,0 @@
/*
* $Id: amiga_hotkey.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <libraries/commodities.h>
#include <string.h>
/****************************************************************************/
#include <proto/commodities.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
CxObj *
HotKey(CONST_STRPTR descr,struct MsgPort * port,LONG ID)
{
CxObj * result = NULL;
CxObj * filter = NULL;
assert( descr != NULL && port != NULL );
if(CxBase == NULL)
goto out;
filter = CxFilter(descr);
if(filter == NULL)
goto out;
AttachCxObj(filter,CxSender(port,ID));
AttachCxObj(filter,CxTranslate(NULL));
if(CxObjError(filter))
goto out;
result = filter;
out:
if(result == NULL && filter != NULL)
DeleteCxObjAll(filter);
return(result);
}

View File

@ -1,208 +0,0 @@
/*
* $Id: amiga_invertstring.c,v 1.3 2005-02-25 10:14:20 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.
*/
#include <libraries/commodities.h>
#include <devices/keymap.h>
#include <exec/memory.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <proto/commodities.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
STATIC int
do_escape(int cc)
{
int result;
switch(cc)
{
case 'n':
case 'r':
result = '\r';
break;
case 't':
result = '\t';
break;
case '0':
result = '\0';
break;
case '\\':
case '\"':
case '\'':
case '<':
result = cc;
break;
default:
result = -1;
break;
}
return(result);
}
/****************************************************************************/
STATIC ULONG
do_angle(STRPTR * strp, struct InputEvent *ie)
{
ULONG result;
char * cp;
IX ix;
/* find closing angle '>', put a null there */
for(cp = (*strp) ; (*cp) ; cp++)
{
if((*cp) == '>')
{
(*cp) = '\0';
break;
}
}
result = ParseIX((*strp),&ix);
if(cp != NULL)
{
(*cp) = '>'; /* fix it */
(*strp) = cp; /* point to char following '>' */
}
else
{
(*strp) = cp - 1; /* ++will point to terminating null */
}
if(result == 0)
{
/* use IX to describe a suitable InputEvent */
ie->ie_Class = ix.ix_Class;
ie->ie_Code = ix.ix_Code;
ie->ie_Qualifier = ix.ix_Qualifier;
}
return(result);
}
/****************************************************************************/
extern VOID FreeIEvents(struct InputEvent *ie);
/****************************************************************************/
struct InputEvent *
InvertString(CONST_STRPTR str, CONST struct KeyMap *km)
{
/* bugs:
can't escape '>'
puts '\0' on closing angles */
/* allocate input event for each character in string */
struct InputEvent * result = NULL;
struct InputEvent * chain = NULL;
struct InputEvent * ie;
int cc;
if(CxBase == NULL || str == NULL || (*str) == '\0')
goto out;
do /* have checked that str is not null */
{
/* allocate the next ie and link it in */
ie = AllocVec(sizeof(*ie),MEMF_ANY|MEMF_CLEAR|MEMF_PUBLIC);
if(ie == NULL)
goto out;
ie->ie_NextEvent = chain;
chain = ie;
/* now fill in the input event */
cc = (*str);
switch(cc)
{
case '<':
str++;
if(do_angle((STRPTR*)&str, ie) != 0)
goto out;
break;
case '\\':
str++;
cc = do_escape(*str); /* get escaped character */
if(cc < 0)
goto out;
/* fall through */
default:
InvertKeyMap((ULONG) cc, ie, (struct KeyMap *)km);
break;
}
str++;
}
while((*str) != '\0');
result = chain;
out:
if(result == NULL && chain != NULL)
FreeIEvents(chain);
return(result);
}

View File

@ -1,60 +0,0 @@
/*
* $Id: amiga_newlist.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <exec/lists.h>
/****************************************************************************/
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
VOID
NewList(struct List *lh)
{
ENTER();
SHOWPOINTER(lh);
assert( lh != NULL );
lh->lh_Head = (struct Node *)&lh->lh_Tail;
lh->lh_Tail = NULL;
lh->lh_TailPred = (struct Node *)&lh->lh_Head;
LEAVE();
}

View File

@ -1,80 +0,0 @@
/*
* $Id: amiga_rangerand.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <exec/types.h>
/****************************************************************************/
#include <clib/alib_protos.h>
/****************************************************************************/
ULONG RangeSeed;
/****************************************************************************/
UWORD
RangeRand(ULONG max_value)
{
ULONG next_value;
ULONG result;
ULONG value;
UWORD range;
UWORD bits;
range = (max_value & 0xFFFF);
bits = range - 1;
value = RangeSeed;
do
{
next_value = value + value;
if(next_value <= value)
next_value ^= 0x1D872B41;
value = next_value;
bits = bits >> 1;
}
while(bits != 0);
RangeSeed = value;
if(range == 0)
result = value & 0xFFFF;
else
result = (range * (value & 0xFFFF)) >> 16;
return((UWORD)result);
}

View File

@ -1,57 +0,0 @@
/*
* $Id: amiga_remtof.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <exec/interrupts.h>
#include <hardware/intbits.h>
#include <graphics/graphint.h>
#include <string.h>
/****************************************************************************/
#include <proto/exec.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
VOID
RemTOF(struct Isrvstr *i)
{
assert( i != NULL );
RemIntServer(INTB_VERTB,(struct Interrupt *)i);
}

View File

@ -1,203 +0,0 @@
/*
* $Id: amiga_rexxvars.c,v 1.6 2005-03-18 12:38:21 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.
*/
/* 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>
/****************************************************************************/
#define __NOLIBBASE__
#include <proto/rexxsyslib.h>
/****************************************************************************/
static struct Library * RexxSysBase;
/****************************************************************************/
#if defined(__amigaos4__)
static struct RexxSysIFace * IRexxSys;
#endif /* __amigaos4__ */
/****************************************************************************/
CLIB_CONSTRUCTOR(rexxvars_init)
{
ENTER();
RexxSysBase = OpenLibrary(RXSNAME,0);
#if defined(__amigaos4__)
{
if(RexxSysBase != NULL)
{
IRexxSys = (struct RexxSysIFace *)GetInterface(RexxSysBase, "main", 1, 0);
if(IRexxSys == NULL)
{
CloseLibrary(RexxSysBase);
RexxSysBase = NULL;
}
}
}
#endif /* __amigaos4__ */
LEAVE();
CONSTRUCTOR_SUCCEED();
}
/****************************************************************************/
CLIB_DESTRUCTOR(rexxvars_exit)
{
ENTER();
#if defined(__amigaos4__)
{
if(IRexxSys != NULL)
DropInterface((struct Interface *)IRexxSys);
IRexxSys = NULL;
}
#endif /* __amigaos4__ */
if(RexxSysBase != NULL)
{
CloseLibrary(RexxSysBase);
RexxSysBase = NULL;
}
LEAVE();
}
/****************************************************************************/
/* This is modeled after the original assembly language code. Except for the
fact that we compare the library base against a local, static variable
rather then opening the library for each check. */
BOOL
CheckRexxMsg(struct RexxMsg *message)
{
BOOL result = FALSE;
if(RexxSysBase == NULL)
goto out;
if(message->rm_LibBase != RexxSysBase)
goto out;
if(message->rm_TaskBlock == NULL)
goto out;
if(NOT IsRexxMsg(message))
goto out;
result = TRUE;
out:
return(result);
}
/****************************************************************************/
/* The following function works in about like the original, except that it's
not reentrant, does not fill in a pointer to the variable itself and
requires rexxsyslib.library V45. */
LONG
GetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR *buffer_pointer)
{
static UBYTE buffer[256];
LONG result;
/* The following uses a function which was added to rexxsyslib.library V45.
We therefore have a minimum library version requirement. */
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
{
result = ERR10_010; /* invalid message packet */
goto out;
}
/* The 256 character limit isn't good. This should be done differently. */
result = GetRexxVarFromMsg(variable_name,buffer,message);
if(result != 0)
goto out;
(*buffer_pointer) = buffer;
out:
return(result);
}
/****************************************************************************/
/* The following function works in about like the original, except that it
ignores the length parameter (the value needs to be a NUL-terminated string)
and requires rexxsyslib.library V45. */
LONG
SetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR value,ULONG length)
{
LONG result;
/* The following uses a function which was added to rexxsyslib.library V45.
We therefore have a minimum library version requirement. */
if(RexxSysBase == NULL || RexxSysBase->lib_Version < 45 || NOT IsRexxMsg(message))
{
result = ERR10_010; /* invalid message packet */
goto out;
}
result = SetRexxVarFromMsg(variable_name,value,message);
out:
return(result);
}

View File

@ -1,101 +0,0 @@
/*
* $Id: amiga_setsuperattrs.c,v 1.4 2005-02-25 10:14:20 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 __PPC__
/****************************************************************************/
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
STATIC ULONG
SetSuperAttrsA(Class * cl,Object * obj,struct TagItem * tags)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWPOINTER(tags);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
{
struct opSet ops;
ops.MethodID = OM_SET;
ops.ops_AttrList = tags;
ops.ops_GInfo = NULL;
result = CallHookA(&cl->cl_Super->cl_Dispatcher,obj,&ops);
}
RETURN(result);
return(result);
}
/****************************************************************************/
ULONG
SetSuperAttrs(Class * cl,Object * obj,ULONG tag1,...)
{
ULONG result = 0;
ENTER();
SHOWPOINTER(cl);
SHOWPOINTER(obj);
SHOWVALUE(tag1);
assert( cl != NULL && obj != NULL );
if(cl != NULL && obj != NULL)
result = SetSuperAttrsA(cl,obj,(struct TagItem *)&tag1);
RETURN(result);
return(result);
}
/****************************************************************************/
#endif /* __PPC__ */

View File

@ -1,54 +0,0 @@
/*
* $Id: amiga_timedelay.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <devices/timer.h>
/****************************************************************************/
#include <clib/alib_protos.h>
/****************************************************************************/
LONG
TimeDelay(LONG unit,ULONG seconds,ULONG micros)
{
struct timeval tv;
LONG error;
tv.tv_secs = seconds;
tv.tv_micro = micros;
error = DoTimer(&tv,unit,TR_ADDREQUEST);
return(error);
}

View File

@ -1,60 +0,0 @@
/*
* $Id: amiga_waitbeam.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include <exec/interrupts.h>
#include <hardware/intbits.h>
#include <graphics/graphint.h>
#include <string.h>
/****************************************************************************/
#include <proto/graphics.h>
#include <clib/alib_protos.h>
/****************************************************************************/
#include "debug.h"
/****************************************************************************/
#define DO_NOTHING ((void)0)
/****************************************************************************/
VOID
waitbeam(LONG position)
{
while(position > VBeamPos())
DO_NOTHING;
}

View File

@ -1,31 +0,0 @@
; 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

View File

@ -1,27 +0,0 @@
#!/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}

View File

@ -1,38 +0,0 @@
/*
* $Id: c.lib_rev.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include "c.lib_rev.h"
/****************************************************************************/
char __c_lib_version[] = VERSTAG;

View File

@ -1,6 +0,0 @@
#define VERSION 1
#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)"

View File

@ -1 +0,0 @@
193

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,52 +0,0 @@
/*
* $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 */

View File

@ -1,68 +0,0 @@
/*
* $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 */

View File

@ -1,27 +0,0 @@
//
// $Id: crt0.S,v 1.3 2005-06-26 12:02:56 tfrieden Exp $
//
// :ts=4
//
.text
.globl _main
.globl _start
_start:
#if defined(SMALL_DATA)
/* Don't do a function call here, since that
means LR has to be saved */
lis r13, _SDA_BASE_@ha
addi r13, r13, _SDA_BASE_@l
#endif
#if defined(BASEREL_DATA)
/* We also need to set up the data segment pointer */
lis r2, _DATA_BASE_@ha
addi r2, r2, _DATA_BASE_@l
#endif
b _main

View File

@ -1,60 +0,0 @@
/*
* $Id: crtbegin.c,v 1.10 2005-03-18 12:38:22 obarthel Exp $
*
* :ts=4
*
* Handles global constructors and destructors for the OS4 GCC build.
*/
#if defined(__amigaos4__)
/****************************************************************************/
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/
/*
* Dummy constructor and destructor array. The linker script will put these at the
* very beginning of section ".ctors" and ".dtors". crtend.o contains a similar entry
* with a NULL pointer entry and is put at the end of the sections. This way, the init
* code can find the global constructor/destructor pointers
*/
static void (*__CTOR_LIST__[1]) (void) __attribute__(( used, section(".ctors"), aligned(sizeof(void (*)(void))) ));
static void (*__DTOR_LIST__[1]) (void) __attribute__(( used, section(".dtors"), aligned(sizeof(void (*)(void))) ));
/****************************************************************************/
void
_init(void)
{
int num_ctors,i;
int j;
for(i = 1, num_ctors = 0 ; __CTOR_LIST__[i] != NULL ; i++)
num_ctors++;
for(j = 0 ; j < num_ctors ; j++)
__CTOR_LIST__[num_ctors - j]();
}
/****************************************************************************/
void
_fini(void)
{
int num_dtors,i;
static int j;
for(i = 1, num_dtors = 0 ; __DTOR_LIST__[i] != NULL ; i++)
num_dtors++;
while(j++ < num_dtors)
__DTOR_LIST__[j]();
}
/****************************************************************************/
#endif /*__amigaos4__ */

View File

@ -1,19 +0,0 @@
/*
* $Id: crtend.c,v 1.2 2005-03-09 21:07:25 obarthel Exp $
*
* :ts=4
*
* End markers for the CTOR and DTOR list.
*/
#if defined(__amigaos4__)
/****************************************************************************/
static void (*__CTOR_LIST__[1]) (void) __attribute__((used, section(".ctors"), aligned(sizeof(void (*)(void))) ));
static void (*__DTOR_LIST__[1]) (void) __attribute__((used, section(".dtors"), aligned(sizeof(void (*)(void))) ));
/****************************************************************************/
#endif /*__amigaos4__ */

View File

@ -1,68 +0,0 @@
/*
* $Id: ctype_headers.h,v 1.5 2005-05-29 09:56:09 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
#define _CTYPE_HEADERS_H
/****************************************************************************/
#ifndef _LOCALE_HEADERS_H
#include "locale_headers.h"
#endif /* _LOCALE_HEADERS_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>
/****************************************************************************/
#endif /* _CTYPE_HEADERS_H */

View File

@ -1,74 +0,0 @@
/*
* $Id: ctype_isalnum.c,v 1.4 2005-05-29 09:56:09 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 isalnum
#undef isalpha
#undef isdigit
/****************************************************************************/
int
isalnum(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = isalpha(c) || isdigit(c);
}
__locale_unlock();
return(result);
}

View File

@ -1,73 +0,0 @@
/*
* $Id: ctype_isalpha.c,v 1.4 2005-05-29 09:56:09 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 isalpha
/****************************************************************************/
int
isalpha(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (('a' <= c && c <= 'z') ||
('A' <= c && c <= 'Z'));
}
__locale_unlock();
return(result);
}

View File

@ -1,56 +0,0 @@
/*
* $Id: ctype_isascii.c,v 1.2 2005-01-02 09:07:07 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 isascii
/****************************************************************************/
int isascii(int c);
/****************************************************************************/
int
isascii(int c)
{
int result;
result = (0 <= c && c <= 127);
return(result);
}

View File

@ -1,52 +0,0 @@
/*
* $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);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_iscntrl.c,v 1.4 2005-05-29 09:56:09 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 iscntrl
/****************************************************************************/
int
iscntrl(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (('\0' <= c && c < ' ') || (c == 127));
}
__locale_unlock();
return(result);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_isdigit.c,v 1.4 2005-05-29 09:56:09 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 isdigit
/****************************************************************************/
int
isdigit(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = ('0' <= c && c <= '9');
}
__locale_unlock();
return(result);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_isgraph.c,v 1.4 2005-05-29 09:56:09 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 isgraph
/****************************************************************************/
int
isgraph(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (' ' < c && c < 127);
}
__locale_unlock();
return(result);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_islower.c,v 1.4 2005-05-29 09:56:09 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 islower
/****************************************************************************/
int
islower(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = ('a' <= c && c <= 'z');
}
__locale_unlock();
return(result);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_isprint.c,v 1.4 2005-05-29 09:56:09 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 isprint
/****************************************************************************/
int
isprint(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (' ' <= c && c <= '~');
}
__locale_unlock();
return(result);
}

View File

@ -1,75 +0,0 @@
/*
* $Id: ctype_ispunct.c,v 1.4 2005-05-29 09:56:09 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 ispunct
/****************************************************************************/
int
ispunct(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (('!' <= c && c <= '/') ||
(':' <= c && c <= '@') ||
('[' <= c && c <= '`') ||
('{' <= c && c <= '~'));
}
__locale_unlock();
return(result);
}

View File

@ -1,77 +0,0 @@
/*
* $Id: ctype_isspace.c,v 1.4 2005-05-29 09:56:09 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 isspace
/****************************************************************************/
int
isspace(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (c == '\t' ||
c == '\r' ||
c == '\n' ||
c == '\v' ||
c == '\f' ||
c == ' ');
}
__locale_unlock();
return(result);
}

View File

@ -1,72 +0,0 @@
/*
* $Id: ctype_isupper.c,v 1.4 2005-05-29 09:56:09 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 isupper
/****************************************************************************/
int
isupper(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = ('A' <= c && c <= 'Z');
}
__locale_unlock();
return(result);
}

View File

@ -1,74 +0,0 @@
/*
* $Id: ctype_isxdigit.c,v 1.4 2005-05-29 09:56:09 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 isxdigit
/****************************************************************************/
int
isxdigit(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = (('0' <= c && c <= '9') ||
('a' <= c && c <= 'f') ||
('A' <= c && c <= 'F'));
}
__locale_unlock();
return(result);
}

View File

@ -1,178 +0,0 @@
/*
* $Id: ctype_table.c,v 1.3 2005-01-09 15:20:31 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.
*/
#define __C_MACROS__
#include <ctype.h>
/****************************************************************************/
const unsigned char __ctype_table[2 * 128] =
{
/* 0 */ __CTYPE_CONTROL,
/* 1 */ __CTYPE_CONTROL,
/* 2 */ __CTYPE_CONTROL,
/* 3 */ __CTYPE_CONTROL,
/* 4 */ __CTYPE_CONTROL,
/* 5 */ __CTYPE_CONTROL,
/* 6 */ __CTYPE_CONTROL,
/* 7 */ __CTYPE_CONTROL,
/* 8 */ __CTYPE_CONTROL,
/* 9 */ __CTYPE_CONTROL|__CTYPE_WHITE_SPACE,
/* 10 */ __CTYPE_CONTROL|__CTYPE_WHITE_SPACE,
/* 11 */ __CTYPE_CONTROL|__CTYPE_WHITE_SPACE,
/* 12 */ __CTYPE_CONTROL|__CTYPE_WHITE_SPACE,
/* 13 */ __CTYPE_CONTROL|__CTYPE_WHITE_SPACE,
/* 14 */ __CTYPE_CONTROL,
/* 15 */ __CTYPE_CONTROL,
/* 16 */ __CTYPE_CONTROL,
/* 17 */ __CTYPE_CONTROL,
/* 18 */ __CTYPE_CONTROL,
/* 19 */ __CTYPE_CONTROL,
/* 20 */ __CTYPE_CONTROL,
/* 21 */ __CTYPE_CONTROL,
/* 22 */ __CTYPE_CONTROL,
/* 23 */ __CTYPE_CONTROL,
/* 24 */ __CTYPE_CONTROL,
/* 25 */ __CTYPE_CONTROL,
/* 26 */ __CTYPE_CONTROL,
/* 27 */ __CTYPE_CONTROL,
/* 28 */ __CTYPE_CONTROL,
/* 29 */ __CTYPE_CONTROL,
/* 30 */ __CTYPE_CONTROL,
/* 31 */ __CTYPE_CONTROL,
/* 32, ' ' */ __CTYPE_PRINTABLE|__CTYPE_WHITE_SPACE,
/* 33, '!' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 34, '"' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 35, '#' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 36, '$' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 37, '%' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 38, '&' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 39, ''' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 40, '(' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 41, ')' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 42, '*' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 43, '+' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 44, ',' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 45, '-' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 46, '.' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 47, '/' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 48, '0' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 49, '1' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 50, '2' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 51, '3' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 52, '4' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 53, '5' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 54, '6' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 55, '7' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 56, '8' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 57, '9' */ __CTYPE_DIGIT|__CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE,
/* 58, ':' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 59, ';' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 60, '<' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 61, '=' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 62, '>' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 63, '?' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 64, '@' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 65, 'A' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 66, 'B' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 67, 'C' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 68, 'D' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 69, 'E' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 70, 'F' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 71, 'G' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 72, 'H' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 73, 'I' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 74, 'J' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 75, 'K' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 76, 'L' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 77, 'M' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 78, 'N' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 79, 'O' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 80, 'P' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 81, 'Q' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 82, 'R' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 83, 'S' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 84, 'T' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 85, 'U' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 86, 'V' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 87, 'W' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 88, 'X' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 89, 'Y' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 90, 'Z' */ __CTYPE_PRINTABLE|__CTYPE_UPPER_CASE,
/* 91, '[' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 92, '\' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 93, ']' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 94, '^' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 95, '_' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 96, '`' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 97, 'a' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 98, 'b' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 99, 'c' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 100, 'd' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 101, 'e' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 102, 'f' */ __CTYPE_HEX_DIGIT|__CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 103, 'g' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 104, 'h' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 105, 'i' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 106, 'j' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 107, 'k' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 108, 'l' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 109, 'm' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 110, 'n' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 111, 'o' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 112, 'p' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 113, 'q' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 114, 'r' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 115, 's' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 116, 't' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 117, 'u' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 118, 'v' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 119, 'w' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 120, 'x' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 121, 'y' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 122, 'z' */ __CTYPE_PRINTABLE|__CTYPE_LOWER_CASE,
/* 123, '{' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 124, '|' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 125, '}' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 126, '~' */ __CTYPE_PUNCTUATION|__CTYPE_PRINTABLE,
/* 127 */ __CTYPE_CONTROL,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

View File

@ -1,68 +0,0 @@
/*
* $Id: ctype_tolower.c,v 1.4 2005-05-29 09:56:09 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 */
/****************************************************************************/
int
tolower(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = ('A' <= c && c <= 'Z') ? (c + ('a' - 'A')) : c;
}
__locale_unlock();
return(result);
}

View File

@ -1,68 +0,0 @@
/*
* $Id: ctype_toupper.c,v 1.4 2005-05-29 09:56:09 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 */
/****************************************************************************/
int
toupper(int c)
{
DECLARE_LOCALEBASE();
int result;
__locale_lock();
if(__locale_table[LC_CTYPE] != NULL)
{
assert( LocaleBase != NULL );
/* 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
{
result = ('a' <= c && c <= 'z') ? (c - ('a' - 'A')) : c;
}
__locale_unlock();
return(result);
}

View File

@ -1,342 +0,0 @@
/*
* $Id: debug.c,v 1.3 2005-02-25 10:14:21 obarthel Exp $
*
* :ts=8
*
* 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.
*/
/****************************************************************************/
#define NULL ((void *)0L)
#include <string.h>
#include <stdarg.h>
/****************************************************************************/
#ifndef DEBUG
#define DEBUG 1
#endif
#include "debug.h"
/****************************************************************************/
extern void KPrintF(const char * format,...);
extern void KPutFmt(const char * format,va_list arg);
/****************************************************************************/
#define DEBUGLEVEL_OnlyAsserts 0
#define DEBUGLEVEL_Reports 1
#define DEBUGLEVEL_CallTracing 2
/****************************************************************************/
extern int __debug_level;
/****************************************************************************/
static int indent_level = 0;
static char program_name[40];
static int program_name_len = 0;
/****************************************************************************/
void
_SETPROGRAMNAME(char *name)
{
if(name != NULL && name[0] != '\0')
{
int i;
for(i = 0 ; name[i] != '\0' && i < (int)sizeof(program_name)-1 ; i++)
program_name[i] = name[i];
program_name[i] = '\0';
program_name_len = i;
}
else
{
program_name_len = 0;
}
}
/****************************************************************************/
int
_SETDEBUGLEVEL(int level)
{
int old_level = __debug_level;
__debug_level = level;
return(old_level);
}
/****************************************************************************/
int
_GETDEBUGLEVEL(void)
{
return(__debug_level);
}
/****************************************************************************/
static int previous_debug_level = -1;
void
_PUSHDEBUGLEVEL(int level)
{
previous_debug_level = _SETDEBUGLEVEL(level);
}
void
_POPDEBUGLEVEL(void)
{
if(previous_debug_level != -1)
{
_SETDEBUGLEVEL(previous_debug_level);
previous_debug_level = -1;
}
}
/****************************************************************************/
STATIC VOID
_INDENT(void)
{
if(program_name_len > 0)
KPrintF("(%s) ",program_name);
if(__debug_level >= DEBUGLEVEL_CallTracing)
{
int i;
for(i = 0 ; i < indent_level ; i++)
KPrintF(" ");
}
}
/****************************************************************************/
void
_SHOWVALUE(
unsigned long value,
int size,
const char *name,
const char *file,
int line)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
char *fmt;
switch(size)
{
case 1:
fmt = "%s:%ld:%s = %ld, 0x%02lx";
break;
case 2:
fmt = "%s:%ld:%s = %ld, 0x%04lx";
break;
default:
fmt = "%s:%ld:%s = %ld, 0x%08lx";
break;
}
_INDENT();
KPrintF(fmt,file,line,name,value,value);
if(size == 1 && value < 256)
{
if(value < ' ' || (value >= 127 && value < 160))
KPrintF(", '\\x%02lx'",value);
else
KPrintF(", '%lc'",value);
}
KPrintF("\n");
}
}
/****************************************************************************/
void
_SHOWPOINTER(
const void *pointer,
const char *name,
const char *file,
int line)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
char *fmt;
_INDENT();
if(pointer != NULL)
fmt = "%s:%ld:%s = 0x%08lx\n";
else
fmt = "%s:%ld:%s = NULL\n";
KPrintF(fmt,file,line,name,pointer);
}
}
/****************************************************************************/
void
_SHOWSTRING(
const char *string,
const char *name,
const char *file,
int line)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
_INDENT();
KPrintF("%s:%ld:%s = 0x%08lx \"%s\"\n",file,line,name,string,string);
}
}
/****************************************************************************/
void
_SHOWMSG(
const char *string,
const char *file,
int line)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
_INDENT();
KPrintF("%s:%ld:%s\n",file,line,string);
}
}
/****************************************************************************/
void
_DPRINTF_HEADER(
const char *file,
int line)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
_INDENT();
KPrintF("%s:%ld:",file,line);
}
}
void
_DPRINTF(const char *fmt,...)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
va_list args;
va_start(args,fmt);
KPutFmt((char *)fmt,args);
va_end(args);
KPrintF("\n");
}
}
void
_DLOG(const char *fmt,...)
{
if(__debug_level >= DEBUGLEVEL_Reports)
{
va_list args;
va_start(args,fmt);
KPutFmt((char *)fmt,args);
va_end(args);
}
}
/****************************************************************************/
void
_ENTER(
const char *file,
int line,
const char *function)
{
if(__debug_level >= DEBUGLEVEL_CallTracing)
{
_INDENT();
KPrintF("%s:%ld:Entering %s\n",file,line,function);
}
indent_level++;
}
void
_LEAVE(
const char *file,
int line,
const char *function)
{
indent_level--;
if(__debug_level >= DEBUGLEVEL_CallTracing)
{
_INDENT();
KPrintF("%s:%ld: Leaving %s\n",file,line,function);
}
}
void
_RETURN(
const char *file,
int line,
const char *function,
unsigned long result)
{
indent_level--;
if(__debug_level >= DEBUGLEVEL_CallTracing)
{
_INDENT();
KPrintF("%s:%ld: Leaving %s (result 0x%08lx, %ld)\n",file,line,function,result,result);
}
}

View File

@ -1,199 +0,0 @@
/*
* $Id: debug.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=8
*
* 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 _DEBUG_H
#define _DEBUG_H
/****************************************************************************/
/* IMPORTANT: If DEBUG is redefined, it must happen only here. This
* will cause all modules to depend upon it to be rebuilt
* by the smakefile (that is, provided the smakefile has
* all the necessary dependency lines in place).
*/
/*#define DEBUG*/
/****************************************************************************/
#define PUSH_REPORTS() PUSHDEBUGLEVEL(1)
#define PUSH_CALLS() PUSHDEBUGLEVEL(2)
#define PUSH_ALL() PUSHDEBUGLEVEL(2)
#define POP() POPDEBUGLEVEL()
/****************************************************************************/
#if defined(DEBUG)
/****************************************************************************/
#ifndef _STDLIB_H
#include <stdlib.h>
#endif /* _STDLIB_H */
#ifndef _DOS_H
#include <dos.h>
#endif /* _DOS_H */
/****************************************************************************/
extern void kprintf(const char *format,...);
/****************************************************************************/
void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line);
void _SHOWPOINTER(const void *p,const char *name,const char *file,int line);
void _SHOWSTRING(const char *string,const char *name,const char *file,int line);
void _SHOWMSG(const char *msg,const char *file,int line);
void _ENTER(const char *file,int line,const char *function);
void _LEAVE(const char *file,int line,const char *function);
void _RETURN(const char *file,int line,const char *function,unsigned long result);
void _DPRINTF_HEADER(const char *file,int line);
void _DPRINTF(const char *format,...);
void _DLOG(const char *format,...);
int _SETDEBUGLEVEL(int level);
void _PUSHDEBUGLEVEL(int level);
void _POPDEBUGLEVEL(void);
int _GETDEBUGLEVEL(void);
void _SETPROGRAMNAME(char *name);
#if defined(__SASC)
#define ENTER() _ENTER(__FILE__,__LINE__,__FUNC__)
#define LEAVE() _LEAVE(__FILE__,__LINE__,__FUNC__)
#define RETURN(r) _RETURN(__FILE__,__LINE__,__FUNC__,(unsigned long)r)
#define SHOWVALUE(v) _SHOWVALUE((unsigned long)v,sizeof(v),#v,__FILE__,__LINE__)
#define SHOWPOINTER(p) _SHOWPOINTER(p,#p,__FILE__,__LINE__)
#define SHOWSTRING(s) _SHOWSTRING(s,#s,__FILE__,__LINE__)
#define SHOWMSG(s) _SHOWMSG(s,__FILE__,__LINE__)
#define D(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0)
#define PRINTHEADER() _DPRINTF_HEADER(__FILE__,__LINE__)
#define PRINTF(s) _DLOG s
#define LOG(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DLOG("<%s()>:",__FUNC__); _DLOG s; } while(0)
#define SETDEBUGLEVEL(l) _SETDEBUGLEVEL(l)
#define PUSHDEBUGLEVEL(l) _PUSHDEBUGLEVEL(l)
#define POPDEBUGLEVEL() _POPDEBUGLEVEL()
#define SETPROGRAMNAME(n) _SETPROGRAMNAME(n)
#define GETDEBUGLEVEL() _GETDEBUGLEVEL()
#elif defined(__GNUC__)
#define ENTER() _ENTER(__FILE__,__LINE__,__FUNCTION__)
#define LEAVE() _LEAVE(__FILE__,__LINE__,__FUNCTION__)
#define RETURN(r) _RETURN(__FILE__,__LINE__,__FUNCTION__,(unsigned long)r)
#define SHOWVALUE(v) _SHOWVALUE((unsigned long)v,sizeof(v),#v,__FILE__,__LINE__)
#define SHOWPOINTER(p) _SHOWPOINTER(p,#p,__FILE__,__LINE__)
#define SHOWSTRING(s) _SHOWSTRING(s,#s,__FILE__,__LINE__)
#define SHOWMSG(s) _SHOWMSG(s,__FILE__,__LINE__)
#define D(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0)
#define PRINTHEADER() _DPRINTF_HEADER(__FILE__,__LINE__)
#define PRINTF(s) _DLOG s
#define LOG(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DLOG("<%s()>:",__FUNCTION__); _DLOG s; } while(0)
#define SETDEBUGLEVEL(l) _SETDEBUGLEVEL(l)
#define PUSHDEBUGLEVEL(l) _PUSHDEBUGLEVEL(l)
#define POPDEBUGLEVEL() _POPDEBUGLEVEL()
#define SETPROGRAMNAME(n) _SETPROGRAMNAME(n)
#define GETDEBUGLEVEL() _GETDEBUGLEVEL()
#else
#define __FUNC__ ""
#define ENTER() _ENTER(__FILE__,__LINE__,__FUNC__)
#define LEAVE() _LEAVE(__FILE__,__LINE__,__FUNC__)
#define RETURN(r) _RETURN(__FILE__,__LINE__,__FUNC__,(unsigned long)r)
#define SHOWVALUE(v) _SHOWVALUE((unsigned long)v,sizeof(v),#v,__FILE__,__LINE__)
#define SHOWPOINTER(p) _SHOWPOINTER(p,#p,__FILE__,__LINE__)
#define SHOWSTRING(s) _SHOWSTRING(s,#s,__FILE__,__LINE__)
#define SHOWMSG(s) _SHOWMSG(s,__FILE__,__LINE__)
#define D(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0)
#define PRINTHEADER() _DPRINTF_HEADER(__FILE__,__LINE__)
#define PRINTF(s) _DLOG s
#define LOG(s) do { _DPRINTF_HEADER(__FILE__,__LINE__); _DLOG("<%s()>:",__FUNC__); _DLOG s; } while(0)
#define SETDEBUGLEVEL(l) _SETDEBUGLEVEL(l)
#define PUSHDEBUGLEVEL(l) _PUSHDEBUGLEVEL(l)
#define POPDEBUGLEVEL() _POPDEBUGLEVEL()
#define SETPROGRAMNAME(n) _SETPROGRAMNAME(n)
#define GETDEBUGLEVEL() _GETDEBUGLEVEL()
#endif
#undef DEBUG
#define DEBUG 1
#define assert(expression) \
((void) \
((expression) ? 0 : \
( \
*(char *)0 = 0, /* Enforcer hit */ \
_SETDEBUGLEVEL(2), \
kprintf("[%s] " \
"%s:%ld: failed assertion '%s'\n", \
__program_name, \
__FILE__, \
__LINE__, \
#expression), \
abort(), \
0 \
) \
) \
)
#else
/****************************************************************************/
#ifdef NDEBUG
#define assert(expression) ((void)0)
#else
#include <assert.h>
#endif /* NDEBUG */
/****************************************************************************/
#define ENTER() ((void)0)
#define LEAVE() ((void)0)
#define RETURN(r) ((void)0)
#define SHOWVALUE(v) ((void)0)
#define SHOWPOINTER(p) ((void)0)
#define SHOWSTRING(s) ((void)0)
#define SHOWMSG(s) ((void)0)
#define D(s) ((void)0)
#define PRINTHEADER() ((void)0)
#define PRINTF(s) ((void)0)
#define LOG(s) ((void)0)
#define SETDEBUGLEVEL(l) ((void)0)
#define PUSHDEBUGLEVEL(l) ((void)0)
#define POPDEBUGLEVEL() ((void)0)
#define SETPROGRAMNAME(n) ((void)0)
#define GETDEBUGLEVEL() (0)
#define DEBUG 0
#endif /* DEBUG */
/****************************************************************************/
#endif /* _DEBUG_H */

View File

@ -1,38 +0,0 @@
/*
* $Id: debug.lib_rev.c,v 1.2 2005-01-02 09:07:07 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.
*/
#include "debug.lib_rev.h"
/****************************************************************************/
char __debug_lib_version[] = VERSTAG;

View File

@ -1,6 +0,0 @@
#define VERSION 1
#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)"

View File

@ -1 +0,0 @@
193

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