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

1 Commits

Author SHA1 Message Date
Olaf Barthel
c61e6cf190 This commit was manufactured by cvs2svn to create tag 'V1_185'.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/tags/V1_185@14790 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2005-01-02 09:07:22 +00:00
275 changed files with 1624 additions and 2886 deletions

View File

@@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.26 2005-02-07 10:52:16 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.19 2004-12-26 10:28:56 obarthel Exp $
#
# :ts=8
#
@@ -99,16 +99,14 @@ endif
##############################################################################
WARNINGS = \
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
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
@@ -272,7 +270,6 @@ C_LIB = \
stdlib_dosbase.o \
stdlib_exit.o \
stdlib_free.o \
stdlib_get_errno.o \
stdlib_getdefstacksize.o \
stdlib_getenv.o \
stdlib_getsp.o \
@@ -299,7 +296,6 @@ 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 \
@@ -365,12 +361,9 @@ 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 \
@@ -380,7 +373,6 @@ C_LIB = \
time_numbertostring.o \
time_strftime.o \
time_time.o \
time_weekday.o \
unistd_access.o \
unistd_chdir.o \
unistd_chdir_exit.o \
@@ -389,10 +381,8 @@ 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 \
@@ -479,7 +469,6 @@ 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.26 2005-02-07 10:52:16 obarthel Exp $
# $Id: GNUmakefile.os4,v 1.19 2004-12-26 10:28:56 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 -a
COPY = cp
DELETE = rm -r
MAKEDIR = mkdir
@@ -105,10 +105,8 @@ endif
##############################################################################
WARNINGS = \
-Wall -W -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wunused
# -Wconversion -Wshadow
-Wall -W -Wshadow -Wpointer-arith -Wsign-compare -Wmissing-prototypes \
-Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion
INCLUDES = -Iinclude -I. -I$(SDK_INCLUDE)
OPTIONS = -DNDEBUG -DUSE_64_BIT_INTS -D__USE_INLINE__ -Wa,-mregnames
@@ -277,7 +275,6 @@ 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 \
@@ -302,7 +299,6 @@ 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 \
@@ -369,12 +365,9 @@ 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 \
@@ -384,7 +377,6 @@ C_LIB = \
time_numbertostring.o \
time_strftime.o \
time_time.o \
time_weekday.o \
unistd_access.o \
unistd_chdir.o \
unistd_chdir_exit.o \
@@ -393,10 +385,8 @@ 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 \
@@ -485,7 +475,6 @@ 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 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)"
#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)"

View File

@@ -1 +1 @@
188
185

View File

@@ -1,5 +1,5 @@
/*
* $Id: amiga_rexxvars.c,v 1.3 2005-01-09 10:10:40 obarthel Exp $
* $Id: amiga_rexxvars.c,v 1.2 2005-01-02 09:07:07 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 UBYTE buffer[256];
STATIC TEXT 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.3 2005-01-09 10:10:41 obarthel Exp $
* $Id: amiga_setsuperattrs.c,v 1.2 2005-01-02 09:07:07 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 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)"
#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)"

View File

@@ -1 +1 @@
188
185

View File

@@ -1,150 +1,3 @@
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.3 2005-01-09 15:20:31 obarthel Exp $
* $Id: ctype_table.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -36,8 +36,22 @@
/****************************************************************************/
const unsigned char __ctype_table[2 * 128] =
/* The construction of this table is rather peculiar. The assumption is that
the table index from which a flag value could be fetched is in the range
-128..255 since the character to be tested could be a signed or unsigned
8 bit value. The table access pointer (declared below) therefore points
to the 128th byte of '__ctype_data[]'. */
static const unsigned char __ctype_data[3 * 128] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0 */ __CTYPE_CONTROL,
/* 1 */ __CTYPE_CONTROL,
/* 2 */ __CTYPE_CONTROL,
@@ -176,3 +190,7 @@ 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
};
/****************************************************************************/
const unsigned char * const __ctype_table = &__ctype_data[128];

View File

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

View File

@@ -1 +1 @@
188
185

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: dirent_opendir.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* $Id: dirent_opendir.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -106,7 +106,7 @@ opendir(const char * path_name)
{
SHOWMSG("invalid parameter");
__set_errno(EFAULT);
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);
__set_errno(ENOMEM);
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((struct List *)&dh->dh_VolumeList,node->ln_Name) != NULL)
if(find_by_name(&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((struct List *)&dh->dh_VolumeList,node);
AddTail(&dh->dh_VolumeList,node);
}
}
UnLockDosList(LDF_VOLUMES|LDF_READ);
/* Bail out if we cannot present anything. */
if(IsListEmpty((struct List *)&dh->dh_VolumeList))
if(IsListEmpty(&dh->dh_VolumeList))
{
__set_errno(ENOMEM);
errno = ENOMEM;
goto out;
}
}
@@ -212,7 +212,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't get a lock on it");
__set_errno(__translate_access_io_error_to_errno(IoErr()));
__translate_access_io_error_to_errno(IoErr(),&errno);
goto out;
}
@@ -226,7 +226,7 @@ opendir(const char * path_name)
{
SHOWMSG("couldn't examine it");
__set_errno(__translate_io_error_to_errno(IoErr()));
__translate_io_error_to_errno(IoErr(),&errno);
goto out;
}
@@ -234,7 +234,7 @@ opendir(const char * path_name)
{
SHOWMSG("this isn't a directory");
__set_errno(ENOTDIR);
errno = ENOTDIR;
goto out;
}
}
@@ -254,12 +254,8 @@ opendir(const char * path_name)
{
SHOWMSG("ouch. cleaning up");
#if defined(UNIX_PATH_SEMANTICS)
{
while((node = RemHead((struct List *)&dh->dh_VolumeList)) != NULL)
free(node);
}
#endif /* UNIX_PATH_SEMANTICS */
while((node = RemHead(&dh->dh_VolumeList)) != NULL)
free(node);
PROFILE_OFF();
UnLock(dh->dh_DirLock);

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: dirent_rewinddir.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: dirent_rewinddir.c,v 1.3 2005-01-02 09:07:07 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");
__set_errno(__translate_io_error_to_errno(IoErr()));
__translate_io_error_to_errno(IoErr(),&errno);
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* $Id: fcntl_close.c,v 1.8 2005-02-04 08:49:10 obarthel Exp $
* $Id: fcntl_close.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -45,12 +45,9 @@ 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();
@@ -99,7 +96,6 @@ __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 */
{
@@ -121,35 +117,31 @@ __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;
}
/* 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)
(*error_ptr) = OK;
if(NOT no_close)
{
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 = TRUE;
message.arg = 1;
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;
@@ -177,12 +169,10 @@ int
close(int file_descriptor)
{
int result;
int error;
ENTER();
result = __close(file_descriptor,&error);
__set_errno(error);
result = __close(file_descriptor,&errno);
RETURN(result);
return(result);

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* $Id: fcntl_get_default_file.c,v 1.2 2005-01-02 09:07:07 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)
{
__set_errno(EBADF);
errno = EBADF;
goto out;
}

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: fcntl_open.c,v 1.8 2005-02-03 16:56:15 obarthel Exp $
* $Id: fcntl_open.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -53,39 +53,6 @@
/****************************************************************************/
/* 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 */ )
{
@@ -97,9 +64,10 @@ 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;
LONG is_interactive = FALSE;
int fd_slot_number;
struct fd * fd;
int access_mode;
@@ -123,7 +91,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("path name is invalid");
__set_errno(EFAULT);
errno = EFAULT;
goto out;
}
}
@@ -134,7 +102,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("access mode is invalid");
__set_errno(EINVAL);
errno = EINVAL;
goto out;
}
@@ -160,7 +128,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(path_name_nti.is_root)
{
__set_errno(EACCES);
errno = EACCES;
goto out;
}
}
@@ -187,7 +155,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("the file already exists");
__set_errno(EEXIST);
errno = EEXIST;
goto out;
}
@@ -197,14 +165,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("there's something not a directory on the path");
__set_errno(ENOTDIR);
errno = ENOTDIR;
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__set_errno(__translate_io_error_to_errno(IoErr()));
__translate_io_error_to_errno(IoErr(),&errno);
goto out;
}
@@ -233,7 +201,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("could not examine the object");
__set_errno(__translate_io_error_to_errno(IoErr()));
__translate_io_error_to_errno(IoErr(),&errno);
goto out;
}
@@ -242,7 +210,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("can't open a directory");
__set_errno(EISDIR);
errno = EISDIR;
goto out;
}
@@ -251,7 +219,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("this object is not write enabled");
__set_errno(EACCES);
errno = EACCES;
goto out;
}
@@ -274,14 +242,14 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
{
SHOWMSG("there's something not a directory on the path");
__set_errno(ENOTDIR);
errno = ENOTDIR;
goto out;
}
else if (error != ERROR_OBJECT_NOT_FOUND && error != ERROR_ACTION_NOT_KNOWN)
{
SHOWMSG("error accessing the object");
__set_errno(__translate_io_error_to_errno(IoErr()));
__translate_io_error_to_errno(IoErr(),&errno);
goto out;
}
}
@@ -305,7 +273,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));
__set_errno(__translate_access_io_error_to_errno(io_err));
__translate_access_io_error_to_errno(IoErr(),&errno);
/* Check if ended up trying to open a directory as if
it were a plain file. */
@@ -317,7 +285,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(lock != ZERO)
{
if(Examine(lock,fib) && fib->fib_DirEntryType >= 0)
__set_errno(EISDIR);
errno = EISDIR;
}
PROFILE_ON();
@@ -326,13 +294,60 @@ 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();
is_interactive = IsInteractive(handle);
if(file_handle->fh_Type != NULL)
is_interactive = IsInteractive(handle);
PROFILE_ON();
if(is_interactive)
@@ -353,7 +368,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
len = 0;
for(i = 0 ; path_name[i] != '\0' ; i++)
for(i = 0 ; i < (int)strlen(path_name) ; i++)
{
if(path_name[i] == ':')
{
@@ -388,11 +403,21 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
if(is_file_system)
{
/* 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);
/* 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 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.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: fcntl_read.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -136,12 +136,10 @@ 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,&error);
__set_errno(error);
result = __read(file_descriptor,buffer,num_bytes,&errno);
RETURN(result);
return(result);

View File

@@ -1,5 +1,5 @@
/*
* $Id: fcntl_write.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: fcntl_write.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -136,12 +136,10 @@ 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,&error);
__set_errno(error);
result = __write(file_descriptor,buffer,num_bytes,&errno);
RETURN(result);
return(result);

View File

@@ -1,5 +1,5 @@
/*
* $Id: ctype.h,v 1.5 2005-01-09 15:20:33 obarthel Exp $
* $Id: ctype.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
*
* :ts=4
*
@@ -66,14 +66,15 @@ 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.
* 'C' locale rules. Note that the characters to be tested must be either
* signed or unsigned 8 bit values.
*/
#ifdef __C_MACROS__
/****************************************************************************/
extern const unsigned char __ctype_table[];
extern const unsigned char * const __ctype_table;
/****************************************************************************/
@@ -88,17 +89,17 @@ extern const unsigned char __ctype_table[];
/****************************************************************************/
#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)
#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)
/****************************************************************************/

View File

@@ -1,5 +1,5 @@
/*
* $Id: dos.h,v 1.7 2005-02-03 17:33:54 obarthel Exp $
* $Id: dos.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
*
* :ts=4
*
@@ -66,26 +66,6 @@ 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
@@ -298,7 +278,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 int __translate_io_error_to_errno(LONG io_error);
extern void __translate_io_error_to_errno(LONG io_error,int * errno_ptr);
/****************************************************************************/

View File

@@ -1,296 +0,0 @@
/*
* $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.5 2005-01-09 09:40:33 obarthel Exp $
* $Id: limits.h,v 1.4 2005-01-02 09:07:21 obarthel Exp $
*
* :ts=4
*
@@ -36,50 +36,21 @@
/****************************************************************************/
#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 SHRT_MAX 32767
#define USHRT_MAX 65535
/****************************************************************************/
#define INT_MIN (-2147483647L - 1)
#define CHAR_BIT 8
#define CHAR_MAX 127
#define CHAR_MIN -128
#define INT_MAX 2147483647L
#define UINT_MAX 4294967295UL
/****************************************************************************/
#define LONG_MIN (-2147483647L - 1)
#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 SHRT_MIN -32768
#define UCHAR_MAX 255
#define UINT_MAX 4294967295UL
#define ULONG_MAX 4294967295UL
#define USHRT_MAX 65535
/****************************************************************************/

View File

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

View File

@@ -1,186 +0,0 @@
/*
* $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.6 2005-01-30 09:48:06 obarthel Exp $
* $Id: stdlib.h,v 1.5 2005-01-02 09:07:21 obarthel Exp $
*
* :ts=4
*
@@ -149,12 +149,8 @@ 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.9 2005-02-04 15:03:14 obarthel Exp $
* $Id: unistd.h,v 1.8 2005-01-02 09:07:21 obarthel Exp $
*
* :ts=4
*
@@ -98,8 +98,6 @@ 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.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: locale_headers.h,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -53,9 +53,9 @@
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
#ifndef _STDLIB_LOCALE_UTILITY_H
#include "stdlib_locale_utility.h"
#endif /* _STDLIB_LOCALE_UTILITY_H */
/****************************************************************************/

View File

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

View File

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

View File

@@ -1 +1 @@
188
185

View File

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

View File

@@ -1 +1 @@
188
185

View File

@@ -1,5 +1,5 @@
/*
* $Id: macros.h,v 1.8 2005-01-30 09:37:59 obarthel Exp $
* $Id: macros.h,v 1.4 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -60,6 +60,10 @@
/****************************************************************************/
#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.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: math_acos.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -227,7 +227,7 @@ acos(double x)
else
{
result = 0;
__set_errno(EDOM);
errno = EDOM;
}
return(result);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,44 +0,0 @@
/*
* $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.7 2005-02-03 16:56:15 obarthel Exp $
* $Id: math_init_exit.c,v 1.6 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -127,28 +127,82 @@ __math_init(void)
the largest representable floating point value. */
if(sizeof(__huge_val) == 4) /* single precision */
{
union ieee_single * x = (union ieee_single *)&__huge_val;
static const unsigned long largest_fp_value[1] =
{
/* Exponent = +126, Mantissa = 8,388,607 */
0x7f7fffff
};
/* Exponent = +126, Mantissa = 8,388,607 */
x->raw[0] = 0x7f7fffff;
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));
}
else if (sizeof(__huge_val) == 8) /* double precision */
{
union ieee_double * x = (union ieee_double *)&__huge_val;
static const unsigned long largest_fp_value[2] =
{
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
0x7fefffff,0xffffffff
};
/* Exponent = +1022, Mantissa = 4,503,599,627,370,495 */
x->raw[0] = 0x7fefffff;
x->raw[1] = 0xffffffff;
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));
}
#if defined(USE_LONG_DOUBLE)
else if (sizeof(__huge_val) == 12) /* extended precision */
{
union ieee_long_double * x = (union ieee_long_double *)&__huge_val;
static const unsigned long largest_fp_value[3] =
{
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
0x7ffe0000,0xffffffff,0xffffffff
};
/* Exponent = +32766, Mantissa = 18,446,744,073,709,551,615 */
x->raw[0] = 0x7ffe0000;
x->raw[1] = 0xffffffff;
x->raw[2] = 0xffffffff;
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));
}
#endif /* USE_LONG_DOUBLE */

View File

@@ -1,5 +1,5 @@
/*
* $Id: math_log.c,v 1.5 2005-02-03 16:56:15 obarthel Exp $
* $Id: math_log.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -244,16 +244,19 @@ log(double x)
{
double result;
if(x > DBL_EPSILON)
/* 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)
{
result = __log(x);
}
else
{
__set_errno(ERANGE);
/* This should really be minus infinity. */
result = (-__get_huge_val());
/* ZZZ this should be minus infinity */
result = -HUGE_VAL;
errno = ERANGE;
}
return(result);

View File

@@ -1,5 +1,5 @@
/*
* $Id: math_log10.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: math_log10.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -186,16 +186,19 @@ log10(double x)
{
double result;
if(x > DBL_EPSILON)
/* 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)
{
result = __log10(x);
}
else
{
__set_errno(ERANGE);
/* This should really be minus infinity. */
result = (-__get_huge_val());
/* ZZZ this should be minus infinity */
result = -HUGE_VAL;
errno = ERANGE;
}
return(result);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1 +1 @@
188
185

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: signal_headers.h,v 1.6 2005-01-09 10:10:41 obarthel Exp $
* $Id: signal_headers.h,v 1.5 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -76,6 +76,10 @@ 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.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: signal_kill.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -64,7 +64,7 @@ kill(pid_t pid, int signal_number)
{
SHOWMSG("didn't find the process");
__set_errno(ESRCH);
errno = ESRCH;
goto out;
}
@@ -95,7 +95,7 @@ kill(pid_t pid, int signal_number)
{
SHOWMSG("didn't find the process");
__set_errno(ESRCH);
errno = ESRCH;
goto out;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
_#
# $Id: smakefile,v 1.20 2005-02-04 15:03:10 obarthel Exp $
#
# $Id: smakefile,v 1.15 2004-12-26 10:28:56 obarthel Exp $
#
# :ts=8
#
@@ -190,7 +190,6 @@ 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 \
@@ -376,8 +375,6 @@ 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 \
@@ -474,12 +471,9 @@ 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 \
@@ -489,8 +483,7 @@ TIME_OBJ = \
time_mktime.o \
time_numbertostring.o \
time_strftime.o \
time_time.o \
time_weekday.o
time_time.o
UNISTD_OBJ = \
unistd_access.o \
@@ -501,10 +494,8 @@ 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.3 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_accept.c,v 1.2 2005-01-02 09:07:07 obarthel Exp $
*
* :ts=4
*
@@ -71,7 +71,7 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen)
{
SHOWMSG("invalid parameters");
__set_errno(EFAULT);
errno = EFAULT;
goto out;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_hook_entry.c,v 1.6 2005-02-04 15:03:10 obarthel Exp $
* $Id: socket_hook_entry.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -73,7 +73,7 @@ __socket_hook_entry(
PROFILE_OFF();
result = __recv((LONG)fd->fd_DefaultFile,message->data,message->size,0);
error = __get_errno();
error = errno;
PROFILE_ON();
@@ -92,7 +92,7 @@ __socket_hook_entry(
PROFILE_OFF();
result = __send((LONG)fd->fd_DefaultFile,message->data,message->size,0);
error = __get_errno();
error = errno;
PROFILE_ON();
@@ -141,7 +141,7 @@ __socket_hook_entry(
param = (int)(message->arg == 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIONBIO,&param);
error = __get_errno();
error = errno;
break;
@@ -152,7 +152,7 @@ __socket_hook_entry(
param = (int)(message->arg != 0);
result = __IoctlSocket(fd->fd_DefaultFile,FIOASYNC,&param);
error = __get_errno();
error = errno;
break;
@@ -174,15 +174,6 @@ __socket_hook_entry(
break;
case file_hook_action_flush:
SHOWMSG("file_hook_action_flush attempted on socket");
result = -1;
error = EINVAL;
break;
default:
SHOWVALUE(message->action);

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_inet_aton.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_inet_aton.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -108,7 +108,7 @@ inet_aton(const char *cp, struct in_addr *addr)
{
SHOWMSG("invalid parameters");
__set_errno(EFAULT);
errno = EFAULT;
return(0);
}
}

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_init_exit.c,v 1.8 2005-01-09 10:10:41 obarthel Exp $
* $Id: socket_init_exit.c,v 1.7 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -244,13 +244,15 @@ __socket_init(void)
SHOWVALUE(daemon_socket);
/* Whatever happens, the following likely won't end up
* in the console...
*/
__termination_message_disabled = TRUE;
/* Shut down the three standard I/O streams. */
for(i = STDIN_FILENO ; i <= STDERR_FILENO ; i++)
close(i);
/* The standard I/O streams are no longer attached to a console. */
__no_standard_io = TRUE;
/* Put the socket into the three standard I/O streams. */
for(i = STDIN_FILENO ; i <= STDERR_FILENO ; i++)
{
@@ -282,6 +284,9 @@ __socket_init(void)
/* This program now runs as an internet superserver client (daemon). */
__is_daemon = TRUE;
/* The standard I/O streams are no longer attached to a console. */
__no_standard_io = TRUE;
}
}

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_recv.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_recv.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -70,7 +70,7 @@ recv(int sockfd,void *buff,size_t nbytes,int flags)
{
SHOWMSG("invalid buffer parameter");
__set_errno(EFAULT);
errno = EFAULT;
goto out;
}
}

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_select.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_select.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -726,7 +726,7 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
PROFILE_ON();
/* Stop if a break signal arrives. */
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__check_abort();
@@ -837,7 +837,7 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
result = __WaitSelect(total_socket_fd,socket_read_fds,socket_write_fds,socket_except_fds,timeout,&break_mask);
PROFILE_ON();
if((result < 0 && __get_errno() == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
if((result < 0 && errno == EINTR) || FLAG_IS_SET(break_mask,SIGBREAKF_CTRL_C))
{
SetSignal(SIGBREAKF_CTRL_C,SIGBREAKF_CTRL_C);
__check_abort();

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_send.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_send.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -70,7 +70,7 @@ send(int sockfd,const void *buff,size_t nbytes,int flags)
{
SHOWMSG("invalid buffer parameter");
__set_errno(EFAULT);
errno = EFAULT;
goto out;
}
}

View File

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

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_sendto.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
* $Id: socket_sendto.c,v 1.3 2005-01-02 09:07:08 obarthel Exp $
*
* :ts=4
*
@@ -71,7 +71,7 @@ sendto(int sockfd,const void *buff,int len,int flags,struct sockaddr *to,int tol
{
SHOWMSG("invalid parameters");
__set_errno(EFAULT);
errno = EFAULT;
goto out;
}
}

View File

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

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