mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Compare commits
207 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6245dccb4b | |||
| 525bdde6d5 | |||
| 38818e6502 | |||
| ebf5d63bc6 | |||
| 2421ffcbb9 | |||
| 2bdd055f4b | |||
| 039c805161 | |||
| e19974fe47 | |||
| bb41d5e549 | |||
| fd163c7105 | |||
| a3d61a67c8 | |||
| 459d57da9c | |||
| 3d58795d0f | |||
| e293873dc7 | |||
| 17e3b3b0e2 | |||
| ae1ac21c71 | |||
| 2025e39014 | |||
| ea09fc96db | |||
| bf0a6e0c43 | |||
| cf74717ead | |||
| f81dfdfca7 | |||
| 196ce6e140 | |||
| 629e40475f | |||
| 85e421feb8 | |||
| 3be260b746 | |||
| b78a86774c | |||
| 9aba55afba | |||
| 426fe0cc61 | |||
| 6a13b08f40 | |||
| 59807dbff1 | |||
| 414e07aa20 | |||
| 2a22c4ff0d | |||
| 576660ca0a | |||
| 5451d3a694 | |||
| c26da2c5e8 | |||
| c3975b1e6e | |||
| a79b05194d | |||
| 3975d234bd | |||
| 3c220c3939 | |||
| 49e98713d4 | |||
| 505c23237a | |||
| ffeb475873 | |||
| c3a10b88b5 | |||
| 2ced1d3293 | |||
| fb4dae84aa | |||
| a03ced93b0 | |||
| a19d60f524 | |||
| f6d20fee01 | |||
| d4aa0b04af | |||
| df05c80c57 | |||
| a1ffc20864 | |||
| 13c857ba0a | |||
| 5ecfdf33c6 | |||
| fa31c468dc | |||
| feb29fa334 | |||
| d0a4e057bc | |||
| c5087c78ce | |||
| c5c6492868 | |||
| 539cc3553d | |||
| bc65dd2877 | |||
| ec027fa510 | |||
| 65484eac3c | |||
| 2be60de3e7 | |||
| 89b568bcb8 | |||
| 2548af2b4b | |||
| a1b39c4d01 | |||
| 9e32991a6d | |||
| c8d29ea9c1 | |||
| 28f561c61b | |||
| 07056f3e26 | |||
| 3bd6766484 | |||
| e01d58319d | |||
| ec4fd3c2cb | |||
| df89c636db | |||
| 90a192134e | |||
| 3660b26c9f | |||
| 9f3d5e50b4 | |||
| 876039440f | |||
| 0c553faff1 | |||
| 1d611fefbe | |||
| a50aba0b64 | |||
| 2e9ac7d003 | |||
| 0a440c8405 | |||
| f63a0788d5 | |||
| 431dd488a1 | |||
| 15c16efd07 | |||
| 6e39efe7d7 | |||
| 92cc3e9a79 | |||
| a18f415374 | |||
| 3096691d75 | |||
| d5c36d66e4 | |||
| 7f9fbc453b | |||
| 6f010ddf87 | |||
| 09b52e077f | |||
| 9c2c44b008 | |||
| df01f27551 | |||
| 58d26ce8cb | |||
| b1ac45a0b9 | |||
| aafda37c84 | |||
| 3eb15a612f | |||
| 590d1b8eec | |||
| 1fbe4bd0a5 | |||
| 8edfcc3f86 | |||
| a6daababe7 | |||
| 5695784272 | |||
| 5eefcf4555 | |||
| d85d6648ea | |||
| c471c50784 | |||
| cd10dc9a1a | |||
| 7d3ea7fae6 | |||
| ead29c1850 | |||
| f492e6a6c0 | |||
| dc80018239 | |||
| 966851e8bd | |||
| a60623bbc6 | |||
| d8bf652ae6 | |||
| b048323196 | |||
| 08cc54d3fa | |||
| 419172fb0e | |||
| f289140266 | |||
| 86b7e5c429 | |||
| 42963b39c4 | |||
| 678cab02fb | |||
| 59d7f8d07f | |||
| 9a7c8a8705 | |||
| 96e74015f0 | |||
| db8710d2ae | |||
| 91f12dd8f0 | |||
| d2f157b0a1 | |||
| e3e82b3657 | |||
| 4d3dc4a77f | |||
| ee556fcb35 | |||
| cc8a8e42c0 | |||
| 0fad53e56e | |||
| d33e3e909e | |||
| ef43011783 | |||
| a9c8cdc554 | |||
| d370bd123b | |||
| 6931123dc1 | |||
| b2ddf28fa7 | |||
| 1bc19a04d3 | |||
| 1a0999bc1c | |||
| 1bf430d1d6 | |||
| f2d1a3238d | |||
| 2c3bd39f71 | |||
| 0deb0e3e2d | |||
| dd380f8479 | |||
| ec3d921f7b | |||
| ebd6cc3639 | |||
| 7690bb8399 | |||
| 2aba208878 | |||
| 593caccb38 | |||
| ac0cc97924 | |||
| ef44c75126 | |||
| 9a8fe330a9 | |||
| 17d81c12c0 | |||
| c799b17bb9 | |||
| 1df294c07e | |||
| f51faeb168 | |||
| c0c70bfd99 | |||
| b10d1ad38c | |||
| 1550c6fef3 | |||
| 53d99ac7a2 | |||
| c4c25649f2 | |||
| 18f1f75479 | |||
| 410833d2ed | |||
| cfa6f566db | |||
| 99547756fe | |||
| ea638f0970 | |||
| 4aa85e1d12 | |||
| fcb8cfc0dc | |||
| a626336b7b | |||
| 07d09bb185 | |||
| 6ad88ff97f | |||
| 2ddfeab0cf | |||
| 91028c63bc | |||
| 209884bd1f | |||
| 3548d3cf7e | |||
| 50b8b623cc | |||
| 49bc1d6b13 | |||
| fce21e21d6 | |||
| f8b1e7516f | |||
| 8e2820e9b7 | |||
| ab22a23f27 | |||
| 0ae8d68e64 | |||
| 0b1d21471d | |||
| 987316e638 | |||
| e8d4187ea5 | |||
| 003faf7a24 | |||
| d1aaa84bcc | |||
| e1476c15b3 | |||
| 17fea5626a | |||
| e4b70e946f | |||
| 56b0a74c61 | |||
| d23f4318f9 | |||
| 23f70d0c53 | |||
| c6fcede4ce | |||
| 5801d000d4 | |||
| 619b64e6f4 | |||
| 5191ee5660 | |||
| 64c1175f7b | |||
| be827762de | |||
| 618299fb48 | |||
| fbc6d94840 | |||
| 5cf80326bc | |||
| e571888f4f | |||
| f519aafaca |
@ -1,13 +0,0 @@
|
|||||||
# The "checkoutlist" file is used to support additional version controlled
|
|
||||||
# administrative files in $CVSROOT/CVSROOT, such as template files.
|
|
||||||
#
|
|
||||||
# The first entry on a line is a filename which will be checked out from
|
|
||||||
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
|
|
||||||
# The remainder of the line is an error message to use if the file cannot
|
|
||||||
# be checked out.
|
|
||||||
#
|
|
||||||
# File format:
|
|
||||||
#
|
|
||||||
# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line>
|
|
||||||
#
|
|
||||||
# comment lines begin with '#'
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
# The "commitinfo" file is used to control pre-commit checks.
|
|
||||||
# The filter on the right is invoked with the repository and a list
|
|
||||||
# of files to check. A non-zero exit of the filter program will
|
|
||||||
# cause the commit to be aborted.
|
|
||||||
#
|
|
||||||
# The first entry on a line is a regular expression which is tested
|
|
||||||
# against the directory that the change is being committed to, relative
|
|
||||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
|
||||||
# of the line is the name of the filter to run.
|
|
||||||
#
|
|
||||||
# If the repository name does not match any of the regular expressions in this
|
|
||||||
# file, the "DEFAULT" line is used, if it is specified.
|
|
||||||
#
|
|
||||||
# If the name "ALL" appears as a regular expression it is always used
|
|
||||||
# in addition to the first matching regex or "DEFAULT".
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
# Set this to "no" if pserver shouldn't check system users/passwords
|
|
||||||
#SystemAuth=no
|
|
||||||
|
|
||||||
# Put CVS lock files in this directory rather than directly in the repository.
|
|
||||||
#LockDir=/var/lock/cvs
|
|
||||||
|
|
||||||
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
|
|
||||||
# level of the new working directory when using the `cvs checkout'
|
|
||||||
# command.
|
|
||||||
#TopLevelAdmin=no
|
|
||||||
|
|
||||||
# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the
|
|
||||||
# history file, or a subset as needed (ie `TMAR' logs all write operations)
|
|
||||||
#LogHistory=TOEFWUPCGMAR
|
|
||||||
|
|
||||||
# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg
|
|
||||||
# script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra
|
|
||||||
# second per directory being committed, so it is not recommended for large
|
|
||||||
# repositories. Set it to `never' (the previous CVS behavior) to prevent
|
|
||||||
# verifymsg scripts from changing the log message.
|
|
||||||
#RereadLogAfterVerify=always
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
# This file affects handling of files based on their names.
|
|
||||||
#
|
|
||||||
# The -m option specifies whether CVS attempts to merge files.
|
|
||||||
#
|
|
||||||
# The -k option specifies keyword expansion (e.g. -kb for binary).
|
|
||||||
#
|
|
||||||
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
|
|
||||||
#
|
|
||||||
# wildcard [option value][option value]...
|
|
||||||
#
|
|
||||||
# where option is one of
|
|
||||||
# -f from cvs filter value: path to filter
|
|
||||||
# -t to cvs filter value: path to filter
|
|
||||||
# -m update methodology value: MERGE or COPY
|
|
||||||
# -k expansion mode value: b, o, kkv, &c
|
|
||||||
#
|
|
||||||
# and value is a single-quote delimited value.
|
|
||||||
# For example:
|
|
||||||
#*.gif -k 'b'
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
# The "editinfo" file is used to allow verification of logging
|
|
||||||
# information. It works best when a template (as specified in the
|
|
||||||
# rcsinfo file) is provided for the logging procedure. Given a
|
|
||||||
# template with locations for, a bug-id number, a list of people who
|
|
||||||
# reviewed the code before it can be checked in, and an external
|
|
||||||
# process to catalog the differences that were code reviewed, the
|
|
||||||
# following test can be applied to the code:
|
|
||||||
#
|
|
||||||
# Making sure that the entered bug-id number is correct.
|
|
||||||
# Validating that the code that was reviewed is indeed the code being
|
|
||||||
# checked in (using the bug-id number or a seperate review
|
|
||||||
# number to identify this particular code set.).
|
|
||||||
#
|
|
||||||
# If any of the above test failed, then the commit would be aborted.
|
|
||||||
#
|
|
||||||
# Actions such as mailing a copy of the report to each reviewer are
|
|
||||||
# better handled by an entry in the loginfo file.
|
|
||||||
#
|
|
||||||
# One thing that should be noted is the the ALL keyword is not
|
|
||||||
# supported. There can be only one entry that matches a given
|
|
||||||
# repository.
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
# The "loginfo" file controls where "cvs commit" log information
|
|
||||||
# is sent. The first entry on a line is a regular expression which must match
|
|
||||||
# the directory that the change is being made to, relative to the
|
|
||||||
# $CVSROOT. If a match is found, then the remainder of the line is a filter
|
|
||||||
# program that should expect log information on its standard input.
|
|
||||||
#
|
|
||||||
# If the repository name does not match any of the regular expressions in this
|
|
||||||
# file, the "DEFAULT" line is used, if it is specified.
|
|
||||||
#
|
|
||||||
# If the name ALL appears as a regular expression it is always used
|
|
||||||
# in addition to the first matching regex or DEFAULT.
|
|
||||||
#
|
|
||||||
# You may specify a format string as part of the
|
|
||||||
# filter. The string is composed of a `%' followed
|
|
||||||
# by a single format character, or followed by a set of format
|
|
||||||
# characters surrounded by `{' and `}' as separators. The format
|
|
||||||
# characters are:
|
|
||||||
#
|
|
||||||
# s = file name
|
|
||||||
# V = old version number (pre-checkin)
|
|
||||||
# v = new version number (post-checkin)
|
|
||||||
# t = tag or branch name
|
|
||||||
#
|
|
||||||
# For example:
|
|
||||||
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
|
||||||
# or
|
|
||||||
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
# Three different line formats are valid:
|
|
||||||
# key -a aliases...
|
|
||||||
# key [options] directory
|
|
||||||
# key [options] directory files...
|
|
||||||
#
|
|
||||||
# Where "options" are composed of:
|
|
||||||
# -i prog Run "prog" on "cvs commit" from top-level of module.
|
|
||||||
# -o prog Run "prog" on "cvs checkout" of module.
|
|
||||||
# -e prog Run "prog" on "cvs export" of module.
|
|
||||||
# -t prog Run "prog" on "cvs rtag" of module.
|
|
||||||
# -u prog Run "prog" on "cvs update" of module.
|
|
||||||
# -d dir Place module in directory "dir" instead of module name.
|
|
||||||
# -l Top-level directory only -- do not recurse.
|
|
||||||
#
|
|
||||||
# NOTE: If you change any of the "Run" options above, you'll have to
|
|
||||||
# release and re-checkout any working directories of these modules.
|
|
||||||
#
|
|
||||||
# And "directory" is a path to a directory relative to $CVSROOT.
|
|
||||||
#
|
|
||||||
# The "-a" option specifies an alias. An alias is interpreted as if
|
|
||||||
# everything on the right of the "-a" had been typed on the command line.
|
|
||||||
#
|
|
||||||
# You can encode a module within a module by using the special '&'
|
|
||||||
# character to interpose another module into the current module. This
|
|
||||||
# can be useful for creating a module that consists of many directories
|
|
||||||
# spread out over the entire source repository.
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
# The "notify" file controls where notifications from watches set by
|
|
||||||
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
|
|
||||||
# a regular expression which is tested against the directory that the
|
|
||||||
# change is being made to, relative to the $CVSROOT. If it matches,
|
|
||||||
# then the remainder of the line is a filter program that should contain
|
|
||||||
# one occurrence of %s for the user to notify, and information on its
|
|
||||||
# standard input.
|
|
||||||
#
|
|
||||||
# "ALL" or "DEFAULT" can be used in place of the regular expression.
|
|
||||||
#
|
|
||||||
# For example:
|
|
||||||
#ALL mail -s "CVS notification" %s
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
# The "rcsinfo" file is used to control templates with which the editor
|
|
||||||
# is invoked on commit and import.
|
|
||||||
#
|
|
||||||
# The first entry on a line is a regular expression which is tested
|
|
||||||
# against the directory that the change is being made to, relative to the
|
|
||||||
# $CVSROOT. For the first match that is found, then the remainder of the
|
|
||||||
# line is the name of the file that contains the template.
|
|
||||||
#
|
|
||||||
# If the repository name does not match any of the regular expressions in this
|
|
||||||
# file, the "DEFAULT" line is used, if it is specified.
|
|
||||||
#
|
|
||||||
# If the name "ALL" appears as a regular expression it is always used
|
|
||||||
# in addition to the first matching regex or "DEFAULT".
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
# The "taginfo" file is used to control pre-tag checks.
|
|
||||||
# The filter on the right is invoked with the following arguments:
|
|
||||||
#
|
|
||||||
# $1 -- tagname
|
|
||||||
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
|
|
||||||
# $3 -- repository
|
|
||||||
# $4-> file revision [file revision ...]
|
|
||||||
#
|
|
||||||
# A non-zero exit of the filter program will cause the tag to be aborted.
|
|
||||||
#
|
|
||||||
# The first entry on a line is a regular expression which is tested
|
|
||||||
# against the directory that the change is being committed to, relative
|
|
||||||
# to the $CVSROOT. For the first match that is found, then the remainder
|
|
||||||
# of the line is the name of the filter to run.
|
|
||||||
#
|
|
||||||
# If the repository name does not match any of the regular expressions in this
|
|
||||||
# file, the "DEFAULT" line is used, if it is specified.
|
|
||||||
#
|
|
||||||
# If the name "ALL" appears as a regular expression it is always used
|
|
||||||
# in addition to the first matching regex or "DEFAULT".
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
# The "verifymsg" file is used to allow verification of logging
|
|
||||||
# information. It works best when a template (as specified in the
|
|
||||||
# rcsinfo file) is provided for the logging procedure. Given a
|
|
||||||
# template with locations for, a bug-id number, a list of people who
|
|
||||||
# reviewed the code before it can be checked in, and an external
|
|
||||||
# process to catalog the differences that were code reviewed, the
|
|
||||||
# following test can be applied to the code:
|
|
||||||
#
|
|
||||||
# Making sure that the entered bug-id number is correct.
|
|
||||||
# Validating that the code that was reviewed is indeed the code being
|
|
||||||
# checked in (using the bug-id number or a seperate review
|
|
||||||
# number to identify this particular code set.).
|
|
||||||
#
|
|
||||||
# If any of the above test failed, then the commit would be aborted.
|
|
||||||
#
|
|
||||||
# Actions such as mailing a copy of the report to each reviewer are
|
|
||||||
# better handled by an entry in the loginfo file.
|
|
||||||
#
|
|
||||||
# One thing that should be noted is the the ALL keyword is not
|
|
||||||
# supported. There can be only one entry that matches a given
|
|
||||||
# repository.
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
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 "netinclude" which has to sit in the same directory as
|
|
||||||
the source code and the "include" 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.
|
|
||||||
|
|
||||||
The SAS/C flavour (smakefile) 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 (startup.o) and doesn't tinker with A4 relative data
|
|
||||||
addressing (and how this may be set up).
|
|
||||||
|
|
||||||
There are two makefiles for GCC, each a different flavour. There is "GNUmakefile.68k",
|
|
||||||
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 ("GNUmakefile.os4"). 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.
|
|
||||||
@ -1,235 +0,0 @@
|
|||||||
An ISO 'C' (1994) compliant runtime library for the Amiga
|
|
||||||
=========================================================
|
|
||||||
|
|
||||||
1. What is this?
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
2. What does it do?
|
|
||||||
|
|
||||||
Using "'C' - A reference manual" 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.
|
|
||||||
|
|
||||||
Because Samba needs a few POSIX-like routines to be supported, the library
|
|
||||||
functionality is complemented by a set of routines described in "Advanced
|
|
||||||
programming in the Unix environent". This set is not complete, however. It
|
|
||||||
will have to grow even further to accomodate for Samba's needs, but this is
|
|
||||||
a good start. I specifically added hooks for integrating socket I/O at a
|
|
||||||
later point of time.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
The library supports floating point math, which 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 IEEE_FLOATING_POINT_SUPPORT preprocessor symbol to activate IEEE math
|
|
||||||
code and the M68881_FLOATING_POINT_SUPPORT symbol for M68881 inline math.
|
|
||||||
|
|
||||||
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 '__stack_size' variable
|
|
||||||
(see "stdlib_main.c").
|
|
||||||
|
|
||||||
I added some amiga.lib and debug.lib functionality to the library, but
|
|
||||||
don't count on it to be complete.
|
|
||||||
|
|
||||||
|
|
||||||
3. What does it not do?
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Practically all library routines are implemented in a sort of na<6E>ve
|
|
||||||
fashion. That is, they contain virtually no optimizations whatsoever. This
|
|
||||||
is particularly apparent in workhorses such as memset() or memmove(). But
|
|
||||||
then, the issue is easy testability and Amiga platform portability.
|
|
||||||
|
|
||||||
There is very little support for amiga.lib functionality. There is
|
|
||||||
NewList(), HookEntry(), CallHook(), CallHookA(), the DoMethod() 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 amiga.lib, you really shouldn't need in
|
|
||||||
in the first place.
|
|
||||||
|
|
||||||
|
|
||||||
4. Where does the source code come from?
|
|
||||||
|
|
||||||
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 bcopy() as an
|
|
||||||
alias for memcpy(), and unlike memcpy() is documented to, bcopy() supports
|
|
||||||
overlapping copies.
|
|
||||||
|
|
||||||
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
|
|
||||||
setjmp/longjmp routines and the startup code. The M68881 inline math code
|
|
||||||
comes from the <math-68881.h> file written by Matthew Self
|
|
||||||
(self@bayes.arc.nasa.gov).
|
|
||||||
|
|
||||||
|
|
||||||
5. Limitations and caveats
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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 malloc() 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 free() 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 NDEBUG preprocessor symbol at compile time
|
|
||||||
(see <assert.h>).
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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 data=faronly option to compile
|
|
||||||
the library and the programs.
|
|
||||||
|
|
||||||
If you are going to rebuild the library with SAS/C you will need to
|
|
||||||
reassign INCLUDE: to point to the local 'include' directory or things won't
|
|
||||||
work.
|
|
||||||
|
|
||||||
|
|
||||||
6. Conventions and design issues
|
|
||||||
|
|
||||||
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 "unistd_lchown.c"
|
|
||||||
contains the definition of the lchown() routine, which has its prototype
|
|
||||||
defined in the <unistd.h> header file.
|
|
||||||
|
|
||||||
Internal function and variable names are prefixed with two underscores, as
|
|
||||||
in '__stdio_init()'.
|
|
||||||
|
|
||||||
All routines attempt to do error checking on their parameters. They will
|
|
||||||
either drop into an assert() or set an errno value and refuse to go any
|
|
||||||
further. This cuts performance but should help to catch the simple bugs
|
|
||||||
quite easily (NULL pointers).
|
|
||||||
|
|
||||||
Just like any halfway sane Amiga 'C'<27>runtime library, this one performs its
|
|
||||||
^C 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 ^C signal and
|
|
||||||
drop into raise(SIGINT) 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.
|
|
||||||
|
|
||||||
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, unlink() will by default operate like DeleteFile()
|
|
||||||
and rename() 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 '__unix_semantics'
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
7. The startup code
|
|
||||||
|
|
||||||
There are three program startup files provided. The most simplistic is in
|
|
||||||
'startup.c' which I use for SAS/C. It just invokes the setup routine which
|
|
||||||
eventually calls main() and drops straight into exit().
|
|
||||||
|
|
||||||
The ncrt0.S file was adapted from the libnix startup code which sets up the
|
|
||||||
base relative data area, if necessary (the SMALL_DATA preprocessor symbol
|
|
||||||
must be defined).
|
|
||||||
|
|
||||||
The nrcrt0.S 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
|
|
||||||
geta4() stub is missing here; it wouldn't work in a resident program
|
|
||||||
anyway.
|
|
||||||
|
|
||||||
The ncrt0.S and nrcrt0.S 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 stdlib_main.c file
|
|
||||||
rather than in assembly language.
|
|
||||||
|
|
||||||
|
|
||||||
8. Documentation
|
|
||||||
|
|
||||||
Well, you're reading it. There isn't anything much yet. You can consult the book
|
|
||||||
"'C' - A reference manual" and you could look at the Open Group's Single Unix
|
|
||||||
Specification at <http://www.opengroup.org/onlinepubs/007904975>.
|
|
||||||
|
|
||||||
|
|
||||||
9. Legal status
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
The PowerPC math library is based in part on work by Sun Microsystems:
|
|
||||||
|
|
||||||
====================================================
|
|
||||||
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.
|
|
||||||
====================================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
10. Contacting the author
|
|
||||||
|
|
||||||
The basic work was done by Olaf Barthel during two weeks in July 2002. You
|
|
||||||
can reach me at:
|
|
||||||
|
|
||||||
Olaf Barthel
|
|
||||||
Gneisenaustr. 43
|
|
||||||
D-31275 Lehrte
|
|
||||||
|
|
||||||
Or via e-mail:
|
|
||||||
|
|
||||||
olsen@sourcery.han.de
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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;
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#define VERSION 1
|
|
||||||
#define REVISION 185
|
|
||||||
#define DATE "2.1.2005"
|
|
||||||
#define VERS "amiga.lib 1.185"
|
|
||||||
#define VSTRING "amiga.lib 1.185 (2.1.2005)\r\n"
|
|
||||||
#define VERSTAG "\0$VER: amiga.lib 1.185 (2.1.2005)"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
185
|
|
||||||
@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_acrypt.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 <exec/types.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <clib/alib_protos.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#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);
|
|
||||||
}
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_addtof.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 <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);
|
|
||||||
}
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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__ */
|
|
||||||
@ -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__ */
|
|
||||||
@ -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
|
|
||||||
@ -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__ */
|
|
||||||
@ -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__ */
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -1,236 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_createtask.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/memory.h>
|
|
||||||
#include <exec/tasks.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <proto/exec.h>
|
|
||||||
#include <clib/alib_protos.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__ */
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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__ */
|
|
||||||
@ -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__ */
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_dotimer.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/errors.h>
|
|
||||||
|
|
||||||
#include <devices/timer.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <proto/exec.h>
|
|
||||||
#include <clib/alib_protos.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 );
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
FreeVec(mp);
|
|
||||||
|
|
||||||
return(error);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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
|
|
||||||
@ -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__ */
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -1,208 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_invertstring.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 <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);
|
|
||||||
}
|
|
||||||
@ -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();
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -1,193 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_rexxvars.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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#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__ */
|
|
||||||
|
|
||||||
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 TEXT 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);
|
|
||||||
}
|
|
||||||
@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: amiga_setsuperattrs.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"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
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__ */
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -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;
|
|
||||||
}
|
|
||||||
@ -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;
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#define VERSION 1
|
|
||||||
#define REVISION 185
|
|
||||||
#define DATE "2.1.2005"
|
|
||||||
#define VERS "c.lib 1.185"
|
|
||||||
#define VSTRING "c.lib 1.185 (2.1.2005)\r\n"
|
|
||||||
#define VERSTAG "\0$VER: c.lib 1.185 (2.1.2005)"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
185
|
|
||||||
3366
library/changes
3366
library/changes
File diff suppressed because it is too large
Load Diff
@ -1,40 +0,0 @@
|
|||||||
//
|
|
||||||
// $Id: crt0.S,v 1.2 2004-11-28 12:31:27 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
|
|
||||||
|
|
||||||
#if defined(BASEREL_DATA)
|
|
||||||
.section .rodata
|
|
||||||
|
|
||||||
.globl __data_segment_descriptor
|
|
||||||
__data_segment_descriptor:
|
|
||||||
.long __data_start
|
|
||||||
.long __data_end
|
|
||||||
.long _DATA_BASE_
|
|
||||||
|
|
||||||
.section .dend, "wa", @nobits
|
|
||||||
.space 4
|
|
||||||
#endif
|
|
||||||
@ -1,138 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: crtbegin.c,v 1.3 2004-09-29 16:54:54 obarthel Exp $
|
|
||||||
*
|
|
||||||
* :ts=4
|
|
||||||
*
|
|
||||||
* Handles global constructors and destructors.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <exec/types.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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__((section(".ctors"))) = { (void *)-1 };
|
|
||||||
static void (*__DTOR_LIST__[1]) (void) __attribute__((section(".dtors"))) = { (void *)-1 };
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
|
||||||
_do_ctors(void)
|
|
||||||
{
|
|
||||||
void (**pFuncPtr)(void);
|
|
||||||
|
|
||||||
/* Skip the first entry in the list (it's -1 anyway) */
|
|
||||||
pFuncPtr = __CTOR_LIST__ + 1;
|
|
||||||
|
|
||||||
/* Call all constructors in forward order */
|
|
||||||
while (*pFuncPtr != NULL)
|
|
||||||
(**pFuncPtr++)();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
|
||||||
_do_dtors(void)
|
|
||||||
{
|
|
||||||
ULONG i = (ULONG)__DTOR_LIST__[0];
|
|
||||||
void (**pFuncPtr)(void);
|
|
||||||
|
|
||||||
if (i == ~0UL)
|
|
||||||
{
|
|
||||||
/* Find the end of the destructors list */
|
|
||||||
i = 1;
|
|
||||||
|
|
||||||
while (__DTOR_LIST__[i] != NULL)
|
|
||||||
i++;
|
|
||||||
|
|
||||||
/* We're at the NULL entry now. Go back by one */
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Call all destructors in reverse order */
|
|
||||||
pFuncPtr = __DTOR_LIST__ + i;
|
|
||||||
while (i-- > 0)
|
|
||||||
(**pFuncPtr--)();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
typedef void (*func_ptr)(void);
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
|
||||||
_do_ctors(void)
|
|
||||||
{
|
|
||||||
extern func_ptr __CTOR_LIST__[];
|
|
||||||
ULONG nptrs = (ULONG)__CTOR_LIST__[0];
|
|
||||||
ULONG i;
|
|
||||||
|
|
||||||
for(i = nptrs ; i > 0 ; i--)
|
|
||||||
__CTOR_LIST__[i]();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
static void
|
|
||||||
_do_dtors(void)
|
|
||||||
{
|
|
||||||
extern func_ptr __DTOR_LIST__[];
|
|
||||||
extern jmp_buf __exit_jmp_buf;
|
|
||||||
ULONG nptrs = (ULONG)__DTOR_LIST__[0];
|
|
||||||
static ULONG i;
|
|
||||||
|
|
||||||
/* If one of the destructors drops into
|
|
||||||
* exit(), processing will continue with
|
|
||||||
* the next following destructor.
|
|
||||||
*/
|
|
||||||
(void)setjmp(__exit_jmp_buf);
|
|
||||||
|
|
||||||
while(i++ < nptrs)
|
|
||||||
__DTOR_LIST__[i]();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#endif /*__amigaos4__ */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
/* FIXME: Do we need to put these in .init/.fini sections? */
|
|
||||||
|
|
||||||
//void _init(void) __attribute__((section(".init")));
|
|
||||||
//void _fini(void) __attribute__((section(".fini")));
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
void
|
|
||||||
_init(void)
|
|
||||||
{
|
|
||||||
_do_ctors();
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
void
|
|
||||||
_fini(void)
|
|
||||||
{
|
|
||||||
_do_dtors();
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: crtend.c,v 1.1.1.1 2004-07-26 16:30:22 obarthel Exp $
|
|
||||||
*
|
|
||||||
* :ts=4
|
|
||||||
*
|
|
||||||
* End markers for the CTOR and DTOR list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
static volatile void (*__CTOR_LIST__[1]) (void) __attribute__((used,section(".ctors"))) = { (void *)0 };
|
|
||||||
static volatile void (*__DTOR_LIST__[1]) (void) __attribute__((used,section(".dtors"))) = { (void *)0 };
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#endif /*__amigaos4__ */
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_headers.h,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
|
|
||||||
#define _CTYPE_HEADERS_H
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _LOCALE_HEADERS_H
|
|
||||||
#include "locale_headers.h"
|
|
||||||
#endif /* _LOCALE_HEADERS_H */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _STDLIB_LOCALE_UTILITY_H
|
|
||||||
#include "stdlib_locale_utility.h"
|
|
||||||
#endif /* _STDLIB_LOCALE_UTILITY_H */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include "macros.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#endif /* _CTYPE_HEADERS_H */
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isalnum.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 isalnum
|
|
||||||
#undef isalpha
|
|
||||||
#undef isdigit
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isalnum(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsAlNum(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = isalpha(c) || isdigit(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isalpha.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 isalpha
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isalpha(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsAlpha(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (('a' <= c && c <= 'z') ||
|
|
||||||
('A' <= c && c <= 'Z'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -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);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_iscntrl.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 iscntrl
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
iscntrl(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsCntrl(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (('\0' <= c && c < ' ') || (c == 127));
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isdigit.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 isdigit
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isdigit(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsDigit(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = ('0' <= c && c <= '9');
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isgraph.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 isgraph
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isgraph(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsGraph(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (' ' < c && c < 127);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_islower.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 islower
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
islower(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsLower(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = ('a' <= c && c <= 'z');
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isprint.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 isprint
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isprint(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsPrint(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (' ' <= c && c <= '~');
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_ispunct.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 ispunct
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
ispunct(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsPunct(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (('!' <= c && c <= '/') ||
|
|
||||||
(':' <= c && c <= '@') ||
|
|
||||||
('[' <= c && c <= '`') ||
|
|
||||||
('{' <= c && c <= '~'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isspace.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 isspace
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isspace(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsSpace(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (c == '\t' ||
|
|
||||||
c == '\r' ||
|
|
||||||
c == '\n' ||
|
|
||||||
c == '\v' ||
|
|
||||||
c == '\f' ||
|
|
||||||
c == ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isupper.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 isupper
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isupper(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsUpper(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = ('A' <= c && c <= 'Z');
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_isxdigit.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 isxdigit
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
isxdigit(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = IsXDigit(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = (('0' <= c && c <= '9') ||
|
|
||||||
('a' <= c && c <= 'f') ||
|
|
||||||
('A' <= c && c <= 'F'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,196 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_table.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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define __C_MACROS__
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
/* The construction of this table is rather peculiar. The assumption is that
|
|
||||||
the table index from which a flag value could be fetched is in the range
|
|
||||||
-128..255 since the character to be tested could be a signed or unsigned
|
|
||||||
8 bit value. The table access pointer (declared below) therefore points
|
|
||||||
to the 128th byte of '__ctype_data[]'. */
|
|
||||||
static const unsigned char __ctype_data[3 * 128] =
|
|
||||||
{
|
|
||||||
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,
|
|
||||||
|
|
||||||
/* 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
|
|
||||||
};
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
const unsigned char * const __ctype_table = &__ctype_data[128];
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_tolower.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 */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
tolower(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = ConvToLower(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = ('A' <= c && c <= 'Z') ? (c + ('a' - 'A')) : c;
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: ctype_toupper.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 */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
int
|
|
||||||
toupper(int c)
|
|
||||||
{
|
|
||||||
DECLARE_LOCALEBASE();
|
|
||||||
int result;
|
|
||||||
|
|
||||||
if(__locale_table[LC_CTYPE] != NULL)
|
|
||||||
{
|
|
||||||
assert( LocaleBase != NULL );
|
|
||||||
|
|
||||||
result = ConvToUpper(__locale_table[LC_CTYPE],(ULONG)c);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = ('a' <= c && c <= 'z') ? (c - ('a' - 'A')) : c;
|
|
||||||
}
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
342
library/debug.c
342
library/debug.c
@ -1,342 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug.c,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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
199
library/debug.h
199
library/debug.h
@ -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 */
|
|
||||||
@ -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;
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#define VERSION 1
|
|
||||||
#define REVISION 185
|
|
||||||
#define DATE "2.1.2005"
|
|
||||||
#define VERS "debug.lib 1.185"
|
|
||||||
#define VSTRING "debug.lib 1.185 (2.1.2005)\r\n"
|
|
||||||
#define VERSTAG "\0$VER: debug.lib 1.185 (2.1.2005)"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
185
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_cmpstrexec.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
cmpstrexec(const char * source1,const char * source2)
|
|
||||||
{
|
|
||||||
LONG result = 0;
|
|
||||||
|
|
||||||
assert( source1 != NULL && source2 != NULL );
|
|
||||||
|
|
||||||
if(source1 != NULL && source2 != NULL)
|
|
||||||
{
|
|
||||||
while((*source1) == (*source2))
|
|
||||||
{
|
|
||||||
if((*source1) == '\0')
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
source1++;
|
|
||||||
source2++;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = (*source1) - (*source2);
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,151 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_headers.h,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 _DEBUG_HEADERS_H
|
|
||||||
#define _DEBUG_HEADERS_H
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <exec/libraries.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__SASC)
|
|
||||||
|
|
||||||
#include <clib/exec_protos.h>
|
|
||||||
/*#include <pragmas/exec_sysbase_pragmas.h>*/
|
|
||||||
#include <pragmas/exec_pragmas.h>
|
|
||||||
|
|
||||||
LONG RawMayGetChar(VOID);
|
|
||||||
VOID RawPutChar(UBYTE c);
|
|
||||||
|
|
||||||
#pragma libcall SysBase RawMayGetChar 1fe 00
|
|
||||||
#pragma libcall SysBase RawPutChar 204 001
|
|
||||||
|
|
||||||
#endif /* __SASC */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
#include <exec/emulation.h>
|
|
||||||
#endif /* __amigaos4__ */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
|
|
||||||
#define __NOLIBBASE__
|
|
||||||
#include <proto/exec.h>
|
|
||||||
|
|
||||||
#ifndef __PPC__
|
|
||||||
|
|
||||||
#define RawMayGetChar() ({ \
|
|
||||||
UBYTE _RawMayGetChar__re = \
|
|
||||||
({ \
|
|
||||||
register struct Library * const __RawMayGetChar__bn __asm("a6") = SysBase;\
|
|
||||||
register UBYTE __RawMayGetChar__re __asm("d0"); \
|
|
||||||
__asm volatile ("jsr a6@(-510:W)" \
|
|
||||||
: "=r"(__RawMayGetChar__re) \
|
|
||||||
: "r"(__RawMayGetChar__bn) \
|
|
||||||
: "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
|
|
||||||
__RawMayGetChar__re; \
|
|
||||||
}); \
|
|
||||||
_RawMayGetChar__re; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#define RawPutChar(c) ({ \
|
|
||||||
ULONG _RawPutChar_c = (c); \
|
|
||||||
{ \
|
|
||||||
register struct Library * const __RawPutChar__bn __asm("a6") = SysBase;\
|
|
||||||
register ULONG __RawPutChar_c __asm("d0") = (_RawPutChar_c); \
|
|
||||||
__asm volatile ("jsr a6@(-516:W)" \
|
|
||||||
: \
|
|
||||||
: "r"(__RawPutChar__bn), "r"(__RawPutChar_c) \
|
|
||||||
: "d0", "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
|
|
||||||
} \
|
|
||||||
})
|
|
||||||
|
|
||||||
#endif /* __PPC___ */
|
|
||||||
|
|
||||||
#endif /* __GNUC__ */
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#define SysBase (*(struct Library **)4)
|
|
||||||
#define IExec ((struct ExecIFace *)((struct ExecBase *)SysBase)->MainInterface)
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include "macros.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
extern LONG cmpstrexec(const char *source1, const char *source2);
|
|
||||||
extern LONG KCmpStr(const char *source1, const char *source2);
|
|
||||||
extern LONG KMayGetCh(VOID);
|
|
||||||
extern LONG KMayGetChar(VOID);
|
|
||||||
extern LONG kgetc(VOID);
|
|
||||||
extern LONG kgetchar(VOID);
|
|
||||||
extern LONG kgetch(VOID);
|
|
||||||
extern LONG KGetCh(VOID);
|
|
||||||
extern LONG KGetChar(VOID);
|
|
||||||
extern LONG kgetnum(VOID);
|
|
||||||
extern LONG KGetNum(void);
|
|
||||||
extern VOID KDoFmt(const char *format_string, APTR data_stream, APTR put_char_routine, APTR put_char_data);
|
|
||||||
extern VOID KPutFmt(const char *format, va_list arg);
|
|
||||||
extern VOID KVPrintF(const char * format, va_list arg);
|
|
||||||
extern VOID kvprintf(const char *format, va_list arg);
|
|
||||||
extern VOID kprintf(const char *format, ...);
|
|
||||||
extern VOID KPrintF(const char *format, ...);
|
|
||||||
extern VOID kputc(UBYTE c);
|
|
||||||
extern VOID kputchar(UBYTE c);
|
|
||||||
extern VOID kputch(UBYTE c);
|
|
||||||
extern VOID KPutCh(UBYTE c);
|
|
||||||
extern VOID KPutChar(UBYTE c);
|
|
||||||
extern VOID kputstr(const UBYTE *s);
|
|
||||||
extern VOID KPutS(const UBYTE *s);
|
|
||||||
extern VOID kputs(const UBYTE *s);
|
|
||||||
extern VOID KPutStr(const UBYTE *s);
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
#endif /* _DEBUG_HEADERS_H */
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kcmpstr.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KCmpStr(const char * source1,const char * source2)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = cmpstrexec(source1,source2);
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kdofmt.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KDoFmt(const char * format_string,APTR data_stream,APTR put_char_routine,APTR put_char_data)
|
|
||||||
{
|
|
||||||
assert( format_string != NULL );
|
|
||||||
|
|
||||||
if(format_string != NULL)
|
|
||||||
RawDoFmt((STRPTR)format_string,data_stream,(VOID (*)())put_char_routine,put_char_data);
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetc.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
kgetc(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
do
|
|
||||||
result = KMayGetChar();
|
|
||||||
while(result < 0);
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetch1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
kgetch(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = kgetc();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetch2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KGetCh(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = kgetc();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetchar1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
kgetchar(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = kgetc();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetchar2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KGetChar(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = kgetc();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetnum1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
kgetnum(VOID)
|
|
||||||
{
|
|
||||||
LONG sum = 0;
|
|
||||||
LONG result;
|
|
||||||
BOOL is_negative = FALSE;
|
|
||||||
LONG position = 0;
|
|
||||||
LONG c;
|
|
||||||
|
|
||||||
while(TRUE)
|
|
||||||
{
|
|
||||||
c = kgetc();
|
|
||||||
|
|
||||||
if(c == '-')
|
|
||||||
{
|
|
||||||
if(position == 0)
|
|
||||||
{
|
|
||||||
is_negative = TRUE;
|
|
||||||
|
|
||||||
kputc(c);
|
|
||||||
|
|
||||||
position++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (c == '\b')
|
|
||||||
{
|
|
||||||
if(position > 0)
|
|
||||||
{
|
|
||||||
position--;
|
|
||||||
if(position == 0)
|
|
||||||
{
|
|
||||||
is_negative = FALSE;
|
|
||||||
|
|
||||||
sum = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sum = sum / 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
kputc(c);
|
|
||||||
kputc(' ');
|
|
||||||
kputc(c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (c == '\r')
|
|
||||||
{
|
|
||||||
kputc('\n');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if ('0' <= c && c <= '9')
|
|
||||||
{
|
|
||||||
LONG new_sum;
|
|
||||||
|
|
||||||
new_sum = sum * 10 + (c - '0');
|
|
||||||
if(new_sum >= sum)
|
|
||||||
{
|
|
||||||
sum = new_sum;
|
|
||||||
|
|
||||||
kputc(c);
|
|
||||||
|
|
||||||
position++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_negative)
|
|
||||||
result = (-sum);
|
|
||||||
else
|
|
||||||
result = sum;
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kgetnum2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KGetNum(void)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = kgetnum();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kmaygetch.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KMayGetCh(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
result = KMayGetChar();
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kmaygetchar.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
LONG
|
|
||||||
KMayGetChar(VOID)
|
|
||||||
{
|
|
||||||
LONG result;
|
|
||||||
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
{
|
|
||||||
/* Call RawMayGetChar() through the 68k LVO. */
|
|
||||||
result = EmulateTags(SysBase, ET_Offset, -510, TAG_DONE);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
result = RawMayGetChar();
|
|
||||||
}
|
|
||||||
#endif /* __amigaos4__ */
|
|
||||||
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kprintf1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
kprintf(const char * format,...)
|
|
||||||
{
|
|
||||||
assert( format != NULL );
|
|
||||||
|
|
||||||
if(format != NULL)
|
|
||||||
{
|
|
||||||
va_list arg;
|
|
||||||
|
|
||||||
va_start(arg,format);
|
|
||||||
KPutFmt(format,arg);
|
|
||||||
va_end(arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kprintf2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KPrintF(const char * format,...)
|
|
||||||
{
|
|
||||||
assert( format != NULL );
|
|
||||||
|
|
||||||
if(format != NULL)
|
|
||||||
{
|
|
||||||
va_list arg;
|
|
||||||
|
|
||||||
va_start(arg,format);
|
|
||||||
KPutFmt(format,arg);
|
|
||||||
va_end(arg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kputc.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
kputc(UBYTE c)
|
|
||||||
{
|
|
||||||
#if defined(__amigaos4__)
|
|
||||||
{
|
|
||||||
/* Call RawPutChar() through the 68k LVO. */
|
|
||||||
EmulateTags(SysBase, ET_Offset, -516, ET_RegisterD0, c, TAG_DONE);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
RawPutChar(c);
|
|
||||||
}
|
|
||||||
#endif /* __amigaos4__ */
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kputch1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
kputch(UBYTE c)
|
|
||||||
{
|
|
||||||
kputc(c);
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kputch2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KPutCh(UBYTE c)
|
|
||||||
{
|
|
||||||
kputc(c);
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kputchar1.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
kputchar(UBYTE c)
|
|
||||||
{
|
|
||||||
kputc(c);
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* $Id: debug_kputchar2.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_headers.h"
|
|
||||||
|
|
||||||
/****************************************************************************/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
KPutChar(UBYTE c)
|
|
||||||
{
|
|
||||||
kputc(c);
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user