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

37 Commits

Author SHA1 Message Date
1efe5fde4d This commit was manufactured by cvs2svn to create tag 'V1_188'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/tags/V1_188@14829 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 10:52:33 +00:00
a626336b7b - Tweaked the build makefiles to produce fewer meaningless warnings.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14828 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-07 10:52:32 +00:00
07d09bb185 - Added the fsync() and fdatasync() functions and the <stdint.h> and
<inttypes.h> header files contributed by Peter Bengtsson. Thank
  you very much!


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14827 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-04 15:03:14 +00:00
6ad88ff97f - The library no longer sends ACTION_DISK_INFO packets to the console
handler. The side-effects were too varied and irritating after all.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14826 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-04 08:49:10 +00:00
2ddfeab0cf - Added some extra documentation on the WBStartup variable.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14825 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 17:33:54 +00:00
91028c63bc - Lost the __not_a_number and __infinity variables, including the
code which initialized them.

- Reading/changing the errno variable is no longer done directly, but
  involves accessor functions.

- References to the HUGE_VAL quantity now involve an accessor function, too.

- Changed the manner in which the __huge_val constant is initialized by
  the __math_init() function.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14824 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 16:56:20 +00:00
209884bd1f - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
code. Also, the contents of the AnchorPath structure are no longer
  modified between calls. MatchEnd() has to be sufficient.

- Moved redundant code out of the readdir()/opendir()/closedir()
  functions which is not required unless the code is built for
  Unix compatibility mode.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14823 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 12:16:38 +00:00
3548d3cf7e - We now allocate the AnchorPath used in the unistd_wildcard_expand.c
code. Also, the contents of the AnchorPath structure are no longer
  modified between calls. MatchEnd() has to be sufficient.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14822 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-02-03 12:14:55 +00:00
50b8b623cc - Folded duplicate code in "time_mktime.c"; also, errno is no longer
modified unless the library is built with the "CHECK_FOR_NULL_POINTERS"
  option.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14821 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 16:10:59 +00:00
49bc1d6b13 - Updated the ".cvsignore" file.
- Moved the date/time conversion test code around in "test.c".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14820 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 10:23:26 +00:00
fce21e21d6 - The functions in stdlib.h which require a compiler that supports the
"long long" data type are no longer prototyped if the library is built
  for SAS/C.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14819 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 09:48:06 +00:00
f8b1e7516f - Folded duplicate code stdio_init_exit.c into a common function.
- Simplified the code in time_asctime_r.c which builds the time
  string. It gracefully handles buffer sizes which are too short
  by returning an empty string.

- Moved the tm->tm_wday initialization out of the hook function
  in time_strftime.c since it was to be called only once anyway.

- Lost a few compiler warnings in unistd_time_delay.c and
  time_gettimeofday.c.

- Folded duplicate code in time_mktime.c; also, errno is no longer
  modified unless the library is built with the CHECK_FOR_NULL_POINTERS
  option.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14818 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-30 09:37:59 +00:00
8e2820e9b7 - Added the missing 'time_convert_time.c'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14816 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 18:22:19 +00:00
ab22a23f27 - Changed the algorithm that calculates the number of days that have passed
so far as used by the the __convert_time() function and the conversion
  code in strftime().

- Also changed the algorithm used by strftime() to produce the week numbers
  (the '%U' and '%W' format specifiers). The new method is much simpler
  than the old one.

- Made the code that converts a 'time_t' value into the 'struct DateStamp',
  as used by strftime() and utime(), into its own function. This also
  fixes a bug in the code strftime() would use which was completely
  unaware of the local time zone settings.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14815 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 18:05:14 +00:00
0ae8d68e64 - We also test the strftime() %U, %W and %j format specifiers.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14814 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-29 17:48:07 +00:00
0b1d21471d - Plugged in a different algorithm for calculating the day of the week in
strftime() and asctime_r(). This one isn't sensitive to the effects of
  adding/subtracting the local time zone.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14813 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-26 18:41:39 +00:00
987316e638 - Added a missing file.
- Updated the .cvsignore file.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14812 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-26 09:24:38 +00:00
e8d4187ea5 - The general test program now also exercises the time conversion functions.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14811 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-25 11:21:58 +00:00
003faf7a24 - mktime() is supposed to convert the time specification, given as local
time, into the number of seconds since January 1st, 1970, relative to
  UTC. This didn't really work up until now since the time value returned
  was given as local time.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14810 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-25 11:21:00 +00:00
d1aaa84bcc - Moved the common DateStamp to time_t conversion code into a shared
function.

- The fall-back function for converting time into a string in strftime()
  now calls itself for the "%x" and "%X" format specifiers.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14809 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-24 10:25:46 +00:00
e1476c15b3 - Added instructions for switching over an existing Amiga 68k GCC installation
to use "clib2".


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14808 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-20 12:47:31 +00:00
17fea5626a - Added a check against DBL_EPSILON in log() and log10() in place of the
check against 0 that used to be in there.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14807 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-18 20:00:08 +00:00
e4b70e946f - The default console output window opened when a program is launched
from Workbench would open and stay open. This was not intended to
  happen and is a side-effect of the new stdio initialization code which
  checks if the stdio streams are in non-blocking mode. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14806 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-15 08:17:10 +00:00
56b0a74c61 - Added a missing definition to stdio_init_exit.c which is part of
the OS4 header files, but not of the older header file distributions.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14804 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-14 09:07:17 +00:00
d23f4318f9 - close() did not reset the non-blocking file property, as it should
have. This only worked for files which were closed anyway, but not
  for the stdio streams. Fixed.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14803 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-14 08:36:54 +00:00
23f70d0c53 - Lost some more code that is not required for AmigaOS 4.x and can be
handled conveniently through conditional compilation.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14802 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-13 15:39:39 +00:00
c6fcede4ce - Whether or not stdio console streams are blocking or non-blocking
is now determined at initialization time. The I/O mode is restored before
  the program exits. Previously, any changes to the I/O mode would persist.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14801 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-12 09:15:50 +00:00
5801d000d4 Added -a switch to cp so that it behaves like Copy CLONE.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14800 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-10 00:56:15 +00:00
619b64e6f4 - open() no longer examines a file after opening it in order to figure
out whether read/write accesses are permitted. This decision is now
  for the file system to make.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14799 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 16:07:27 +00:00
5191ee5660 - The V37/V40 compatibility code is no longer built for the AmigaOS4
version of the library.

- Switched over the last use of DeviceProc() to GetDeviceProc(), etc.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14798 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 15:58:02 +00:00
64c1175f7b - Made the <ctype.h> macros more robust.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14797 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 15:20:33 +00:00
be827762de - Added the baserel directory to the .cvsignore file.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14796 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:44:25 +00:00
618299fb48 - Replaced ASSERT() macro invocation with assert() call.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14795 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:43:40 +00:00
fbc6d94840 - Dropped the special flag variable used by the abort() function that
tracks whether or not console output is possible. We now use the
  global "__no_standard_io" instead.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14794 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 10:10:41 +00:00
5cf80326bc - Removed a misplaced IsInteractive() from the stdio initialization
function. Now this could have been big trouble...

- Removed tests for FileHandle->fh_Type != NULL which used to precede
  all IsInterative() tests. I verified that IsInteractive() will always
  return FALSE for NIL: type file handles.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14793 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 09:54:33 +00:00
e571888f4f - The "char" limits in <limits.h> are now set up according to the current
compiler settings, which can either default to an unsigned or
  signed definition.

- Changed the rules again for the use of stderr/stdout redirection when
  printing error messages. It is always safe to redirect them now and
  no requester will appear unless you specifically set the value of the
  "__no_standard_io" variable to TRUE in your program.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14792 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-09 09:40:33 +00:00
f519aafaca - Redirecting stderr to a file no longer has the effect of showing error
messages and assertion failure notifications as requesters. The exception
  is in redirecting stderr to NIL: which will prompt the requester use.

- gettimeofday() now calls GetSysTime() rather than DateStamp() to obtain
  the current system time. This resolves granularity issues since the
  DateStamp() result was only accurate by 1/50 of a second.

- The "ptrdiff_t" definition in <stddef.h> now defaults to type 'int' rather
  than 'long int'.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14791 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-08 10:21:28 +00:00
304 changed files with 2886 additions and 3269 deletions

View File

@ -1,13 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename>[<whitespace><error message>]<end-of-line>
#
# comment lines begin with '#'

View File

@ -1,15 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".

View File

@ -1,21 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOEFWUPCGMAR
# Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg
# script to change the log message. Set it to `stat' to force CVS to verify# that the file has changed before reading it (this can take up to an extra
# second per directory being committed, so it is not recommended for large
# repositories. Set it to `never' (the previous CVS behavior) to prevent
# verifymsg scripts from changing the log message.
#RereadLogAfterVerify=always

View File

@ -1,19 +0,0 @@
# This file affects handling of files based on their names.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'

View File

@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.

View File

@ -1,27 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
# t = tag or branch name
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog

View File

@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.

View File

@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail -s "CVS notification" %s

View File

@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".

View File

@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".

View File

@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.

View File

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

View File

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

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.19 2004-12-26 10:28:56 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.26 2005-02-07 10:52:16 obarthel Exp $
#
# :ts=8
#
@ -99,14 +99,16 @@ endif
##############################################################################
WARNINGS = \
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow
INCLUDES = -Iinclude -I. -Inetinclude
OPTIONS = -DNDEBUG -fno-builtin
#OPTIONS = -D__MEM_DEBUG -fno-builtin
#OPTIONS = -DDEBUG -D__MEM_DEBUG -DNO_INLINE_STDARG -fno-builtin
#OPTIMIZE = -O -fomit-frame-pointer -fstrength-reduce -finline-functions
OPTIMIZE = -O -fomit-frame-pointer -fstrength-reduce -finline-functions
#OPTIMIZE = -O2 -fomit-frame-pointer
#DEBUG = -g2
@ -270,6 +272,7 @@ C_LIB = \
stdlib_dosbase.o \
stdlib_exit.o \
stdlib_free.o \
stdlib_get_errno.o \
stdlib_getdefstacksize.o \
stdlib_getenv.o \
stdlib_getsp.o \
@ -296,6 +299,7 @@ C_LIB = \
stdlib_realloc.o \
stdlib_red_black.o \
stdlib_setenv.o \
stdlib_set_errno.o \
stdlib_setjmp.o \
stdlib_set_process_window.o \
stdlib_shell_escape.o \
@ -361,9 +365,12 @@ C_LIB = \
time_asctime_r.o \
time_clock.o \
time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \
time_ctime_r.o \
time_data.o \
time_days_per_date.o \
time_gettimeofday.o \
time_gmtime.o \
time_gmtime_r.o \
@ -373,6 +380,7 @@ C_LIB = \
time_numbertostring.o \
time_strftime.o \
time_time.o \
time_weekday.o \
unistd_access.o \
unistd_chdir.o \
unistd_chdir_exit.o \
@ -381,8 +389,10 @@ C_LIB = \
unistd_dup.o \
unistd_dup2.o \
unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \
unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \
unistd_getcwd.o \
unistd_getopt.o \
@ -469,6 +479,7 @@ MATH_LIB = \
math_floor.o \
math_fmod.o \
math_frexp.o \
math_huge_val.o \
math_hypot.o \
math_init_exit.o \
math_isinf.o \

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.os4,v 1.19 2004-12-26 10:28:56 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.26 2005-02-07 10:52:16 obarthel Exp $
#
# :ts=8
#
@ -15,7 +15,7 @@ NET_INCLUDE = netinclude
CC = ppc-amigaos-gcc
AR = ppc-amigaos-ar -q
RANLIB = ppc-amigaos-ranlib
COPY = cp
COPY = cp -a
DELETE = rm -r
MAKEDIR = mkdir
@ -105,8 +105,10 @@ endif
##############################################################################
WARNINGS = \
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
@ -275,6 +277,7 @@ C_LIB = \
stdlib_exit.o \
stdlib_free.o \
stdlib_getdefstacksize.o \
stdlib_get_errno.o \
stdlib_getenv.o \
stdlib_getsp.o \
stdlib_init_exit.o \
@ -299,6 +302,7 @@ C_LIB = \
stdlib_rand.o \
stdlib_realloc.o \
stdlib_red_black.o \
stdlib_set_errno.o \
stdlib_setenv.o \
stdlib_setjmp.o \
stdlib_set_process_window.o \
@ -365,9 +369,12 @@ C_LIB = \
time_asctime_r.o \
time_clock.o \
time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \
time_ctime_r.o \
time_data.o \
time_days_per_date.o \
time_gettimeofday.o \
time_gmtime.o \
time_gmtime_r.o \
@ -377,6 +384,7 @@ C_LIB = \
time_numbertostring.o \
time_strftime.o \
time_time.o \
time_weekday.o \
unistd_access.o \
unistd_chdir.o \
unistd_chdir_exit.o \
@ -385,8 +393,10 @@ C_LIB = \
unistd_dup.o \
unistd_dup2.o \
unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \
unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \
unistd_getcwd.o \
unistd_getopt.o \
@ -475,6 +485,7 @@ MATH_LIB = \
math_floor.o \
math_fmod.o \
math_frexp.o \
math_huge_val.o \
math_hypot.o \
math_init_exit.o \
math_isnan.o \

View File

@ -1,6 +1,6 @@
#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)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "amiga.lib 1.188"
#define VSTRING "amiga.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: amiga.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,5 +1,5 @@
/*
* $Id: amiga_rexxvars.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: amiga_rexxvars.c,v 1.3 2005-01-09 10:10:40 obarthel Exp $
*
* :ts=4
*
@ -50,12 +50,12 @@
/****************************************************************************/
STATIC struct Library * RexxSysBase;
static struct Library * RexxSysBase;
/****************************************************************************/
#if defined(__amigaos4__)
STATIC struct RexxSysIFace * IRexxSys;
static struct RexxSysIFace * IRexxSys;
#endif /* __amigaos4__ */
/****************************************************************************/
@ -144,7 +144,7 @@ CheckRexxMsg(struct RexxMsg *message)
LONG
GetRexxVar(struct RexxMsg *message,STRPTR variable_name,STRPTR *buffer_pointer)
{
STATIC TEXT buffer[256];
static UBYTE buffer[256];
LONG result;
/* The following uses a function which was added to rexxsyslib.library V45.

View File

@ -1,5 +1,5 @@
/*
* $Id: amiga_setsuperattrs.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: amiga_setsuperattrs.c,v 1.3 2005-01-09 10:10:41 obarthel Exp $
*
* :ts=4
*
@ -46,7 +46,7 @@
/****************************************************************************/
STATIC ULONG
static ULONG
SetSuperAttrsA(Class * cl,Object * obj,struct TagItem * tags)
{
ULONG result = 0;

View File

@ -1,6 +1,6 @@
#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)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "c.lib 1.188"
#define VSTRING "c.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: c.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,3 +1,150 @@
c.lib 1.188 (7.2.2005)
- Folded duplicate code in "stdio_init_exit.c" into a common function.
- Simplified the code in "time_asctime_r.c" which builds the time
string. It gracefully handles buffer sizes which are too short
by returning an empty string.
- Moved the "tm->tm_wday" initialization out of the hook function
in "time_strftime.c" since it was to be called only once anyway.
- Lost a few compiler warnings in "unistd_time_delay.c" and
"time_gettimeofday.c".
- Folded duplicate code in "time_mktime.c"; also, errno is no longer
modified unless the library is built with the "CHECK_FOR_NULL_POINTERS"
option.
- We now allocate the AnchorPath used in the unistd_wildcard_expand.c
code. Also, the contents of the AnchorPath structure are no longer
modified between calls. MatchEnd() has to be sufficient.
- Moved redundant code out of the readdir()/opendir()/closedir()
functions which is not required unless the code is built for
Unix compatibility mode.
- Lost the __not_a_number and __infinity variables, including the
code which initialized them.
- Reading/changing the errno variable is no longer done directly, but
involves accessor functions.
- References to the HUGE_VAL quantity now involve an accessor function, too.
- Changed the manner in which the __huge_val constant is initialized by
the __math_init() function. The new approach should be more portable.
- The library no longer sends ACTION_DISK_INFO packets to the console
handler. The side-effects were too varied and irritating after all.
- Added the fsync() and fdatasync() functions and the <stdint.h> and
<inttypes.h> header files contributed by Peter Bengtsson. Thank
you very much!
- Tweaked the build makefiles to produce fewer meaningless warnings.
c.lib 1.187 (29.1.2005)
- The default console output window opened when a program is launched
from Workbench would open and stay open. This was not intended to
happen and is a side-effect of the new stdio initialization code which
checks if the stdio streams are in non-blocking mode. Fixed.
- Moved the common DateStamp to time_t conversion code into a shared
function.
- The fall-back function for converting time into a string in strftime()
now calls itself for the "%c", "%x" and "%X" format specifiers.
- mktime() is supposed to convert the time specification, given as local
time, into the number of seconds since January 1st, 1970, relative to
UTC. This didn't really work up until now since the time value returned
was given as local time.
- Plugged in a different algorithm for calculating the day of the week in
strftime() and asctime_r(). This one isn't sensitive to the effects of
adding/subtracting the local time zone.
- Changed the algorithm that calculates the number of days that have passed
so far as used by the the __convert_time() function and the conversion
code in strftime().
- Also changed the algorithm used by strftime() to produce the week numbers
(the '%U' and '%W' format specifiers). The new method is much simpler
than the old one.
- Made the code that converts a 'time_t' value into the 'struct DateStamp',
as used by strftime() and utime(), into its own function. This also
fixes a bug in the code strftime() would use which was completely
unaware of the local time zone settings.
c.lib 1.186 (14.1.2005)
- Redirecting stderr to a file no longer has the effect of showing error
messages and assertion failure notifications as requesters. The exception
is in redirecting stderr to NIL: which will prompt the requester use.
- gettimeofday() now calls GetSysTime() rather than DateStamp() to obtain
the current system time. This resolves granularity issues since the
DateStamp() result was only accurate by 1/50 of a second.
- The "ptrdiff_t" definition in <stddef.h> now defaults to type 'int' rather
than 'long int'.
- The "char" limits in <limits.h> are now set up according to the current
compiler settings, which can either default to an unsigned or
signed definition.
- Changed the rules again for the use of stderr/stdout redirection when
printing error messages. It is always safe to redirect them now and
no requester will appear unless you specifically set the value of the
"__no_standard_io" variable to TRUE in your program.
- Removed a misplaced IsInteractive() from the stdio initialization
function. Now this could have been big trouble...
- Removed tests for FileHandle->fh_Type != NULL which used to precede
all IsInterative() tests. I verified that IsInteractive() will always
return FALSE for NIL: type file handles.
- Dropped the special flag variable used by the abort() function that
tracks whether or not console output is possible. We now use the
global "__no_standard_io" instead.
- Made the <ctype.h> macros more robust.
- Removed the "NIL:" file handle tests preceding the Open("CONSOLE:",..)
calls. As of Kickstart 2.x and beyond these are no longer a source of
trouble.
- The V37/V40 compatibility code is no longer built for the AmigaOS4
version of the library.
- Switched over the last use of DeviceProc() to GetDeviceProc(), etc.
- open() no longer examines a file after opening it in order to figure
out whether read/write accesses are permitted. This decision is now
for the file system to make.
- Whether or not stdio console streams are blocking or non-blocking
is now determined at initialization time. The I/O mode is restored before
the program exits. Previously, any changes to the I/O mode would persist.
- Lost some more code that is not required for AmigaOS 4.x and can be
handled conveniently through conditional compilation.
- close() did not reset the non-blocking file property, as it should
have. This only worked for files which were closed anyway, but not
for the stdio streams. Fixed.
- Added a missing definition to stdio_init_exit.c which is part of
the OS4 header files, but not of the older header file distributions.
c.lib 1.185 (2.1.2005)
- Moved the environment variable cleanup code into a destructor function.

View File

@ -1,5 +1,5 @@
/*
* $Id: ctype_table.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: ctype_table.c,v 1.3 2005-01-09 15:20:31 obarthel Exp $
*
* :ts=4
*
@ -36,22 +36,8 @@
/****************************************************************************/
/* 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] =
const unsigned char __ctype_table[2 * 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,
@ -190,7 +176,3 @@ 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
};
/****************************************************************************/
const unsigned char * const __ctype_table = &__ctype_data[128];

View File

@ -1,6 +1,6 @@
#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)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "debug.lib 1.188"
#define VSTRING "debug.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: debug.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_closedir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: dirent_closedir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ closedir(DIR * directory_pointer)
if(directory_pointer == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -84,7 +84,7 @@ closedir(DIR * directory_pointer)
if(NOT directory_pointer_is_valid)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
}
@ -94,8 +94,12 @@ closedir(DIR * directory_pointer)
Remove((struct Node *)dh);
while((node = RemHead(&dh->dh_VolumeList)) != NULL)
free(node);
#if defined(UNIX_PATH_SEMANTICS)
{
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
free(node);
}
#endif /* UNIX_PATH_SEMANTICS */
PROFILE_OFF();
UnLock(dh->dh_DirLock);

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: dirent_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -42,6 +42,12 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h"
#endif /* _MACROS_H */
@ -54,9 +60,10 @@ struct DirectoryHandle
BPTR dh_DirLock;
struct FileInfoBlock dh_FileInfo;
struct dirent dh_DirectoryEntry;
int dh_Position;
struct Node * dh_VolumeNode;
struct List dh_VolumeList;
struct MinList dh_VolumeList;
BOOL dh_ScanVolumeList;
};

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_opendir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: dirent_opendir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -106,7 +106,7 @@ opendir(const char * path_name)
{
SHOWMSG("invalid parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -121,10 +121,10 @@ opendir(const char * path_name)
memset(dh,0,sizeof(*dh));
NewList(&dh->dh_VolumeList);
#if defined(UNIX_PATH_SEMANTICS)
{
NewList((struct List *)&dh->dh_VolumeList);
if(__unix_path_semantics)
{
if(__translate_unix_to_amiga_path_name(&path_name,&path_name_nti) != 0)
@ -159,7 +159,7 @@ opendir(const char * path_name)
{
UnLockDosList(LDF_VOLUMES|LDF_READ);
errno = ENOMEM;
__set_errno(ENOMEM);
goto out;
}
@ -172,7 +172,7 @@ opendir(const char * path_name)
/* Check if the name is already on the list. Mind you,
this is not the most sophisticated algorithm but then
the number of volumes should be small. */
if(find_by_name(&dh->dh_VolumeList,node->ln_Name) != NULL)
if(find_by_name((struct List *)&dh->dh_VolumeList,node->ln_Name) != NULL)
{
free(node);
continue;
@ -180,16 +180,16 @@ opendir(const char * path_name)
D(("adding '%s'",node->ln_Name));
AddTail(&dh->dh_VolumeList,node);
AddTail((struct List *)&dh->dh_VolumeList,node);
}
}
UnLockDosList(LDF_VOLUMES|LDF_READ);
/* Bail out if we cannot present anything. */
if(IsListEmpty(&dh->dh_VolumeList))
if(IsListEmpty((struct List *)&dh->dh_VolumeList))
{
errno = ENOMEM;
__set_errno(ENOMEM);
goto out;
}
}
@ -212,7 +212,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't get a lock on it");
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out;
}
@ -226,7 +226,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't examine it");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -234,7 +234,7 @@ opendir(const char * path_name)
{
SHOWMSG("this isn't a directory");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
}
@ -254,8 +254,12 @@ opendir(const char * path_name)
{
SHOWMSG("ouch. cleaning up");
while((node = RemHead(&dh->dh_VolumeList)) != NULL)
free(node);
#if defined(UNIX_PATH_SEMANTICS)
{
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
free(node);
}
#endif /* UNIX_PATH_SEMANTICS */
PROFILE_OFF();
UnLock(dh->dh_DirLock);

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_readdir.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: dirent_readdir.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -61,7 +61,7 @@ readdir(DIR * directory_pointer)
{
SHOWMSG("ouch. invalid parameter");
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -89,13 +89,12 @@ readdir(DIR * directory_pointer)
D_S(struct FileInfoBlock,fib);
D_S(struct bcpl_name,bcpl_name);
UBYTE * name = bcpl_name->name;
struct MsgPort * port;
BPTR dir_lock;
assert( (((ULONG)name) & 3) == 0 );
if(dh->dh_VolumeNode == NULL && NOT IsListEmpty(&dh->dh_VolumeList))
dh->dh_VolumeNode = dh->dh_VolumeList.lh_Head;
if(dh->dh_VolumeNode == NULL && NOT IsListEmpty((struct List *)&dh->dh_VolumeList))
dh->dh_VolumeNode = (struct Node *)dh->dh_VolumeList.mlh_Head;
strcpy(name,"\1:"); /* BSTR for ":" */
@ -103,10 +102,12 @@ readdir(DIR * directory_pointer)
{
if(IsFileSystem(dh->dh_VolumeNode->ln_Name))
{
port = DeviceProc(dh->dh_VolumeNode->ln_Name);
if(port != NULL)
struct DevProc * dvp;
dvp = GetDeviceProc(dh->dh_VolumeNode->ln_Name,NULL);
if(dvp != NULL)
{
dir_lock = DoPkt(port,ACTION_LOCATE_OBJECT,ZERO,MKBADDR(name),SHARED_LOCK, 0,0);
dir_lock = DoPkt(dvp->dvp_Port,ACTION_LOCATE_OBJECT,ZERO,MKBADDR(name),SHARED_LOCK, 0,0);
if(dir_lock != ZERO)
{
if(Examine(dir_lock,fib))
@ -122,6 +123,8 @@ readdir(DIR * directory_pointer)
UnLock(dir_lock);
}
FreeDeviceProc(dvp);
}
}
@ -161,7 +164,7 @@ readdir(DIR * directory_pointer)
{
if(CANNOT Examine(parent_directory,fib))
{
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
}
@ -203,7 +206,7 @@ readdir(DIR * directory_pointer)
{
SHOWMSG("error scanning directory");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: dirent_rewinddir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: dirent_rewinddir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -76,7 +76,7 @@ rewinddir(DIR * directory_pointer)
if(CANNOT Examine(dh->dh_DirLock,&dh->dh_FileInfo))
{
SHOWMSG("ouch. that didn't work");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
}
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_close.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_close.c,v 1.8 2005-02-04 08:49:10 obarthel Exp $
*
* :ts=4
*
@ -45,9 +45,12 @@ int
__close(int file_descriptor,int * error_ptr)
{
DECLARE_UTILITYBASE();
struct file_hook_message message;
struct fd * fd;
int result = -1;
BOOL no_close;
BOOL is_alias;
ENTER();
@ -96,6 +99,7 @@ __close(int file_descriptor,int * error_ptr)
}
no_close = TRUE;
is_alias = TRUE;
}
else if (fd->fd_NextLink != NULL) /* this one has aliases attached; it is the 'original' resource */
{
@ -117,31 +121,35 @@ __close(int file_descriptor,int * error_ptr)
}
no_close = TRUE;
is_alias = TRUE;
}
else
{
no_close = FLAG_IS_SET(fd->fd_Flags,FDF_NO_CLOSE);
is_alias = FALSE;
}
(*error_ptr) = OK;
if(NOT no_close)
/* Reset the console to regular buffered/unbuffered input. We don't do this
for aliases and their like since the original stream is still in use. */
if(NOT is_alias)
{
struct file_hook_message message;
/* Reset the console to regular buffered input. */
if(FLAG_IS_SET(fd->fd_Flags,FDF_NON_BLOCKING))
{
SHOWMSG("resetting non-blocking access mode");
message.action = file_hook_action_set_blocking;
message.arg = 1;
message.arg = TRUE;
assert( fd->fd_Hook != NULL );
CallHookPkt(fd->fd_Hook,fd,&message);
}
}
(*error_ptr) = OK;
if(NOT no_close && NOT is_alias)
{
SHOWMSG("shutting down");
message.action = file_hook_action_close;
@ -169,10 +177,12 @@ int
close(int file_descriptor)
{
int result;
int error;
ENTER();
result = __close(file_descriptor,&errno);
result = __close(file_descriptor,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_creat.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_creat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -66,7 +66,7 @@ creat(const char * path_name, mode_t mode)
{
if(path_name == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_fcntl.c,v 1.5 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_fcntl.c,v 1.6 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -71,7 +71,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
fd = __get_file_descriptor(file_descriptor);
if(fd == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -94,7 +94,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
SHOWMSG("invalid flock type");
va_end(arg);
errno = EINVAL;
__set_errno(EINVAL);
break;
}
@ -103,7 +103,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
SHOWMSG("invalid flock offset");
va_end(arg);
errno = EINVAL;
__set_errno(EINVAL);
break;
}
@ -116,7 +116,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
CallHookPkt(fd->fd_Hook,fd,&message);
result = message.result;
errno = message.error;
__set_errno(message.error);
va_end(arg);
@ -159,7 +159,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
result = message.result;
if(result < 0)
{
errno = message.error;
__set_errno(message.error);
va_end(arg);
goto out;
@ -184,7 +184,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
result = message.result;
if(result < 0)
{
errno = message.error;
__set_errno(message.error);
va_end(arg);
goto out;
@ -210,7 +210,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
if(fdbase < 0)
{
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}
@ -257,14 +257,14 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
goto out;
}
errno = EMFILE;
__set_errno(EMFILE);
break;
default:
SHOWMSG("something else");
errno = ENOSYS;
__set_errno(ENOSYS);
break;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_get_default_file.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -55,7 +55,7 @@ __get_default_file(int file_descriptor,long * file_ptr)
fd = __get_file_descriptor(file_descriptor);
if(fd == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -42,4 +42,10 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#endif /* _FCNTL_HEADERS_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_lseek.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_lseek.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -115,10 +115,12 @@ off_t
lseek(int file_descriptor, off_t offset, int mode)
{
off_t result;
int error;
ENTER();
result = __lseek(file_descriptor,offset,mode,&errno);
result = __lseek(file_descriptor,offset,mode,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_open.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_open.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -53,6 +53,39 @@
/****************************************************************************/
/* This is used in place of ChangeMode() in order to work around a bug in
dos.library V40 and below: a "NIL:" file handle will crash the
caller of the ChangeMode() function. */
static LONG
safe_change_mode(LONG type,BPTR file_handle,LONG mode)
{
LONG result = DOSFALSE;
#ifndef __amigaos4__
{
struct FileHandle * fh = (struct FileHandle *)BADDR(file_handle);
assert( type == CHANGE_FH );
if(fh == NULL || fh->fh_Type == NULL)
{
SetIoErr(ERROR_OBJECT_WRONG_TYPE);
goto out;
}
}
#endif /* __amigaos4__ */
PROFILE_OFF();
result = ChangeMode(type,file_handle,mode);
PROFILE_ON();
out:
return(result);
}
/****************************************************************************/
int
open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
@ -64,10 +97,9 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
LONG is_file_system = FALSE;
LONG open_mode;
BPTR lock = ZERO;
struct FileHandle * file_handle;
BPTR handle = ZERO;
BOOL create_new_file = FALSE;
LONG is_interactive = FALSE;
LONG is_interactive;
int fd_slot_number;
struct fd * fd;
int access_mode;
@ -91,7 +123,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("path name is invalid");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -102,7 +134,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("access mode is invalid");
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}
@ -128,7 +160,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(path_name_nti.is_root)
{
errno = EACCES;
__set_errno(EACCES);
goto out;
}
}
@ -155,7 +187,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("the file already exists");
errno = EEXIST;
__set_errno(EEXIST);
goto out;
}
@ -165,14 +197,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("there's something not a directory on the path");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -201,7 +233,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("could not examine the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
@ -210,7 +242,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("can't open a directory");
errno = EISDIR;
__set_errno(EISDIR);
goto out;
}
@ -219,7 +251,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("this object is not write enabled");
errno = EACCES;
__set_errno(EACCES);
goto out;
}
@ -242,14 +274,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("there's something not a directory on the path");
errno = ENOTDIR;
__set_errno(ENOTDIR);
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
}
@ -273,7 +305,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
LONG io_err = IoErr();
D(("the file '%s' didn't open in mode %ld",path_name,open_mode));
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(io_err));
/* Check if ended up trying to open a directory as if
it were a plain file. */
@ -285,7 +317,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(lock != ZERO)
{
if(Examine(lock,fib) && fib->fib_DirEntryType >= 0)
errno = EISDIR;
__set_errno(EISDIR);
}
PROFILE_ON();
@ -294,60 +326,13 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
goto out;
}
file_handle = BADDR(handle);
/* NOTE: workaround for a bug in dos.library V40 and below which will
* crash the caller if the file handle refers to "NIL:".
*/
if(file_handle->fh_Type != NULL)
{
LONG status;
PROFILE_OFF();
status = ExamineFH(handle,fib);
PROFILE_ON();
if(status != DOSFALSE)
{
BOOL operation_permitted = TRUE;
/* Check if the file is readable. */
if(FLAG_IS_SET(fib->fib_Protection,FIBF_READ))
{
if(access_mode == O_RDONLY ||
access_mode == O_RDWR)
{
operation_permitted = FALSE;
}
}
/* Check if the file can be written to. */
if(FLAG_IS_SET(fib->fib_Protection,FIBF_WRITE))
{
if(access_mode == O_WRONLY)
operation_permitted = FALSE;
}
if(NOT operation_permitted)
{
SHOWMSG("this object must not be opened");
errno = EACCES;
goto out;
}
}
}
fd = __fd[fd_slot_number];
__initialize_fd(fd,(HOOKFUNC)__fd_hook_entry,handle,0);
/* Figure out if this stream is attached to a console. */
PROFILE_OFF();
if(file_handle->fh_Type != NULL)
is_interactive = IsInteractive(handle);
is_interactive = IsInteractive(handle);
PROFILE_ON();
if(is_interactive)
@ -368,7 +353,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
len = 0;
for(i = 0 ; i < (int)strlen(path_name) ; i++)
for(i = 0 ; path_name[i] != '\0' ; i++)
{
if(path_name[i] == ':')
{
@ -403,21 +388,11 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(is_file_system)
{
/* NOTE: workaround for a bug in dos.library V40 and below which will
* crash the caller if the file handle refers to "NIL:".
*/
if(file_handle->fh_Type != NULL)
{
/* We opened the file in exclusive access mode. Switch it back
into shared access mode so that its contents can be read
while it's still open. */
if(open_mode == MODE_NEWFILE)
{
PROFILE_OFF();
ChangeMode(CHANGE_FH,handle,SHARED_LOCK);
PROFILE_ON();
}
}
/* We opened the file in exclusive access mode. Switch it back
into shared access mode so that its contents can be read
while it's still open. */
if(open_mode == MODE_NEWFILE)
safe_change_mode(CHANGE_FH,handle,SHARED_LOCK);
/* We should be able to seek in this file. */
SET_FLAG(fd->fd_Flags,FDF_CACHE_POSITION);

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_read.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_read.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -136,10 +136,12 @@ ssize_t
read(int file_descriptor, void * buffer, size_t num_bytes)
{
ssize_t result;
int error;
ENTER();
result = __read(file_descriptor,buffer,num_bytes,&errno);
result = __read(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: fcntl_write.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: fcntl_write.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -136,10 +136,12 @@ ssize_t
write(int file_descriptor, const void * buffer, size_t num_bytes)
{
ssize_t result;
int error;
ENTER();
result = __write(file_descriptor,buffer,num_bytes,&errno);
result = __write(file_descriptor,buffer,num_bytes,&error);
__set_errno(error);
RETURN(result);
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: ctype.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
* $Id: ctype.h,v 1.5 2005-01-09 15:20:33 obarthel Exp $
*
* :ts=4
*
@ -66,15 +66,14 @@ extern int toupper(int c);
/*
* If requested, reimplement the character classification functions as macros;
* note that the macro variants ignore the current locale and default to the
* 'C' locale rules. Note that the characters to be tested must be either
* signed or unsigned 8 bit values.
* 'C' locale rules.
*/
#ifdef __C_MACROS__
/****************************************************************************/
extern const unsigned char * const __ctype_table;
extern const unsigned char __ctype_table[];
/****************************************************************************/
@ -89,17 +88,17 @@ extern const unsigned char * const __ctype_table;
/****************************************************************************/
#define isalnum(c) ((__ctype_table[c] & (__CTYPE_DIGIT|__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define isalpha(c) ((__ctype_table[c] & (__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define iscntrl(c) ((__ctype_table[c] & __CTYPE_CONTROL) != 0)
#define isdigit(c) ((__ctype_table[c] & __CTYPE_DIGIT) != 0)
#define isxdigit(c) ((__ctype_table[c] & __CTYPE_HEX_DIGIT) != 0)
#define isgraph(c) ((__ctype_table[c] & (__CTYPE_DIGIT|__CTYPE_PUNCTUATION|__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define ispunct(c) ((__ctype_table[c] & __CTYPE_PUNCTUATION) != 0)
#define isprint(c) ((__ctype_table[c] & __CTYPE_PRINTABLE) != 0)
#define islower(c) ((__ctype_table[c] & __CTYPE_LOWER_CASE) != 0)
#define isupper(c) ((__ctype_table[c] & __CTYPE_UPPER_CASE) != 0)
#define isspace(c) ((__ctype_table[c] & __CTYPE_WHITE_SPACE) != 0)
#define isalnum(c) ((__ctype_table[(c) & 255] & (__CTYPE_DIGIT|__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define isalpha(c) ((__ctype_table[(c) & 255] & (__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define iscntrl(c) ((__ctype_table[(c) & 255] & __CTYPE_CONTROL) != 0)
#define isdigit(c) ((__ctype_table[(c) & 255] & __CTYPE_DIGIT) != 0)
#define isxdigit(c) ((__ctype_table[(c) & 255] & __CTYPE_HEX_DIGIT) != 0)
#define isgraph(c) ((__ctype_table[(c) & 255] & (__CTYPE_DIGIT|__CTYPE_PUNCTUATION|__CTYPE_LOWER_CASE|__CTYPE_UPPER_CASE)) != 0)
#define ispunct(c) ((__ctype_table[(c) & 255] & __CTYPE_PUNCTUATION) != 0)
#define isprint(c) ((__ctype_table[(c) & 255] & __CTYPE_PRINTABLE) != 0)
#define islower(c) ((__ctype_table[(c) & 255] & __CTYPE_LOWER_CASE) != 0)
#define isupper(c) ((__ctype_table[(c) & 255] & __CTYPE_UPPER_CASE) != 0)
#define isspace(c) ((__ctype_table[(c) & 255] & __CTYPE_WHITE_SPACE) != 0)
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: dos.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
* $Id: dos.h,v 1.7 2005-02-03 17:33:54 obarthel Exp $
*
* :ts=4
*
@ -66,6 +66,26 @@ extern "C" {
* ISO 'C' standard context. It is redefined to WBenchMsg to make it
* compatible with the original Amiga program startup code which would
* refer to the variable under that name.
*
* It is recommended to access the Workbench startup message as part of your
* program's main() function, like this:
*
* int
* main(int argc,char ** argv)
* {
* struct WBStartup * wb_startup_message;
*
* if(argc == 0)
* wb_startup_message = (struct WBStartup *)argv;
* else
* wb_startup_message = NULL;
*
* ...
* }
*
* This approach has the advantage that your program does not rely upon a
* global variable initialized by the startup code, whose name you might
* not even know exactly.
*/
extern struct WBStartup * __WBenchMsg;
#define WBenchMsg __WBenchMsg
@ -278,7 +298,7 @@ extern int __translate_relative_path_name(char const ** name_ptr,char *replace,s
extern void __restore_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern int __translate_amiga_to_unix_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern int __translate_unix_to_amiga_path_name(char const ** name_ptr,struct name_translation_info * nti);
extern void __translate_io_error_to_errno(LONG io_error,int * errno_ptr);
extern int __translate_io_error_to_errno(LONG io_error);
/****************************************************************************/

296
library/include/inttypes.h Normal file
View File

@ -0,0 +1,296 @@
/*
* $Id: inttypes.h,v 1.1 2005-02-04 15:03:13 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _INTTYPES_H
#define _INTTYPES_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
/* Integral types with specified size; contributed by Peter Bengtsson */
/****************************************************************************/
#ifndef _STDINT_H
#include <stdint.h>
#endif /* _STDINT_H */
/****************************************************************************/
/* printf() format specifications for different types. */
/* "Decimal" */
#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "d"
#define PRId64 "lld"
#define PRIdLEAST8 "d"
#define PRIdLEAST16 "d"
#define PRIdLEAST32 "d"
#define PRIdLEAST64 "lld"
#define PRIdFAST8 "d"
#define PRIdFAST16 "d"
#define PRIdFAST32 "d"
#define PRIdFAST64 "lld"
#define PRIdPTR "ld"
/* "Integer" */
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "i"
#define PRIi64 "lli"
#define PRIiLEAST8 "i"
#define PRIiLEAST16 "i"
#define PRIiLEAST32 "i"
#define PRIiLEAST64 "lli"
#define PRIiFAST8 "i"
#define PRIiFAST16 "i"
#define PRIiFAST32 "i"
#define PRIiFAST64 "lli"
#define PRIiPTR "li"
/* "Unsigned" */
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "u"
#define PRIu64 "llu"
#define PRIuLEAST8 "u"
#define PRIuLEAST16 "u"
#define PRIuLEAST32 "u"
#define PRIuLEAST64 "llu"
#define PRIuFAST8 "u"
#define PRIuFAST16 "u"
#define PRIuFAST32 "u"
#define PRIuFAST64 "llu"
#define PRIuPTR "lu"
/* "Hexadecimal - lowercase " */
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "x"
#define PRIx64 "llx"
#define PRIxLEAST8 "x"
#define PRIxLEAST16 "x"
#define PRIxLEAST32 "x"
#define PRIxLEAST64 "llx"
#define PRIxFAST8 "x"
#define PRIxFAST16 "x"
#define PRIxFAST32 "x"
#define PRIxFAST64 "llx"
#define PRIxPTR "lx"
/* "Hexadecimal - Uppercase" */
#define PRIX8 "X"
#define PRIX16 "X"
#define PRIX32 "X"
#define PRIX64 "llX"
#define PRIXLEAST8 "X"
#define PRIXLEAST16 "X"
#define PRIXLEAST32 "X"
#define PRIXLEAST64 "llX"
#define PRIXFAST8 "X"
#define PRIXFAST16 "X"
#define PRIXFAST32 "X"
#define PRIXFAST64 "llX"
#define PRIXPTR "lX"
/* "Octal" */
#define PRIo8 "o"
#define PRIo16 "o"
#define PRIo32 "o"
#define PRIo64 "llo"
#define PRIoLEAST8 "o"
#define PRIoLEAST16 "o"
#define PRIoLEAST32 "o"
#define PRIoLEAST64 "llo"
#define PRIoFAST8 "o"
#define PRIoFAST16 "o"
#define PRIoFAST32 "o"
#define PRIoFAST64 "llo"
#define PRIoPTR "lo"
/* intmax_t is 32 bits for SAS/C, 64-bits for GCC or if using a conforming C99 compiler. */
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define PRIdMAX "lld"
#define PRIiMAX "lli"
#define PRIuMAX "llu"
#define PRIxMAX "llx"
#define PRIXMAX "llX"
#define PRIoMAX "llo"
#else
#define PRIdMAX "ld"
#define PRIiMAX "li"
#define PRIuMAX "lu"
#define PRIxMAX "lx"
#define PRIXMAX "lX"
#define PRIoMAX "lo"
#endif
/* scanf() format specifiers. */
/* "Decimal" */
/* #define SCNd8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNd16 "hd"
#define SCNd32 "d"
#define SCNd64 "lld"
/* #define SCNdLEAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNdLEAST16 "hd"
#define SCNdLEAST32 "d"
#define SCNdLEAST64 "lld"
/* #define SCNdFAST8 "hhd" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNdFAST16 "d"
#define SCNdFAST32 "d"
#define SCNdFAST64 "lld"
#define SCNdPTR "d"
/* "Integer" */
/* #define SCNi8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNi16 "hi"
#define SCNi32 "i"
#define SCNi64 "lli"
/* #define SCNiLEAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNiLEAST16 "hi"
#define SCNiLEAST32 "i"
#define SCNiLEAST64 "lli"
/* #define SCNiFAST8 "hhi" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNiFAST16 "i"
#define SCNiFAST32 "i"
#define SCNiFAST64 "lli"
#define SCNiPTR "i"
/* "Unsigned" */
/* #define SCNu8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNu16 "hu"
#define SCNu32 "u"
#define SCNu64 "llu"
/* #define SCNuLEAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNuLEAST16 "hu"
#define SCNuLEAST32 "u"
#define SCNuLEAST64 "llu"
/* #define SCNuFAST8 "hhu" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNuFAST16 "u"
#define SCNuFAST32 "u"
#define SCNuFAST64 "llu"
#define SCNuPTR "u"
/* "Hexadecimal" */
/* #define SCNx8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNx16 "hx"
#define SCNx32 "x"
#define SCNx64 "llx"
/* #define SCNxLEAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNxLEAST16 "hx"
#define SCNxLEAST32 "x"
#define SCNxLEAST64 "llx"
/* #define SCNxFAST8 "hhx" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNxFAST16 "x"
#define SCNxFAST32 "x"
#define SCNxFAST64 "llx"
#define SCNxPTR "x"
/* "Octal" */
/* #define SCNo8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNo16 "ho"
#define SCNo32 "o"
#define SCNo64 "llo"
/* #define SCNoLEAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNoLEAST16 "ho"
#define SCNoLEAST32 "o"
#define SCNoLEAST64 "llo"
/* #define SCNoFAST8 "hho" */ /* Missing. TODO: Add support for char conversions in scanf() */
#define SCNoFAST16 "o"
#define SCNoFAST32 "o"
#define SCNoFAST64 "llo"
#define SCNoPTR "o"
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define SCNdMAX "lld"
#define SCNiMAX "lli"
#define SCNuMAX "llu"
#define SCNxMAX "llx"
#define SCNoMAX "llo"
#else
#define SCNdMAX "ld"
#define SCNiMAX "li"
#define SCNuMAX "lu"
#define SCNxMAX "lx"
#define SCNoMAX "lo"
#endif
/* TODO: Add the rest of inttypes.h here + in the library. */
/*
* Missing stuff is among other things atoll(), strtoll(), ...
* Then there is the matter of wchar support - Zzzz.
*/
/****************************************************************************/
#endif /* _INTTYPES_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: limits.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
* $Id: limits.h,v 1.5 2005-01-09 09:40:33 obarthel Exp $
*
* :ts=4
*
@ -36,24 +36,53 @@
/****************************************************************************/
#define CHAR_BIT 8
#define CHAR_MAX 127
#define CHAR_MIN -128
#define INT_MAX 2147483647L
#define INT_MIN (-2147483647L - 1)
#define LONG_MAX 2147483647L
#define LONG_MIN (-2147483647L - 1)
#define SCHAR_MAX 127
#define SCHAR_MIN -128
#define SHRT_MAX 32767
#define CHAR_BIT 8
/****************************************************************************/
#define SCHAR_MIN -128
#define SCHAR_MAX 127
#define UCHAR_MAX 255
/****************************************************************************/
/*
* The following defines the range a 'char' can cover by checking a
* preprocessor symbol; we support both SAS/C and GCC here.
*/
#if (defined(__GNUC__) && defined(__CHAR_UNSIGNED__)) || (defined(__SASC) && defined(_UNSCHAR))
#define CHAR_MIN 0
#define CHAR_MAX 255
#else
#define CHAR_MIN -128
#define CHAR_MAX 127
#endif /* (__GNUC__ && __CHAR_UNSIGNED) || (__SASC && _UNSCHAR) */
/****************************************************************************/
#define SHRT_MIN -32768
#define UCHAR_MAX 255
#define UINT_MAX 4294967295UL
#define ULONG_MAX 4294967295UL
#define SHRT_MAX 32767
#define USHRT_MAX 65535
/****************************************************************************/
#define INT_MIN (-2147483647L - 1)
#define INT_MAX 2147483647L
#define UINT_MAX 4294967295UL
/****************************************************************************/
#define LONG_MIN (-2147483647L - 1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: stddef.h,v 1.2 2005-01-02 09:07:21 obarthel Exp $
* $Id: stddef.h,v 1.3 2005-01-08 10:21:28 obarthel Exp $
*
* :ts=4
*
@ -52,7 +52,7 @@ extern "C" {
/****************************************************************************/
typedef long int ptrdiff_t;
typedef int ptrdiff_t;
typedef unsigned int size_t;
typedef unsigned int wchar_t;

186
library/include/stdint.h Normal file
View File

@ -0,0 +1,186 @@
/*
* $Id: stdint.h,v 1.1 2005-02-04 15:03:14 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 _STDINT_H
#define _STDINT_H
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/
/* C99 integer type definitions; contributed by Peter Bengtsson */
/****************************************************************************/
#ifndef _LIMITS_H
#include <limits.h>
#endif /* _LIMITS_H */
/****************************************************************************/
/* Common for all supported compilers. */
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed char int_least8_t;
typedef signed short int_least16_t;
typedef signed int int_least32_t;
typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned int uint_least32_t;
/* This is mostly guesswork. */
typedef signed char int_fast8_t;
typedef signed int int_fast16_t;
typedef signed int int_fast32_t;
typedef unsigned char uint_fast8_t;
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
typedef signed long intptr_t;
typedef unsigned long uintptr_t;
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef signed long long int_least64_t;
typedef unsigned long long uint_least64_t;
typedef signed long long int_fast64_t;
typedef unsigned long long uint_fast64_t;
typedef signed long long intmax_t;
typedef unsigned long long uintmax_t;
#else /* No 64-bit types for SAS/C */
typedef signed long intmax_t;
typedef unsigned long uintmax_t;
#endif
#define INT8_MIN SCHAR_MIN
#define INT8_MAX SCHAR_MAX
#define UINT8_MAX UCHAR_MAX
#define INT16_MIN SHRT_MIN
#define INT16_MAX SHRT_MAX
#define UINT16_MAX USHRT_MAX
#define INT32_MIN INT_MIN
#define INT32_MAX INT_MAX
#define UINT32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT64_MIN LLONG_MIN
#define INT64_MAX LLONG_MAX
#define UINT64_MAX ULLONG_MAX
#endif
#define INT_LEAST8_MIN SCHAR_MIN
#define INT_LEAST8_MAX SCHAR_MAX
#define UINT_LEAST8_MAX UCHAR_MAX
#define INT_LEAST16_MIN SHRT_MIN
#define INT_LEAST16_MAX SHRT_MAX
#define UINT_LEAST16_MAX USHRT_MAX
#define INT_LEAST32_MIN INT_MIN
#define INT_LEAST32_MAX INT_MAX
#define UINT_LEAST32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT_LEAST64_MIN LLONG_MIN
#define INT_LEAST64_MAX LLONG_MAX
#define UINT_LEAST64_MAX ULLONG_MAX
#endif
#define INT_FAST8_MIN SCHAR_MIN
#define INT_FAST8_MAX SCHAR_MAX
#define UINT_FAST8_MAX UCHAR_MAX
#define INT_FAST16_MIN INT_MIN
#define INT_FAST16_MAX INT_MAX
#define UINT_FAST16_MAX UINT_MAX
#define INT_FAST32_MIN INT_MIN
#define INT_FAST32_MAX INT_MAX
#define UINT_FAST32_MAX UINT_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INT_FAST64_MIN LLONG_MIN
#define INT_FAST64_MAX LLONG_MAX
#define UINT_FAST64_MAX ULLONG_MAX
#endif
#define INTPTR_MIN LONG_MIN
#define INTPTR_MAX LONG_MAX
#define UINTPTR_MAX ULONG_MAX
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INTMAX_MIN LLONG_MIN
#define INTMAX_MAX LLONG_MAX
#define UINTMAX_MAX ULLONG_MAX
#else
#define INTMAX_MIN LONG_MIN
#define INTMAX_MAX LONG_MAX
#define UINTMAX_MAX ULONG_MAX
#endif
#if !defined(__cpluspluis) || defined(__STDC_LIMIT_MACROS)
/* sigatomic_t is an int. */
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
/* Maximum value of size_t */
#define SIZE_MAX UINT_MAX
#endif /* not C++ or LIMIT_MACROS */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#define INT8_C(x) x
#define INT16_C(x) x
#define INT32_C(x) x
#define INT64_C(x) x ## LL
#define UINT8_C(x) x ## U
#define UINT16_C(x) x ## U
#define UINT32_C(x) x ## U
#define UINT64_C(x) x ## ULL
#if defined(__GNUC__) || ((__STDC_VERSION__ +0) >= 199901L)
#define INTMAX_C(x) x ## LL
#define UINTMAX_C(x) x ## ULL
#else
#define INTMAX_C(x) x ## L
#define UINTMAX_C(x) x ## UL
#endif
#endif /* not C++ or CONSTANT_MACROS */
/****************************************************************************/
#endif /* _STDINT_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: stdlib.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
* $Id: stdlib.h,v 1.6 2005-01-30 09:48:06 obarthel Exp $
*
* :ts=4
*
@ -149,8 +149,12 @@ extern long atol(const char *str);
/****************************************************************************/
/* These two functions are unavailable under SAS/C for lack of a
"long long" data type. */
#if ! defined(__SASC)
extern long long strtoll(const char *str, char **ptr, int base);
extern unsigned long long strtoull(const char *str, char **ptr, int base);
#endif /* __SASC */
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: unistd.h,v 1.8 2005-01-02 09:07:21 obarthel Exp $
* $Id: unistd.h,v 1.9 2005-02-04 15:03:14 obarthel Exp $
*
* :ts=4
*
@ -98,6 +98,8 @@ extern void usleep(unsigned long microseconds);
extern int getopt(int argc, char * argv[], char *opts);
extern pid_t getpid(void);
extern char *realpath(const char *file_name, char *resolved_name);
extern int fsync(int file_descriptor);
extern int fdatasync(int file_descriptor);
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: locale_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: locale_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -53,9 +53,9 @@
/****************************************************************************/
#ifndef _STDLIB_LOCALE_UTILITY_H
#include "stdlib_locale_utility.h"
#endif /* _STDLIB_LOCALE_UTILITY_H */
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: locale_setlocale.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: locale_setlocale.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -56,7 +56,7 @@ setlocale(int category, const char *locale)
{
SHOWMSG("invalid category");
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}
@ -75,7 +75,7 @@ setlocale(int category, const char *locale)
{
SHOWMSG("locale name is too long");
errno = ENAMETOOLONG;
__set_errno(ENAMETOOLONG);
goto out;
}
@ -103,7 +103,7 @@ setlocale(int category, const char *locale)
{
SHOWMSG("couldn't open the locale");
errno = ENOENT;
__set_errno(ENOENT);
goto out;
}
}

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 185
#define DATE "2.1.2005"
#define VERS "m.lib 1.185"
#define VSTRING "m.lib 1.185 (2.1.2005)\r\n"
#define VERSTAG "\0$VER: m.lib 1.185 (2.1.2005)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "m.lib 1.188"
#define VSTRING "m.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: m.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 185
#define DATE "2.1.2005"
#define VERS "m881.lib 1.185"
#define VSTRING "m881.lib 1.185 (2.1.2005)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.185 (2.1.2005)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "m881.lib 1.188"
#define VSTRING "m881.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: m881.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,5 +1,5 @@
/*
* $Id: macros.h,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: macros.h,v 1.8 2005-01-30 09:37:59 obarthel Exp $
*
* :ts=4
*
@ -60,10 +60,6 @@
/****************************************************************************/
#define UNIX_TIME_OFFSET 252460800
/****************************************************************************/
#define NUM_ENTRIES(t) (sizeof(t) / sizeof(t[0]))
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_acos.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_acos.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -227,7 +227,7 @@ acos(double x)
else
{
result = 0;
errno = EDOM;
__set_errno(EDOM);
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: math_asin.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_asin.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -238,7 +238,7 @@ asin(double x)
else
{
result = 0;
errno = EDOM;
__set_errno(EDOM);
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: math_atan2.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_atan2.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -108,7 +108,7 @@ __atan2(double y,double x)
else
{
result = 0;
errno = EDOM;
__set_errno(EDOM);
}
}
}
@ -187,7 +187,7 @@ __atan2(double y,double x)
else
{
result = 0;
errno = EDOM;
__set_errno(EDOM);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_ceil.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_ceil.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
*
* :ts=4
*
@ -150,7 +150,6 @@ __ceil(double x)
#if defined(PPC_FLOATING_POINT_SUPPORT)
static const double huge = 1.0e300;
INLINE static const double
@ -233,6 +232,7 @@ __ceil(double x)
}
#endif /* PPC_FLOATING_POINT_SUPPORT */
/****************************************************************************/
double

View File

@ -1,5 +1,5 @@
/*
* $Id: math_cos.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_cos.c,v 1.3 2005-01-26 09:24:38 obarthel Exp $
*
* :ts=4
*
@ -172,6 +172,7 @@ __cos(double x)
}
}
}
#endif /* PPC_FLOATING_POINT_SUPPORT */
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: math_data.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_data.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -48,5 +48,3 @@ struct Library * MathIeeeDoubTransBase;
/****************************************************************************/
double __huge_val;
double __not_a_number;
double __infinity;

View File

@ -1,5 +1,5 @@
/*
* $Id: math_fmod.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_fmod.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -285,7 +285,7 @@ fmod(double x,double y)
else
{
result = x;
errno = EDOM;
__set_errno(EDOM);
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: math_frexp.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_frexp.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -189,8 +189,9 @@ frexp(double x,int *nptr)
{
if(nptr == NULL)
{
result = HUGE_VAL;
errno = EFAULT;
__set_errno(EFAULT);
result = __get_huge_val();
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_headers.h,v 1.5 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_headers.h,v 1.6 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -192,8 +192,14 @@ extern double __scalbn(double x, int n);
/****************************************************************************/
extern double __not_a_number;
extern double __infinity;
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
/* math_huge_val.c */
double __get_huge_val(void);
/****************************************************************************/

44
library/math_huge_val.c Normal file
View File

@ -0,0 +1,44 @@
/*
* $Id: math_huge_val.c,v 1.1 2005-02-03 16:56:15 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 _MATH_HEADERS_H
#include "math_headers.h"
#endif /* _MATH_HEADERS_H */
/****************************************************************************/
double
__get_huge_val(void)
{
return(__huge_val);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_init_exit.c,v 1.6 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_init_exit.c,v 1.7 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -127,82 +127,28 @@ __math_init(void)
the largest representable floating point value. */
if(sizeof(__huge_val) == 4) /* single precision */
{
static const unsigned long largest_fp_value[1] =
{
/* Exponent = +126, Mantissa = 8,388,607 */
0x7f7fffff
};
union ieee_single * x = (union ieee_single *)&__huge_val;
static const unsigned long not_a_number[1] =
{
/* Exponent = 255 and fraction != 0.0 */
0x7fffffff
};
static const unsigned long infinity[1] =
{
/* Exponent = 255 and fraction = 0.0 */
0x7f800000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
/* Exponent = +126, Mantissa = 8,388,607 */
x->raw[0] = 0x7f7fffff;
}
else if (sizeof(__huge_val) == 8) /* double precision */
{
static const unsigned long largest_fp_value[2] =
{
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
0x7fefffff,0xffffffff
};
union ieee_double * x = (union ieee_double *)&__huge_val;
static const unsigned long not_a_number[2] =
{
/* Exponent = 2047 and fraction != 0.0 */
0x7fffffff,0xffffffff
};
static const unsigned long infinity[2] =
{
/* Exponent = 2047 and fraction = 0.0 */
0x7ff00000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
x->raw[0] = 0x7fefffff;
x->raw[1] = 0xffffffff;
}
#if defined(USE_LONG_DOUBLE)
else if (sizeof(__huge_val) == 12) /* extended precision */
{
static const unsigned long largest_fp_value[3] =
{
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
0x7ffe0000,0xffffffff,0xffffffff
};
union ieee_long_double * x = (union ieee_long_double *)&__huge_val;
static const unsigned long not_a_number[3] =
{
/* Exponent = 32767 and fraction != 0.0 */
0x7fff0000,0xffffffff,0xffffffff
};
static const unsigned long infinity[3] =
{
/* Exponent = 32767 and fraction = 0.0 */
0x7fff0000,0x00000000,0x00000000
};
assert( sizeof(largest_fp_value) == sizeof(__huge_val) );
memmove((void *)&__huge_val,largest_fp_value,sizeof(largest_fp_value));
memmove((void *)&__not_a_number,not_a_number,sizeof(not_a_number));
memmove((void *)&__infinity,infinity,sizeof(infinity));
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
x->raw[0] = 0x7ffe0000;
x->raw[1] = 0xffffffff;
x->raw[2] = 0xffffffff;
}
#endif /* USE_LONG_DOUBLE */

View File

@ -1,5 +1,5 @@
/*
* $Id: math_log.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_log.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -244,19 +244,16 @@ log(double x)
{
double result;
/* ZZZ when do we consider 'x' to be invalid? If it's close
* enough to zero or negative. How large is epsilon, and how
* do we return minus infinity?
*/
if(x > 0.0)
if(x > DBL_EPSILON)
{
result = __log(x);
}
else
{
/* ZZZ this should be minus infinity */
result = -HUGE_VAL;
errno = ERANGE;
__set_errno(ERANGE);
/* This should really be minus infinity. */
result = (-__get_huge_val());
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: math_log10.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_log10.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -186,19 +186,16 @@ log10(double x)
{
double result;
/* ZZZ when do we consider 'x' to be invalid? If it's close
* enough to zero or negative. How large is epsilon, and how
* do we return minus infinity?
*/
if(x > 0.0)
if(x > DBL_EPSILON)
{
result = __log10(x);
}
else
{
/* ZZZ this should be minus infinity */
result = -HUGE_VAL;
errno = ERANGE;
__set_errno(ERANGE);
/* This should really be minus infinity. */
result = (-__get_huge_val());
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: math_logb.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_logb.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -103,7 +103,7 @@ logb(double x)
if(x == 0.0)
{
result = -HUGE_VAL;
result = -__get_huge_val();
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_modf.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_modf.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -150,8 +150,9 @@ modf(double x,double *nptr)
{
if(nptr == NULL)
{
errno = EFAULT;
result = HUGE_VAL;
__set_errno(EFAULT);
result = __get_huge_val();
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_pow.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_pow.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -424,8 +424,9 @@ pow(double x,double y)
if(x == 0.0 && y < 0.0)
{
result = HUGE_VAL;
errno = EDOM;
__set_errno(EDOM);
result = __get_huge_val();
goto out;
}
@ -436,8 +437,9 @@ pow(double x,double y)
abs_y = fabs(y);
if(floor(abs_y) != abs_y)
{
result = HUGE_VAL;
errno = EDOM;
__set_errno(EDOM);
result = __get_huge_val();
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: math_sqrt.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
* $Id: math_sqrt.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -252,7 +252,7 @@ sqrt(double x)
else
{
result = 0;
errno = EDOM;
__set_errno(EDOM);
}
return(result);

View File

@ -1,5 +1,5 @@
/*
* $Id: mount_fstatfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: mount_fstatfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -70,7 +70,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
{
SHOWMSG("invalid buffer parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -86,7 +86,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
fd = __get_file_descriptor(file_descriptor);
if(fd == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
@ -102,7 +102,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
result = message.result;
if(result != 0)
{
errno = message.error;
__set_errno(message.error);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: mount_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: mount_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -42,6 +42,12 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#include <sys/mount.h>
/****************************************************************************/

View File

@ -1,5 +1,5 @@
/*
* $Id: mount_statfs.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: mount_statfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -74,7 +74,7 @@ statfs(const char *path, struct statfs *buf)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}
@ -123,7 +123,7 @@ statfs(const char *path, struct statfs *buf)
{
SHOWMSG("that didn't work");
__translate_access_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_access_io_error_to_errno(IoErr()));
goto out;
}
@ -135,7 +135,7 @@ statfs(const char *path, struct statfs *buf)
{
SHOWMSG("didn't get the info");
__translate_io_error_to_errno(IoErr(),&errno);
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}

View File

@ -1,6 +1,6 @@
#define VERSION 1
#define REVISION 185
#define DATE "2.1.2005"
#define VERS "net.lib 1.185"
#define VSTRING "net.lib 1.185 (2.1.2005)\r\n"
#define VERSTAG "\0$VER: net.lib 1.185 (2.1.2005)"
#define REVISION 188
#define DATE "7.2.2005"
#define VERS "net.lib 1.188"
#define VSTRING "net.lib 1.188 (7.2.2005)\r\n"
#define VERSTAG "\0$VER: net.lib 1.188 (7.2.2005)"

View File

@ -1 +1 @@
185
188

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_data.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_data.c,v 1.4 2005-01-09 10:10:41 obarthel Exp $
*
* :ts=4
*
@ -54,7 +54,3 @@ int __signals_blocked;
/****************************************************************************/
BOOL __check_abort_enabled = TRUE;
/****************************************************************************/
BOOL __termination_message_disabled;

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_headers.h,v 1.5 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_headers.h,v 1.6 2005-01-09 10:10:41 obarthel Exp $
*
* :ts=4
*
@ -76,10 +76,6 @@ extern int NOCOMMON __signals_blocked;
/****************************************************************************/
extern BOOL NOCOMMON __termination_message_disabled;
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_kill.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_kill.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -64,7 +64,7 @@ kill(pid_t pid, int signal_number)
{
SHOWMSG("didn't find the process");
errno = ESRCH;
__set_errno(ESRCH);
goto out;
}
@ -95,7 +95,7 @@ kill(pid_t pid, int signal_number)
{
SHOWMSG("didn't find the process");
errno = ESRCH;
__set_errno(ESRCH);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_raise.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_raise.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -52,7 +52,7 @@ raise(int sig)
{
SHOWMSG("unknown signal number");
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_sigaddset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_sigaddset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -60,7 +60,7 @@ sigaddset(sigset_t * set,int sig)
{
if(set == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_sigemptyset.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_sigemptyset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -60,7 +60,7 @@ sigemptyset(sigset_t * set)
{
if(set == NULL)
{
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_signal.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_signal.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -51,7 +51,7 @@ void (*signal(int sig, void (* handler)(int)))(int)
{
SHOWMSG("unsupported signal");
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: signal_sigprocmask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
* $Id: signal_sigprocmask.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -56,7 +56,7 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{
SHOWMSG("invalid operating mode");
errno = EINVAL;
__set_errno(EINVAL);
goto out;
}

View File

@ -1,5 +1,5 @@
#
# $Id: smakefile,v 1.15 2004-12-26 10:28:56 obarthel Exp $
_#
# $Id: smakefile,v 1.20 2005-02-04 15:03:10 obarthel Exp $
#
# :ts=8
#
@ -190,6 +190,7 @@ MATH_OBJ = \
math_floor.o \
math_fmod.o \
math_frexp.o \
math_huge_val.o \
math_hypot.o \
math_init_exit.o \
math_isinf.o \
@ -375,6 +376,8 @@ STDLIB_OBJ = \
stdlib_destructor.o \
stdlib_detach.o \
stdlib_dosbase.o \
stdlib_get_errno.o \
stdlib_set_errno.o \
stdlib_sysbase.o \
stdlib_termination_message.o \
stdlib_threshold.o \
@ -471,9 +474,12 @@ TIME_OBJ = \
time_asctime_r.o \
time_clock.o \
time_converttime.o \
time_convert_datestamp.o \
time_convert_time.o \
time_ctime.o \
time_ctime_r.o \
time_data.o \
time_days_per_date.o \
time_difftime.o \
time_gettimeofday.o \
time_gmtime.o \
@ -483,7 +489,8 @@ TIME_OBJ = \
time_mktime.o \
time_numbertostring.o \
time_strftime.o \
time_time.o
time_time.o \
time_weekday.o
UNISTD_OBJ = \
unistd_access.o \
@ -494,8 +501,10 @@ UNISTD_OBJ = \
unistd_dup.o \
unistd_dup2.o \
unistd_fchown.o \
unistd_fdatasync.o \
unistd_fdopen.o \
unistd_fileno.o \
unistd_fsync.o \
unistd_ftruncate.o \
unistd_getcwd.o \
unistd_getopt.o \

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_accept.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: socket_accept.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -71,7 +71,7 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_bind.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
* $Id: socket_bind.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -68,7 +68,7 @@ bind(int sockfd,struct sockaddr *name,int namelen)
{
SHOWMSG("invalid name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_connect.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_connect.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -68,7 +68,7 @@ connect(int sockfd,struct sockaddr *name,int namelen)
{
SHOWMSG("invalid name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_get_descriptor.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_get_descriptor.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -50,13 +50,13 @@ __get_socket_descriptor(int socket_descriptor)
fd = __get_file_descriptor(socket_descriptor);
if(fd == NULL)
{
errno = EBADF;
__set_errno(EBADF);
goto out;
}
if(FLAG_IS_CLEAR(fd->fd_Flags,FDF_IS_SOCKET))
{
errno = ENOTSOCK;
__set_errno(ENOTSOCK);
goto out;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_gethostbyaddr.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_gethostbyaddr.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -67,7 +67,7 @@ gethostbyaddr(const char *addr, int len, int type)
{
SHOWMSG("invalid addr parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_gethostbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_gethostbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -65,7 +65,7 @@ gethostbyname(const char *name)
{
SHOWMSG("invalid name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_gethostname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_gethostname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -66,7 +66,7 @@ gethostname(const char *hostname,int size)
{
SHOWMSG("invalid host name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getnetbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getnetbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -65,7 +65,7 @@ getnetbyname(const char *name)
{
SHOWMSG("invalid name parameter");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getpeername.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getpeername.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -68,7 +68,7 @@ getpeername(int sockfd,struct sockaddr *name,int *namelen)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getprotobyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getprotobyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ getprotobyname(const char *name)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getservbyname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getservbyname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ getservbyname(const char *name, const char *proto)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getservbyport.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getservbyport.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -63,7 +63,7 @@ getservbyport(int port, const char *proto)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getsockname.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getsockname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -68,7 +68,7 @@ getsockname(int sockfd,struct sockaddr *name,int *namelen)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_getsockopt.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_getsockopt.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -70,7 +70,7 @@ getsockopt(int sockfd,int level,int optname,void *optval,int *optlen)
{
SHOWMSG("invalid parameters");
errno = EFAULT;
__set_errno(EFAULT);
goto out;
}
}

View File

@ -1,5 +1,5 @@
/*
* $Id: socket_headers.h,v 1.4 2005-01-02 09:07:08 obarthel Exp $
* $Id: socket_headers.h,v 1.5 2005-02-03 16:56:15 obarthel Exp $
*
* :ts=4
*
@ -48,6 +48,12 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
extern struct Library * NOCOMMON __SocketBase;
/****************************************************************************/

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