mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
Initial import into SourceForge CVS
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14685 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
70
library/include/assert.h
Normal file
70
library/include/assert.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id: assert.h,v 1.1.1.1 2004-07-26 16:32:49 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef assert
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void __assertion_failure(const char *file_name,int line_number,const char * expression);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define assert(expression) \
|
||||
((void)((expression) ? 0 : (__assertion_failure(__FILE__,__LINE__,#expression),0)))
|
||||
|
||||
#else
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define assert(expression) ((void)0)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* NDEBUG */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* assert */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _ASSERT_H */
|
||||
122
library/include/ctype.h
Normal file
122
library/include/ctype.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* $Id: ctype.h,v 1.1.1.1 2004-07-26 16:32:50 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _CYTPE_H
|
||||
#define _CYTPE_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int isalnum(int c);
|
||||
extern int isalpha(int c);
|
||||
extern int iscntrl(int c);
|
||||
|
||||
extern int isdigit(int c);
|
||||
extern int isxdigit(int c);
|
||||
|
||||
extern int isgraph(int c);
|
||||
extern int ispunct(int c);
|
||||
extern int isprint(int c);
|
||||
|
||||
extern int islower(int c);
|
||||
extern int isupper(int c);
|
||||
|
||||
extern int isspace(int c);
|
||||
|
||||
extern int tolower(int c);
|
||||
extern int toupper(int c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
#define isascii(c) ((unsigned)(c) <= 127)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifdef __C_MACROS__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern const unsigned char * const __ctype_table;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define __CTYPE_CONTROL 0x01 /* This is a control character */
|
||||
#define __CTYPE_DIGIT 0x02 /* This is a 'decimal' digit */
|
||||
#define __CTYPE_HEX_DIGIT 0x04 /* This is a hexadecimal digit */
|
||||
#define __CTYPE_PUNCTUATION 0x08 /* This is a punctuation character */
|
||||
#define __CTYPE_PRINTABLE 0x10 /* This is a printable character */
|
||||
#define __CTYPE_WHITE_SPACE 0x20 /* This is a blank space character */
|
||||
#define __CTYPE_LOWER_CASE 0x40 /* This is a lower case letter */
|
||||
#define __CTYPE_UPPER_CASE 0x80 /* This is an upper case letter */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#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)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __C_MACROS__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _CYTPE_H */
|
||||
88
library/include/dirent.h
Normal file
88
library/include/dirent.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* $Id: dirent.h,v 1.1.1.1 2004-07-26 16:32:50 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _DIRENT_H
|
||||
#define _DIRENT_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
#ifndef _STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif /* _STDIO_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define NAME_MAX FILENAME_MAX
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef long DIR;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct dirent
|
||||
{
|
||||
ino_t d_ino;
|
||||
char d_name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern DIR * opendir(const char * path_name);
|
||||
extern struct dirent * readdir(DIR * directory_pointer);
|
||||
extern void rewinddir(DIR * directory_pointer);
|
||||
extern int closedir(DIR * directory_pointer);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _DIRENT_H */
|
||||
243
library/include/dos.h
Normal file
243
library/include/dos.h
Normal file
@ -0,0 +1,243 @@
|
||||
/*
|
||||
* $Id: dos.h,v 1.1.1.1 2004-07-26 16:32:50 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _DOS_H
|
||||
#define _DOS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif /* _STDIO_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef WORKBENCH_STARTUP_H
|
||||
#include <workbench/startup.h>
|
||||
#endif /* WORKBENCH_STARTUP_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* The Workbench startup message passed to this program; this may be NULL
|
||||
* if the program was started from shell instead.
|
||||
*
|
||||
* The variable name is set up to be __WBenchMsg to make it fit into the
|
||||
* 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.
|
||||
*/
|
||||
extern struct WBStartup * __WBenchMsg;
|
||||
#define WBenchMsg __WBenchMsg
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* This is filled in with a pointer to the name of the program being run. */
|
||||
extern char * __program_name;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Set this to FALSE to disable all Ctrl+C checking in the program. */
|
||||
extern BOOL __check_abort_enabled;
|
||||
|
||||
/*
|
||||
* You can replace this function with your own and perform your own
|
||||
* Ctrl+C checking.
|
||||
*/
|
||||
extern void __check_abort(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Call this function to set up the environment information for your
|
||||
* program to access its data. This is typically used in Task or Process
|
||||
* functions, as launched from the main program.
|
||||
*
|
||||
* Note: this function is unavailable for residentable programs and may
|
||||
* not be available for PowerPC programs.
|
||||
*/
|
||||
extern void geta4(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Read and modify the current value of register A4; helpful for
|
||||
* programs which are residentable, yet need to be able to pass the
|
||||
* context information around A4 points to.
|
||||
*
|
||||
* Note: this function may not be available for PowerPC programs.
|
||||
*/
|
||||
extern unsigned long __get_a4(void);
|
||||
extern void __set_a4(unsigned long value);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* This will be set to TRUE if the current program was launched from
|
||||
* the internet superserver ('inetd') or an equivalent facility.
|
||||
*/
|
||||
extern BOOL __is_daemon;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* If the library is built with memory debugging features enabled,
|
||||
* the following variable controls whether memory allocated, to be
|
||||
* released, will actually get released. If set to TRUE all memory
|
||||
* allocations will persist until the program exits.
|
||||
*/
|
||||
extern BOOL __never_free;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Before memory is allocated, a quick check can be performed in order
|
||||
* to avoid draining so much system memory that both the operating system
|
||||
* and application software becomes unstable. This test checks for the
|
||||
* largest available block of memory, which has to be larger than a
|
||||
* threshold value for the memory allocation to proceed. That size
|
||||
* can be configured here. It defaults to 0, which means that no test
|
||||
* is performed. If this feature is enabled, a minimum threshold value
|
||||
* of 250000 bytes is recommended.
|
||||
*/
|
||||
extern ULONG __free_memory_threshold;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* The following section lists variables and function pointers which are used
|
||||
* by the startup code right after the program is launched. These variables are
|
||||
* looked up before your program's main() function is invoked. Therefore, you
|
||||
* would have to declare these variables in your program's data section and have
|
||||
* them initialized to certain well-defined values to get the desired effect.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If set to TRUE, your program's process->pr_WindowPtr will be set to -1
|
||||
* when it starts. The process->pr_WindowPtr will be automatically restored
|
||||
* to the initial value before it exits.
|
||||
*/
|
||||
extern BOOL __disable_dos_requesters;
|
||||
|
||||
/*
|
||||
* If set to TRUE, your program will disconnect itself from the shell it was
|
||||
* launched from and keep running in the background. This service is unavailable
|
||||
* for residentable programs. Note that you should not use this feature for
|
||||
* programs which are supposed to be launched by the internet superserver.
|
||||
* Also, note that when a program is run in the background, its input and
|
||||
* output streams will be connected to NIL:.
|
||||
*/
|
||||
extern BOOL __detach;
|
||||
|
||||
/*
|
||||
* If this function pointer is not NULL, it must point to a function which
|
||||
* figures out whether the program should detach itself from the shell it
|
||||
* was launched from. The function return value replaces the value of the
|
||||
* __detach variable.
|
||||
*
|
||||
* At the time this function is invoked, dos.library and utility.library
|
||||
* have already been opened for you.
|
||||
*/
|
||||
extern BOOL (* __check_detach)(void);
|
||||
|
||||
/*
|
||||
* This variable can be set up to contain the minimum stack size the program
|
||||
* should be launched with. If the startup code finds that there is not enough
|
||||
* stack space available to start with, it will attempt to allocate more and
|
||||
* then proceed to run your program.
|
||||
*
|
||||
* If this variable is set to 0 (the default) then no stack size test will
|
||||
* be performed upon startup.
|
||||
*/
|
||||
extern unsigned int __stack_size;
|
||||
|
||||
/*
|
||||
* If this function pointer is not NULL, it must point to a function which
|
||||
* figures out how much stack space is required to run the program. The
|
||||
* function return value replaces the value of the __stack_size variable
|
||||
* if it is not equal to zero.
|
||||
*
|
||||
* At the time this function is invoked, dos.library and utility.library
|
||||
* have already been opened for you.
|
||||
*/
|
||||
extern unsigned int (* __get_default_stack_size)(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* If linked with -lunix, Unix path names are translated to Amiga path
|
||||
* names (and the other way round). If you wish to disable this, set the
|
||||
* following variable to FALSE. Only the path name translation is affected
|
||||
* by setting this variable to FALSE. You will always get Unix-like behaviour
|
||||
* from certain functions regardless of whether the path names are translated
|
||||
* or not.
|
||||
*/
|
||||
extern BOOL __unix_path_semantics;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* A data structures used by the path translation routines below. */
|
||||
struct name_translation_info
|
||||
{
|
||||
char substitute[MAXPATHLEN];
|
||||
char * original_name;
|
||||
int is_root;
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int __translate_relative_path_name(char const ** name_ptr,char *replace,size_t max_replace_len);
|
||||
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);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _DOS_H */
|
||||
170
library/include/errno.h
Normal file
170
library/include/errno.h
Normal file
@ -0,0 +1,170 @@
|
||||
/*
|
||||
* $Id: errno.h,v 1.1.1.1 2004-07-26 16:32:51 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _ERRNO_H
|
||||
#define _ERRNO_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int errno;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define EPERM 1 /* Operation not permitted */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* Input/output error */
|
||||
#define ENXIO 6 /* Device not configured */
|
||||
#define E2BIG 7 /* Argument list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file descriptor */
|
||||
#define ECHILD 10 /* No child processes */
|
||||
#define EDEADLK 11 /* Resource deadlock avoided */
|
||||
|
||||
#define ENOMEM 12 /* Cannot allocate memory */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Device busy */
|
||||
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* Operation not supported by device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* Too many open files in system */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Inappropriate ioctl for device */
|
||||
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read-only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
|
||||
#define EDOM 33 /* Numerical argument out of domain */
|
||||
#define ERANGE 34 /* Result too large */
|
||||
|
||||
/* non-blocking and interrupt i/o */
|
||||
#define EAGAIN 35 /* Resource temporarily unavailable */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
#define EINPROGRESS 36 /* Operation now in progress */
|
||||
#define EALREADY 37 /* Operation already in progress */
|
||||
|
||||
/* ipc/network software -- argument errors */
|
||||
#define ENOTSOCK 38 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 39 /* Destination address required */
|
||||
#define EMSGSIZE 40 /* Message too long */
|
||||
#define EPROTOTYPE 41 /* Protocol wrong type for socket */
|
||||
#define ENOPROTOOPT 42 /* Protocol not available */
|
||||
#define EPROTONOSUPPORT 43 /* Protocol not supported */
|
||||
#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
|
||||
#define EOPNOTSUPP 45 /* Operation not supported on socket */
|
||||
#define EPFNOSUPPORT 46 /* Protocol family not supported */
|
||||
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
|
||||
#define EADDRINUSE 48 /* Address already in use */
|
||||
#define EADDRNOTAVAIL 49 /* Can't assign requested address */
|
||||
|
||||
/* ipc/network software -- operational errors */
|
||||
#define ENETDOWN 50 /* Network is down */
|
||||
#define ENETUNREACH 51 /* Network is unreachable */
|
||||
#define ENETRESET 52 /* Network dropped connection on reset */
|
||||
#define ECONNABORTED 53 /* Software caused connection abort */
|
||||
#define ECONNRESET 54 /* Connection reset by peer */
|
||||
#define ENOBUFS 55 /* No buffer space available */
|
||||
#define EISCONN 56 /* Socket is already connected */
|
||||
#define ENOTCONN 57 /* Socket is not connected */
|
||||
#define ESHUTDOWN 58 /* Can't send after socket shutdown */
|
||||
#define ETOOMANYREFS 59 /* Too many references: can't splice */
|
||||
#define ETIMEDOUT 60 /* Connection timed out */
|
||||
#define ECONNREFUSED 61 /* Connection refused */
|
||||
|
||||
#define ELOOP 62 /* Too many levels of symbolic links */
|
||||
#define ENAMETOOLONG 63 /* File name too long */
|
||||
|
||||
#define EHOSTDOWN 64 /* Host is down */
|
||||
#define EHOSTUNREACH 65 /* No route to host */
|
||||
#define ENOTEMPTY 66 /* Directory not empty */
|
||||
|
||||
/* quotas & mush */
|
||||
#define EPROCLIM 67 /* Too many processes */
|
||||
#define EUSERS 68 /* Too many users */
|
||||
#define EDQUOT 69 /* Disc quota exceeded */
|
||||
|
||||
/* Network File System */
|
||||
#define ESTALE 70 /* Stale NFS file handle */
|
||||
#define EREMOTE 71 /* Too many levels of remote in path */
|
||||
#define EBADRPC 72 /* RPC struct is bad */
|
||||
#define ERPCMISMATCH 73 /* RPC version wrong */
|
||||
#define EPROGUNAVAIL 74 /* RPC prog. not avail */
|
||||
#define EPROGMISMATCH 75 /* Program version wrong */
|
||||
#define EPROCUNAVAIL 76 /* Bad procedure for program */
|
||||
|
||||
#define ENOLCK 77 /* No locks available */
|
||||
#define ENOSYS 78 /* Function not implemented */
|
||||
|
||||
#define EFTYPE 79 /* Inappropriate file type or format */
|
||||
|
||||
#define EAUTH 80 /* Authentication error. */
|
||||
|
||||
#define ENEEDAUTH 81 /* Need authenticator. */
|
||||
|
||||
#define EIDRM 82 /* Identifier removed. */
|
||||
|
||||
#define ENOMSG 83 /* No message of the desired type. */
|
||||
|
||||
#define EOVERFLOW 84 /* Value too large to be stored in data type. */
|
||||
|
||||
#define EILSEQ 85 /* Encoding error detected */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _ERRNO_H */
|
||||
122
library/include/fcntl.h
Normal file
122
library/include/fcntl.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* $Id: fcntl.h,v 1.1.1.1 2004-07-26 16:32:51 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _FCNTL_H
|
||||
#define _FCNTL_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define O_RDONLY 0
|
||||
#define O_WRONLY 1
|
||||
#define O_RDWR 2
|
||||
|
||||
#define O_APPEND (1<<2)
|
||||
#define O_CREAT (1<<3)
|
||||
#define O_EXCL (1<<4)
|
||||
#define O_TRUNC (1<<5)
|
||||
#define O_NONBLOCK (1<<6)
|
||||
#define O_SYNC (0)
|
||||
#define O_NOCTTY (0)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define F_DUPFD 0
|
||||
#define F_GETFD 1
|
||||
#define F_SETFD 2
|
||||
#define F_GETFL 3
|
||||
#define F_SETFL 4
|
||||
#define F_GETOWN 5
|
||||
#define F_SETOWN 6
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Advisory file segment locking data type -
|
||||
* information passed to system by user
|
||||
*/
|
||||
struct flock
|
||||
{
|
||||
short l_type; /* lock type: read/write, etc. */
|
||||
short l_whence; /* type of l_start */
|
||||
off_t l_start; /* starting offset */
|
||||
off_t l_len; /* len = 0 means until end of file */
|
||||
pid_t l_pid; /* lock owner */
|
||||
};
|
||||
|
||||
#define F_GETLK 100 /* get record locking information */
|
||||
#define F_SETLK 101 /* set record locking information */
|
||||
#define F_SETLKW 102 /* F_SETLK; wait if blocked */
|
||||
|
||||
#define F_RDLCK 1 /* shared or read lock */
|
||||
#define F_UNLCK 2 /* unlock */
|
||||
#define F_WRLCK 3 /* exclusive or write lock */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int open(const char *path_name, int open_flag, ... /* mode_t mode */ );
|
||||
extern int creat(const char * path_name, mode_t mode);
|
||||
extern int close(int file_descriptor);
|
||||
extern off_t lseek(int file_descriptor, off_t offset, int mode);
|
||||
extern ssize_t read(int file_descriptor, void * buffer, size_t num_bytes);
|
||||
extern ssize_t write(int file_descriptor, const void * buffer, size_t num_bytes);
|
||||
extern int fcntl(int file_descriptor, int cmd, ... /* int arg */ );
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _FCNTL_H */
|
||||
77
library/include/float.h
Normal file
77
library/include/float.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* $Id: float.h,v 1.1.1.1 2004-07-26 16:32:51 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _FLOAT_H
|
||||
#define _FLOAT_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define FLT_EPSILON 1.19209290E-07F
|
||||
#define FLT_DIG 6
|
||||
#define FLT_MANT_DIG 24
|
||||
#define FLT_MAX 3.40282347E+38F
|
||||
#define FLT_MAX_EXP 128
|
||||
#define FLT_MAX_10_EXP 38
|
||||
#define FLT_MIN 1.17549435E-38F
|
||||
#define FLT_MIN_EXP (-125)
|
||||
#define FLT_MIN_10_EXP (-37)
|
||||
#define FLT_RADIX 2
|
||||
#define FLT_ROUNDS 1
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define DBL_EPSILON 2.2204460492503131E-16
|
||||
#define DBL_DIG 15
|
||||
#define DBL_MANT_DIG 53
|
||||
#define DBL_MAX 1.7976931348623157E+308
|
||||
#define DBL_MAX_EXP 1024
|
||||
#define DBL_MAX_10_EXP 308
|
||||
#define DBL_MIN 2.2250738585072014E-308
|
||||
#define DBL_MIN_EXP (-1021)
|
||||
#define DBL_MIN_10_EXP (-307)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define LDBL_EPSILON 2.2204460492503131E-16L
|
||||
#define LDBL_DIG 15
|
||||
#define LDBL_MANT_DIG 53
|
||||
#define LDBL_MAX 1.7976931348623157E+308L
|
||||
#define LDBL_MAX_EXP 1024
|
||||
#define LDBL_MAX_10_EXP 308
|
||||
#define LDBL_MIN 2.2250738585072014E-308L
|
||||
#define LDBL_MIN_EXP (-1021)
|
||||
#define LDBL_MIN_10_EXP (-307)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _FLOAT_H */
|
||||
71
library/include/grp.h
Normal file
71
library/include/grp.h
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* $Id: grp.h,v 1.1.1.1 2004-07-26 16:32:52 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _GRP_H
|
||||
#define _GRP_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct group
|
||||
{
|
||||
char * gr_name; /* group name */
|
||||
char * gr_passwd; /* group password */
|
||||
gid_t gr_gid; /* group id */
|
||||
char ** gr_mem; /* group members */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _GRP_H */
|
||||
53
library/include/iso646.h
Normal file
53
library/include/iso646.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* $Id: iso646.h,v 1.1.1.1 2004-07-26 16:32:52 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _ISO646_H
|
||||
#define _ISO646_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _ISO646_H */
|
||||
60
library/include/libgen.h
Normal file
60
library/include/libgen.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* $Id: libgen.h,v 1.1.1.1 2004-07-26 16:32:52 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _LIBGEN_H
|
||||
#define _LIBGEN_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
char * basename(char *path);
|
||||
char * dirname(char *path);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _LIBGEN_H */
|
||||
65
library/include/limits.h
Normal file
65
library/include/limits.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* $Id: limits.h,v 1.1.1.1 2004-07-26 16:32:52 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _LIMITS_H
|
||||
#define _LIMITS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#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 SHRT_MIN -32768
|
||||
#define UCHAR_MAX 255
|
||||
#define UINT_MAX 4294967295UL
|
||||
#define ULONG_MAX 4294967295UL
|
||||
#define USHRT_MAX 65535
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define PATH_MAX 1024
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _LIMITS_H */
|
||||
115
library/include/locale.h
Normal file
115
library/include/locale.h
Normal file
@ -0,0 +1,115 @@
|
||||
/*
|
||||
* $Id: locale.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _LOCALE_H
|
||||
#define _LOCALE_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define LC_ALL 0 /* all behaviour */
|
||||
#define LC_COLLATE 1 /* behaviour of strcoll() and strxfrm() */
|
||||
#define LC_CTYPE 2 /* character handling */
|
||||
#define LC_MONETARY 3 /* monetary information returned by localeconv() */
|
||||
#define LC_NUMERIC 4 /* decimal point and non-monetary information
|
||||
returned by localeconv() */
|
||||
#define LC_TIME 5 /* behaviour of strftime() */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct lconv
|
||||
{
|
||||
char * decimal_point; /* Decimal point character (non-monetary). */
|
||||
char * thousands_sep; /* Non-monetary digit group separator
|
||||
character(s). */
|
||||
char * grouping; /* Non-monetary digit groupings. */
|
||||
char * int_curr_symbol; /* International currency symbol, followed
|
||||
by the character that separates it from
|
||||
the monetary quantity. */
|
||||
char * currency_symbol; /* The local currency symbol for the
|
||||
current locale. */
|
||||
char * mon_decimal_point; /* Decimal point character for monetary
|
||||
quantities. */
|
||||
char * mon_thousands_sep; /* Monetary digit group separator
|
||||
character(s). */
|
||||
char * mon_grouping; /* Monetary digit groupings. */
|
||||
char * positive_sign; /* Sign character(s) for non-negative
|
||||
monetary quantities. */
|
||||
char * negative_sign; /* Sign character(s) for negative
|
||||
monetary quantities. */
|
||||
char int_frac_digits; /* Digits shown right of the decimal
|
||||
point in international monetary
|
||||
format. */
|
||||
char frac_digits; /* Digits shown to the right of the decimal
|
||||
point in other monetary formats. */
|
||||
char p_cs_precedes; /* If currency symbol precedes non-negative
|
||||
monetary values this will be 1, otherwise
|
||||
it will be 0. */
|
||||
char p_sep_by_space; /* If currency symbol is separated from
|
||||
non-negative monetary values by a blank
|
||||
space this will be 1, otherwise it will
|
||||
be 0. */
|
||||
char n_cs_precedes; /* If currency symbol precedes negative
|
||||
monetary values this will be 1, otherwise
|
||||
it will be 0. */
|
||||
char n_sep_by_space; /* If currency symbol is separated from
|
||||
negative monetary values by a blank
|
||||
space this will be 1, otherwise it will
|
||||
be 0. */
|
||||
char p_sign_posn; /* Where to place the positive sign and the
|
||||
currency symbol for a non-negative monetary
|
||||
quantity. */
|
||||
char n_sign_posn; /* Where to place the negative sign and the
|
||||
currency symbol for a negative monetary
|
||||
quantity. */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char *setlocale(int category, const char *locale);
|
||||
extern struct lconv *localeconv(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _LOCALE_H */
|
||||
90
library/include/math.h
Normal file
90
library/include/math.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* $Id: math.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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_H
|
||||
#define _MATH_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif /* _STDLIB_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double __huge_val;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define HUGE_VAL ((const double)__huge_val)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double acos(double x);
|
||||
extern double asin(double x);
|
||||
extern double atan(double x);
|
||||
extern double atan2(double y,double x);
|
||||
extern double ceil(double x);
|
||||
extern double cos(double x);
|
||||
extern double cosh(double x);
|
||||
extern double exp(double x);
|
||||
extern double fabs(double x);
|
||||
extern double floor(double x);
|
||||
extern double fmod(double x,double y);
|
||||
extern double frexp(double x,int *nptr);
|
||||
extern double ldexp(double x,int n);
|
||||
extern double log(double x);
|
||||
extern double log10(double x);
|
||||
extern double modf(double x,double *nptr);
|
||||
extern double pow(double x,double y);
|
||||
extern double sin(double x);
|
||||
extern double sinh(double x);
|
||||
extern double sqrt(double x);
|
||||
extern double tan(double x);
|
||||
extern double tanh(double x);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _MATH_H */
|
||||
74
library/include/pwd.h
Normal file
74
library/include/pwd.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* $Id: pwd.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _PWD_H
|
||||
#define _PWD_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct passwd
|
||||
{
|
||||
char * pw_name; /* Username */
|
||||
char * pw_passwd; /* Encrypted password */
|
||||
uid_t pw_uid; /* User ID */
|
||||
gid_t pw_gid; /* Group ID */
|
||||
char * pw_gecos; /* Real name etc */
|
||||
char * pw_dir; /* Home directory */
|
||||
char * pw_shell; /* Shell */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _PWD_H */
|
||||
85
library/include/setjmp.h
Normal file
85
library/include/setjmp.h
Normal file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
* $Id: setjmp.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _SETJMP_H
|
||||
#define _SETJMP_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef __PPC__
|
||||
|
||||
struct __jmp_buf
|
||||
{
|
||||
void * jb_ReturnAddress;
|
||||
long jb_D[7];
|
||||
void * jb_A[8];
|
||||
long jb_F[8 * 3];
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
struct __jmp_buf
|
||||
{
|
||||
void * jb_ReturnAddress;
|
||||
unsigned long jb_CondCode;
|
||||
void * jb_StackPointer;
|
||||
unsigned long jb_GPR[19];
|
||||
double jb_FPR[18];
|
||||
};
|
||||
|
||||
#endif /* __PPC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef struct __jmp_buf jmp_buf[1];
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int setjmp(jmp_buf env);
|
||||
extern void longjmp(jmp_buf env,int status);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SETJMP_H */
|
||||
105
library/include/signal.h
Normal file
105
library/include/signal.h
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* $Id: signal.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _SIGNAL_H
|
||||
#define _SIGNAL_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define SIG_IGN ((void (*)(int))0)
|
||||
#define SIG_DFL ((void (*)(int))1)
|
||||
#define SIG_ERR ((void (*)(int))-1)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define SIGABRT 1
|
||||
#define SIGFPE 2
|
||||
#define SIGILL 3
|
||||
#define SIGINT 4
|
||||
#define SIGSEGV 5
|
||||
#define SIGTERM 6
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void (*signal(int sig, void (*)(int)))(int);
|
||||
extern int raise(int sig);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef int sig_atomic_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef int sigset_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define SIG_BLOCK 0
|
||||
#define SIG_UNBLOCK 1
|
||||
#define SIG_SETMASK 2
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int sigmask(int signum);
|
||||
extern int sigblock(int signal_mask);
|
||||
extern int sigsetmask(int signal_mask);
|
||||
extern int sigprocmask(int how, const sigset_t *set, sigset_t *oset);
|
||||
extern int sigemptyset(sigset_t * set);
|
||||
extern int sigaddset(sigset_t * set,int sig);
|
||||
extern int kill(pid_t pid, int signal_number);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SIGNAL_H */
|
||||
76
library/include/stdarg.h
Normal file
76
library/include/stdarg.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* $Id: stdarg.h,v 1.1.1.1 2004-07-26 16:32:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STDARG_H
|
||||
#define _STDARG_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef __amigaos4__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef char * va_list;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define va_start(ap, last) ((void)(ap = (va_list)&(last) + sizeof(last)))
|
||||
#define va_arg(ap, type) ((type *)(ap += sizeof(type)))[-1]
|
||||
#define va_end(ap) ((void)0)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#undef _STDARG_H
|
||||
#include_next "stdarg.h"
|
||||
#else
|
||||
#error "Unknown compiler"
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __amigaos4__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDARG_H */
|
||||
71
library/include/stddef.h
Normal file
71
library/include/stddef.h
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* $Id: stddef.h,v 1.1.1.1 2004-07-26 16:32:54 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STDDEF_H
|
||||
#define _STDDEF_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef NULL
|
||||
#ifndef __cplusplus
|
||||
#define NULL ((void *)0L)
|
||||
#else
|
||||
#define NULL 0L
|
||||
#endif /* __cplusplus */
|
||||
#endif /* NULL */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef long int ptrdiff_t;
|
||||
typedef unsigned int size_t;
|
||||
typedef unsigned int wchar_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define offsetof(type, member) ((size_t)&((type *)0)->member)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDDEF_H */
|
||||
347
library/include/stdio.h
Normal file
347
library/include/stdio.h
Normal file
@ -0,0 +1,347 @@
|
||||
/*
|
||||
* $Id: stdio.h,v 1.1.1.1 2004-07-26 16:32:54 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STDIO_H
|
||||
#define _STDIO_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif /* _STDARG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* 'End of file' indicator returned by, for example, fgetc() */
|
||||
#define EOF (-1)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Maximum number of files that can be open at a time. This number does not
|
||||
* correspond to a real limitation for this 'C' runtime library and is
|
||||
* included solely for ISO 'C' (1994) compliance.
|
||||
*/
|
||||
#define FOPEN_MAX 8
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Maximum size of a file/path name. */
|
||||
#define FILENAME_MAX 256
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Default size for all standard I/O file buffers. */
|
||||
#define BUFSIZ 8192
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* File buffering modes for use with setvbuf() */
|
||||
|
||||
#define _IOFBF 0 /* Full buffering (flush when buffer is full) */
|
||||
|
||||
#define _IOLBF 1 /* Line buffering (flush when buffer is full or when
|
||||
a line feed character is written) */
|
||||
|
||||
#define _IONBF 2 /* Perform no buffering at all */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Positioning modes for use with fseek() */
|
||||
|
||||
#define SEEK_SET 0 /* New position is absolute */
|
||||
#define SEEK_CUR 1 /* New position is relative to current file position */
|
||||
#define SEEK_END 2 /* New position is relative to end of file */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Used by fgetpos() and fsetpos() */
|
||||
|
||||
#if defined(__GNUC__)
|
||||
typedef long long fpos_t;
|
||||
#else
|
||||
typedef long fpos_t;
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* This is part of the internal 'FILE' structure; this is guaranteed not to
|
||||
* change in future library releases. However, the private portion of this
|
||||
* data structure may change.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned long flags; /* See below for some of the public
|
||||
flag bits defined; this is by no
|
||||
means a complete list, though! */
|
||||
unsigned char * buffer; /* Points to the first byte of the
|
||||
buffer; this could be NULL! */
|
||||
long size; /* How many bytes will fit into the
|
||||
buffer; this could be 0! */
|
||||
long position; /* Current buffer position, which is
|
||||
usually a number between 0 and
|
||||
size-1 */
|
||||
long num_read_bytes; /* How many bytes can be read from
|
||||
the buffer; this can be 0! */
|
||||
long num_write_bytes; /* How many bytes have been copied
|
||||
to the buffer which have not been
|
||||
written back yet; this can be 0! */
|
||||
|
||||
/* Private fields follow... */
|
||||
} FILE;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Field and flag definitions for the getc/putc macros below. */
|
||||
#define __FILE_BUFFER_MASK 3 /* Masks off the buffering mode */
|
||||
#define __FILE_EOF (1<<2) /* EOF reached */
|
||||
#define __FILE_READABLE (1<<3) /* File is readable */
|
||||
#define __FILE_WRITABLE (1<<4) /* File is writable */
|
||||
#define __FILE_IN_USE (1<<5) /* File is in use */
|
||||
#define __FILE_ERROR (1<<6) /* Error detected */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Maximum file name buffer size for use with tmpfile() and tmpnam();
|
||||
* note that the maximum file name length is shorter by one character
|
||||
*/
|
||||
#define L_tmpnam 10
|
||||
|
||||
/* Maximum number of unique file names tmpnam() can generate */
|
||||
#define TMP_MAX 0x3ffff
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Anchor for the buffered standard I/O streams */
|
||||
extern struct iob ** __iob;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The three standard I/O streams */
|
||||
#define stdin ((FILE *)__iob[0])
|
||||
#define stdout ((FILE *)__iob[1])
|
||||
#define stderr ((FILE *)__iob[2])
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void perror(const char * s);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern FILE *fopen(const char *filename, const char *mode);
|
||||
extern int fclose(FILE *stream);
|
||||
extern int fflush(FILE *stream);
|
||||
extern FILE *freopen(const char *filename, const char *mode, FILE *stream);
|
||||
extern int setvbuf(FILE *stream,char *buf,int bufmode,size_t size);
|
||||
extern void setbuf(FILE *stream, char *buf);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fseek(FILE *stream, long int offset, int wherefrom);
|
||||
extern long int ftell(FILE *stream);
|
||||
extern void rewind(FILE *stream);
|
||||
extern int fgetpos(FILE *stream, fpos_t *pos);
|
||||
extern int fsetpos(FILE *stream, fpos_t *pos);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fgetc(FILE *stream);
|
||||
extern int getc(FILE *stream);
|
||||
extern int getchar(void);
|
||||
extern int ungetc(int c,FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fputc(int c,FILE *stream);
|
||||
extern int putc(int c,FILE *stream);
|
||||
extern int putchar(int c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char *fgets(char *s,int n,FILE *stream);
|
||||
extern char *gets(char *s);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fscanf(FILE *stream, const char *format, ...);
|
||||
extern int scanf(const char *format, ...);
|
||||
extern int sscanf(const char *s,const char *format, ...);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fputs(const char *s, FILE *stream);
|
||||
extern int puts(const char *s);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fprintf(FILE *stream,const char *format,...);
|
||||
extern int printf(const char *format, ...);
|
||||
extern int sprintf(char *s, const char *format, ...);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int vfprintf(FILE *stream,const char *format,va_list arg);
|
||||
extern int vprintf(const char *format,va_list arg);
|
||||
extern int vsprintf(char *s, const char *format,va_list arg);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern size_t fread(void *ptr,size_t element_size,size_t count,FILE *stream);
|
||||
extern size_t fwrite(const void *ptr,size_t element_size,size_t count,FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int feof(FILE *stream);
|
||||
extern int ferror(FILE *stream);
|
||||
extern void clearerr(FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int rename(const char *oldname,const char *newname);
|
||||
extern int remove(const char *filename);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern FILE *tmpfile(void);
|
||||
extern char *tmpnam(char *buf);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* A special buffer flush routine which returns the last character written
|
||||
* in case of success and EOF in case of failure. This is used by the
|
||||
* putc() macro defined below.
|
||||
*/
|
||||
extern int __flush(FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* fgetc() implemented as a "simple" macro; note that fgetc() does much more than
|
||||
* can be conveniently expressed as a macro!
|
||||
*/
|
||||
#define getc(f) \
|
||||
(((((FILE *)(f))->flags & (__FILE_IN_USE|__FILE_READABLE|__FILE_EOF)) == (__FILE_IN_USE|__FILE_READABLE) && \
|
||||
(((FILE *)(f))->flags & __FILE_BUFFER_MASK) != _IONBF && \
|
||||
((FILE *)(f))->position < ((FILE *)(f))->num_read_bytes) ? \
|
||||
((FILE *)(f))->buffer[((FILE *)(f))->position++] : \
|
||||
fgetc(f))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* fputc() implemented as a "simple" macro; note that fputc() does much more than
|
||||
* can be conveniently expressed as a macro!
|
||||
*/
|
||||
#define putc(c,f) \
|
||||
(((((FILE *)(f))->flags & (__FILE_IN_USE|__FILE_WRITABLE)) == (__FILE_IN_USE|__FILE_WRITABLE) && \
|
||||
(((FILE *)(f))->flags & __FILE_BUFFER_MASK) != _IONBF && \
|
||||
(((FILE *)(f))->num_write_bytes < ((FILE *)(f))->size)) ? \
|
||||
(((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes++] = (c), \
|
||||
(((((FILE *)(f))->flags & __FILE_BUFFER_MASK) == _IOLBF && \
|
||||
((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes-1] == '\n') ? \
|
||||
__flush(f) : \
|
||||
(((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes-1]))) : \
|
||||
fputc((c),(f)))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* If requested, reimplement some of the file I/O routines as macros.
|
||||
*/
|
||||
|
||||
#ifdef __C_MACROS__
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define getchar() getc(stdin)
|
||||
#define putchar(c) putc((c),stdout)
|
||||
#define clearerr(file) ((void)((file)->flags &= ~(__FILE_EOF|__FILE_ERROR)))
|
||||
#define feof(file) (((file)->flags & __FILE_EOF) != 0)
|
||||
#define ferror(file) (((file)->flags & __FILE_ERROR) != 0)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* __C_MACROS__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MAXPATHLEN (4 * FILENAME_MAX)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern FILE * fdopen(int file_descriptor, const char * type);
|
||||
extern int fileno(FILE * file);
|
||||
extern int asprintf(char **ret, const char *format, ...);
|
||||
extern int snprintf(char *s,size_t size,const char *format,...);
|
||||
extern int vsnprintf(char *s,size_t size,const char *format,va_list arg);
|
||||
extern int pclose(FILE *stream);
|
||||
extern FILE * popen(const char *command, const char *type);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int vasprintf(char **ret,const char *format,va_list arg);
|
||||
|
||||
/* This is the version for use with memory debugging; do not call
|
||||
it directly! */
|
||||
extern int __vasprintf(const char *file,int line,char **ret,const char *format,va_list arg);
|
||||
|
||||
#ifdef __MEM_DEBUG
|
||||
#define vasprintf(ret,format,arg) __vasprintf(__FILE__,__LINE__,(ret),(format),(arg))
|
||||
#endif /* __MEM_DEBUG */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDIO_H */
|
||||
185
library/include/stdlib.h
Normal file
185
library/include/stdlib.h
Normal file
@ -0,0 +1,185 @@
|
||||
/*
|
||||
* $Id: stdlib.h,v 1.1.1.1 2004-07-26 16:32:55 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STDLIB_H
|
||||
#define _STDLIB_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Maximum number of bytes in a multibyte character */
|
||||
#define MB_CUR_MAX 4
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The maximum value that can be returned by the rand() function */
|
||||
#define RAND_MAX 2147483647
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Return values to be passed to exit() */
|
||||
#define EXIT_FAILURE 20
|
||||
#define EXIT_SUCCESS 0
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Data structures used by the div() and ldiv() functions */
|
||||
typedef struct { int quot; int rem; } div_t;
|
||||
typedef struct { long quot; long rem; } ldiv_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int mblen(const char *s, size_t n);
|
||||
extern int mbtowc(wchar_t *pwc, const char *s, size_t n);
|
||||
extern int wctomb(char *s, wchar_t wchar);
|
||||
extern size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n);
|
||||
extern size_t wcstombs(char *s, const wchar_t *pwcs, size_t n);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void *malloc(size_t size);
|
||||
extern void *calloc(size_t num_elements,size_t element_size);
|
||||
extern void free(void *ptr);
|
||||
extern void *realloc(void *ptr,size_t size);
|
||||
|
||||
/* This are the versions for use with memory debugging; do not call
|
||||
them directly! */
|
||||
extern void *__malloc(size_t size,const char *file,int line);
|
||||
extern void *__calloc(size_t num_elements,size_t element_size,const char *file,int line);
|
||||
extern void __free(void *ptr,const char *file,int line);
|
||||
extern void *__realloc(void *ptr,size_t size,const char *file,int line);
|
||||
|
||||
#ifdef __MEM_DEBUG
|
||||
#define malloc(size) __malloc((size),__FILE__,__LINE__)
|
||||
#define calloc(num_elements,element_size) __calloc((num_elements),(element_size),__FILE__,__LINE__)
|
||||
#define free(ptr) __free((ptr),__FILE__,__LINE__)
|
||||
#define realloc(ptr,size) __realloc((ptr),(size),__FILE__,__LINE__)
|
||||
#endif /* __MEM_DEBUG */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int abs(int x);
|
||||
extern long labs(long x);
|
||||
extern div_t div(int n,int d);
|
||||
extern ldiv_t ldiv(long n,long d);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int rand(void);
|
||||
extern void srand(unsigned seed);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int system(const char *command);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void exit(int status);
|
||||
extern void abort(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int atexit(void (*)(void));
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char * getenv(const char *name);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void * bsearch(const void *key, const void *base, size_t count, size_t size,
|
||||
int (*compare)(const void * key,const void * value));
|
||||
extern void qsort(void *base,size_t count,size_t size,
|
||||
int (*compare)(const void * element1,const void * element2));
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double strtod(const char *str, char ** ptr);
|
||||
extern long strtol(const char *str, char **ptr, int base);
|
||||
extern unsigned long strtoul(const char *str, char **ptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double atof(const char *str);
|
||||
extern int atoi(const char *str);
|
||||
extern long atol(const char *str);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#if defined(alloca)
|
||||
#undef alloca
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
#endif /* alloca */
|
||||
#else
|
||||
extern void * alloca(size_t size);
|
||||
extern void * __alloca(size_t size,const char *file,int line);
|
||||
|
||||
#ifdef __MEM_DEBUG
|
||||
#define alloca(size) __alloca((size),__FILE__,__LINE__)
|
||||
#endif /* __MEM_DEBUG */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int setenv(const char *name, const char *value, int overwrite);
|
||||
extern int putenv(const char *string);
|
||||
extern void unsetenv(const char *name);
|
||||
extern char * mktemp(char * name_template);
|
||||
extern int mkstemp(char *name_template);
|
||||
extern char * mkdtemp(char *name_template);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STDLIB_H */
|
||||
121
library/include/string.h
Normal file
121
library/include/string.h
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* $Id: string.h,v 1.1.1.1 2004-07-26 16:32:55 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STRING_H
|
||||
#define _STRING_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char *strerror(int error_number);
|
||||
extern char *strcat(char *dest, const char *src);
|
||||
extern char *strncat(char *dest, const char *src, size_t n);
|
||||
extern int strcmp(const char *s1, const char * s2);
|
||||
extern int strncmp(const char *s1, const char *s2, size_t n);
|
||||
extern char *strcpy(char *dest, const char *src);
|
||||
extern char *strncpy(char *dest, const char *src, size_t n);
|
||||
extern size_t strlen(const char *s);
|
||||
extern char *strchr(const char *s, int c);
|
||||
extern char *strrchr(const char *s, int c);
|
||||
extern size_t strspn(const char *s, const char *set);
|
||||
extern size_t strcspn(const char *s, const char *set);
|
||||
extern char *strpbrk(const char *s, const char *set);
|
||||
extern char *strtok(char *str, const char *set);
|
||||
extern char *strstr(const char *src, const char *sub);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int strcoll(const char *s1, const char *s2);
|
||||
extern size_t strxfrm(char *dest, const char *src, size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void *memchr(const void * ptr, int val, size_t len);
|
||||
extern int memcmp(const void *ptr1, const void *ptr2, size_t len);
|
||||
extern void *memcpy(void *dest, const void *src, size_t len);
|
||||
extern void *memmove(void *dest, const void * src, size_t len);
|
||||
extern void *memset(void *ptr, int val, size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif /* _STRINGS_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char * index(const char *s, int c);
|
||||
extern char * rindex(const char *s, int c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char * strdup(const char *s);
|
||||
|
||||
/* This is the version for use with memory debugging; do not call
|
||||
it directly! */
|
||||
extern char * __strdup(const char *s,const char *file,int line);
|
||||
|
||||
#ifdef __MEM_DEBUG
|
||||
#define strdup(s) __strdup((s),__FILE__,__LINE__)
|
||||
#endif /* __MEM_DEBUG */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern void bcopy(const void *from,void *to,size_t len);
|
||||
extern void bzero(void *m,size_t len);
|
||||
extern int bcmp(const void *a,const void *b,size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STRING_H */
|
||||
77
library/include/strings.h
Normal file
77
library/include/strings.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* $Id: strings.h,v 1.1.1.1 2004-07-26 16:32:55 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _STRINGS_H
|
||||
#define _STRINGS_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* These two come from 4.4BSD. */
|
||||
extern int strcasecmp(const char *s1, const char *s2);
|
||||
extern int strncasecmp(const char *s1, const char *s2, size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* These two provide functions which are available with the Lattice and
|
||||
* SAS/C compiler runtime libraries. Which probably makes them more exotic
|
||||
* than XENIX.
|
||||
*/
|
||||
#define stricmp(s1, s2) strcasecmp((s1), (s2))
|
||||
#define strnicmp(s1, s2, len) strncasecmp((s1), (s2), (len))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _STRINGS_H */
|
||||
81
library/include/sys/amigaos-va.h
Normal file
81
library/include/sys/amigaos-va.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* $Id: amigaos-va.h,v 1.1.1.1 2004-07-26 16:32:57 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_AMIGAOS_VA_H
|
||||
#define _SYS_AMIGAOS_VA_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif /* _STDARG_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Define the AmigaOS specific varargs macros,
|
||||
if <stdarg.h> didn't already define them. */
|
||||
|
||||
#ifndef va_startlinear
|
||||
#define va_startlinear(AP,ARG) \
|
||||
va_start(AP,ARG)
|
||||
#endif
|
||||
|
||||
#ifndef va_getlinearva
|
||||
#if defined(__GNUC__) && defined(__PPC__)
|
||||
#define va_getlinearva(AP,TYPE) \
|
||||
((TYPE)__builtin_getlinearva(AP))
|
||||
#else
|
||||
#define va_getlinearva(AP,TYPE) \
|
||||
((TYPE)(void *)(AP))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_AMIGAOS_VA_H */
|
||||
121
library/include/sys/mount.h
Normal file
121
library/include/sys/mount.h
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* $Id: mount.h,v 1.1.1.1 2004-07-26 16:32:58 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_MOUNT_H
|
||||
#define _SYS_MOUNT_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef struct { long val[2]; } fsid_t; /* file system id type */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MFSNAMELEN 16 /* length of fs type name, including nul */
|
||||
#define MNAMELEN 90 /* length of buffer for returned name */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct statfs
|
||||
{
|
||||
long f_bsize; /* fundamental file system block size */
|
||||
long f_iosize; /* optimal transfer block size */
|
||||
long f_blocks; /* total data blocks in file system */
|
||||
long f_bfree; /* free blocks in fs */
|
||||
long f_bavail; /* free blocks avail to non-superuser */
|
||||
long f_files; /* total file nodes in file system */
|
||||
long f_ffree; /* free file nodes in fs */
|
||||
fsid_t f_fsid; /* file system id */
|
||||
uid_t f_owner; /* user that mounted the file system */
|
||||
long f_flags; /* copy of mount flags */
|
||||
long f_syncwrites; /* count of sync writes since mount */
|
||||
long f_asyncwrites; /* count of async writes since mount */
|
||||
char f_fstypename[MFSNAMELEN]; /* fs type name */
|
||||
char f_mntonname[MNAMELEN]; /* directory on which mounted */
|
||||
char f_mntfromname[MNAMELEN]; /* mounted file system */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define MNT_RDONLY (1<<0) /* The filesystem is mounted read-only */
|
||||
#define MNT_NOEXEC 0
|
||||
#define MNT_NOSUID 0
|
||||
#define MNT_NODEV 0
|
||||
#define MNT_SYNCHRONOUS 0
|
||||
#define MNT_ASYNC 0
|
||||
#define MNT_UNION 0
|
||||
#define MNT_NOCOREDUMP 0
|
||||
#define MNT_NOATIME (1<<1) /* Never update access times */
|
||||
#define MNT_SYMPERM (1<<2) /* Recognize symbolic link permission */
|
||||
#define MNT_NODEVMTIME 0
|
||||
#define MNT_SOFTDEP 0
|
||||
#define MNT_LOCAL (1<<3) /* The filesystem resides locally */
|
||||
#define MNT_QUOTA 0
|
||||
#define MNT_ROOTFS 0
|
||||
#define MNT_EXRDONLY 0
|
||||
#define MNT_EXPORTED 0
|
||||
#define MNT_DEFEXPORTED 0
|
||||
#define MNT_EXPORTANON 0
|
||||
#define MNT_EXKERB 0
|
||||
#define MNT_EXNORESPORT 0
|
||||
#define MNT_EXPUBLIC 0
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int statfs(const char *path, struct statfs *buf);
|
||||
int fstatfs(int fd, struct statfs *buf);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_MOUNT_H */
|
||||
135
library/include/sys/stat.h
Normal file
135
library/include/sys/stat.h
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* $Id: stat.h,v 1.1.1.1 2004-07-26 16:32:58 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_STAT_H
|
||||
#define _SYS_STAT_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
#ifndef _TIME_H
|
||||
#include <time.h>
|
||||
#endif /* _TIME_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define S_ISUID 0004000 /* set user id on execution */
|
||||
#define S_ISGID 0002000 /* set group id on execution */
|
||||
#define S_ISVTX 0001000 /* save swapped text even after use */
|
||||
|
||||
#define S_IRWXU 0000700 /* RWX mask for owner */
|
||||
#define S_IRUSR 0000400 /* R for owner */
|
||||
#define S_IWUSR 0000200 /* W for owner */
|
||||
#define S_IXUSR 0000100 /* X for owner */
|
||||
|
||||
#define S_IRWXG 0000070 /* RWX mask for group */
|
||||
#define S_IRGRP 0000040 /* R for group */
|
||||
#define S_IWGRP 0000020 /* W for group */
|
||||
#define S_IXGRP 0000010 /* X for group */
|
||||
|
||||
#define S_IRWXO 0000007 /* RWX mask for other */
|
||||
#define S_IROTH 0000004 /* R for other */
|
||||
#define S_IWOTH 0000002 /* W for other */
|
||||
#define S_IXOTH 0000001 /* X for other */
|
||||
|
||||
#define S_IFMT 0170000 /* type of file */
|
||||
#define S_IFIFO 0010000 /* named pipe (fifo) */
|
||||
#define S_IFDIR 0040000 /* directory */
|
||||
#define S_IFBLK 0060000 /* block special */
|
||||
#define S_IFREG 0100000 /* regular */
|
||||
#define S_IFLNK 0120000 /* symbolic link */
|
||||
#define S_IFSOCK 0140000 /* socket */
|
||||
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* directory */
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* regular file */
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* symbolic link */
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* fifo */
|
||||
#define S_ISBLK(m) (0) /* block special */
|
||||
#define S_ISCHR(m) (0) /* character special */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct stat
|
||||
{
|
||||
mode_t st_mode;
|
||||
ino_t st_ino;
|
||||
dev_t st_dev;
|
||||
dev_t st_rdev;
|
||||
nlink_t st_nlink;
|
||||
uid_t st_uid;
|
||||
gid_t st_gid;
|
||||
off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
long st_blksize;
|
||||
long st_blocks;
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int stat(const char * path_name, struct stat * buffer);
|
||||
extern int fstat(int file_descriptor, struct stat * buffer);
|
||||
extern int lstat(const char * path_name, struct stat * buffer);
|
||||
extern int chmod(const char * path_name, mode_t mode);
|
||||
extern int fchmod(int file_descriptor, mode_t mode);
|
||||
extern int mkdir(const char * path_name, mode_t mode);
|
||||
extern int rmdir(const char * path_name);
|
||||
extern mode_t umask(mode_t new_mask);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_STAT_H */
|
||||
133
library/include/sys/time.h
Normal file
133
library/include/sys/time.h
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* $Id: time.h,v 1.1.1.1 2004-07-26 16:32:58 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIME_H
|
||||
#define _SYS_TIME_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* This is a tough one. Some code takes a bad turn if the <exec/types.h>
|
||||
header file is pulled in, which rules out that the structure definitions
|
||||
in <devices/timer.h> are used. We are only interested in the timeval
|
||||
structure and try to get by with this definition. Sometimes it works,
|
||||
sometimes it doesn't. Not sure if there really is a good solution for
|
||||
this problem... */
|
||||
#ifndef DEVICES_TIMER_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The V40 header files (OS 3.x) and below will always define the
|
||||
'struct timeval' in <devices/timer.h>. But the V50 header
|
||||
files and beyond will not define 'struct timeval' if it is
|
||||
included from here. We start by checking which header files
|
||||
are being used. */
|
||||
#ifndef EXEC_TYPES_H
|
||||
#include <exec/types.h>
|
||||
#endif /* EXEC_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Which header file version is being used? */
|
||||
#if INCLUDE_VERSION < 50
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* This will define the 'struct timeval' */
|
||||
#include <devices/timer.h>
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#else
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* We will have to make our own... */
|
||||
struct timeval
|
||||
{
|
||||
unsigned long tv_secs;
|
||||
unsigned long tv_micro;
|
||||
};
|
||||
|
||||
/* Make sure that the 'struct timeval' is not redefined, should
|
||||
<devices/timer.h> get included again. */
|
||||
#define __TIMEVAL_ALREADY_DEFINED
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* INCLUDE_VERSION */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* DEVICES_TIMER_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef tv_sec
|
||||
#define tv_sec tv_secs
|
||||
#endif /* tv_sec */
|
||||
|
||||
#ifndef tv_usec
|
||||
#define tv_usec tv_micro
|
||||
#endif /* tv_usec */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct timezone
|
||||
{
|
||||
int tz_minuteswest; /* of Greenwich */
|
||||
int tz_dsttime; /* type of dst correction to apply */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
int gettimeofday(struct timeval *tp, struct timezone *tzp);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_TIME_H */
|
||||
70
library/include/sys/types.h
Normal file
70
library/include/sys/types.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* $Id: types.h,v 1.1.1.1 2004-07-26 16:32:59 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Neither the name of Olaf Barthel nor the names of contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#define _SYS_TYPES_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef char * caddr_t;
|
||||
typedef unsigned int comp_t;
|
||||
typedef unsigned long dev_t;
|
||||
typedef unsigned int gid_t;
|
||||
typedef unsigned int ino_t;
|
||||
typedef unsigned int mode_t;
|
||||
typedef unsigned int nlink_t;
|
||||
typedef int off_t;
|
||||
typedef int pid_t;
|
||||
typedef unsigned int rlim_t;
|
||||
typedef int ssize_t;
|
||||
typedef unsigned int uid_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _SYS_TYPES_H */
|
||||
104
library/include/time.h
Normal file
104
library/include/time.h
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* $Id: time.h,v 1.1.1.1 2004-07-26 16:32:56 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _TIME_H
|
||||
#define _TIME_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Divide the number returned by clock() by CLOCKS_PER_SEC to obtain
|
||||
* the elapsed time in seconds
|
||||
*/
|
||||
#define CLOCKS_PER_SEC 50
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef unsigned long clock_t;
|
||||
typedef unsigned long time_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct tm
|
||||
{
|
||||
int tm_sec; /* Number of seconds past the minute (0..59) */
|
||||
int tm_min; /* Number of minutes past the hour (0..59) */
|
||||
int tm_hour; /* Number of hours past the day (0..23) */
|
||||
int tm_mday; /* Day of the month (1..31) */
|
||||
int tm_mon; /* Month number (0..11) */
|
||||
int tm_year; /* Year number minus 1900 */
|
||||
int tm_wday; /* Day of the week (0..6; 0 is Sunday) */
|
||||
int tm_yday; /* Day of the year (0..365) */
|
||||
int tm_isdst; /* Is this date using daylight savings time? */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern clock_t clock(void);
|
||||
extern time_t time(time_t * t);
|
||||
extern char *asctime(const struct tm *tm);
|
||||
extern char *ctime(const time_t *t);
|
||||
extern struct tm *gmtime(const time_t *t);
|
||||
extern struct tm *localtime(const time_t *t);
|
||||
extern time_t mktime(struct tm *tm);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double difftime(time_t t1,time_t t0);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern size_t strftime(char *s, size_t maxsize, const char *format,
|
||||
const struct tm *tm);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _TIME_H */
|
||||
275
library/include/unistd.h
Normal file
275
library/include/unistd.h
Normal file
@ -0,0 +1,275 @@
|
||||
/*
|
||||
* $Id: unistd.h,v 1.1.1.1 2004-07-26 16:32:56 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _UNISTD_H
|
||||
#define _UNISTD_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* _FCNTL_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define R_OK 0
|
||||
#define W_OK 1
|
||||
#define X_OK 2
|
||||
#define F_OK 4
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int opterr;
|
||||
extern int optind;
|
||||
extern int optopt;
|
||||
extern char * optarg;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int isatty(int file_descriptor);
|
||||
extern int dup(int file_descriptor);
|
||||
extern int dup2(int file_descriptor1, int file_descriptor2);
|
||||
extern int access(const char * path_name, int mode);
|
||||
extern int chown(const char * path_name, uid_t owner, gid_t group);
|
||||
extern int fchown(int file_descriptor, uid_t owner, gid_t group);
|
||||
extern int lchown(const char * path_name, uid_t owner, gid_t group);
|
||||
extern int truncate(const char * path_name, off_t length);
|
||||
extern int ftruncate(int file_descriptor, off_t length);
|
||||
extern int link(const char * existing_path,const char * new_path);
|
||||
extern int unlink(const char * path_name);
|
||||
extern int symlink(const char * actual_path, const char * symbolic_path);
|
||||
extern int readlink(const char * path_name, char * buffer, int buffer_size);
|
||||
extern int chdir(const char * path_name);
|
||||
extern unsigned int sleep(unsigned int seconds);
|
||||
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 char * getcwd(char * buffer, size_t buffer_size);
|
||||
|
||||
/* This is the version for use with memory debugging; do not call
|
||||
it directly! */
|
||||
extern char * __getcwd(char * buffer,size_t buffer_size,const char *file,int line);
|
||||
|
||||
#ifdef __MEM_DEBUG
|
||||
#define getcwd(buffer,buffer_size) __getcwd((buffer),(buffer_size),__FILE__,__LINE__)
|
||||
#endif /* __MEM_DEBUG */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* The following may have been predefined by local TCP/IP header files. We
|
||||
* don't want to be any trouble...
|
||||
*/
|
||||
|
||||
#if !defined(FD_SET) && !defined(__NO_NET_API)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STRING_H
|
||||
#include <string.h>
|
||||
#endif /* _STRING_H */
|
||||
|
||||
#ifndef _STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif /* _STDLIB_H */
|
||||
|
||||
#ifndef _SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif /* _SYS_TIME_H */
|
||||
|
||||
#ifndef _SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* _SYS_TYPES_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* select() uses bit masks of file descriptors in longs. These macros
|
||||
* manipulate such bit fields.
|
||||
*
|
||||
* FD_SETSIZE may be defined by the user, but the default here should
|
||||
* be enough for most uses.
|
||||
*/
|
||||
#ifndef FD_SETSIZE
|
||||
#define FD_SETSIZE 256
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long bits[(FD_SETSIZE + 31) / 32];
|
||||
} fd_set;
|
||||
|
||||
#define FD_SET(n,p) ((void)((p)->bits[((unsigned long)n) >> 5] |= (1UL << (((unsigned long)n) & 31))))
|
||||
#define FD_CLR(n,p) ((void)((p)->bits[((unsigned long)n) >> 5] &= ~(1UL << (((unsigned long)n) & 31))))
|
||||
#define FD_ISSET(n,p) (((p)->bits[((unsigned long)n) >> 5] & (1UL << (((unsigned long)n) & 31))) != 0)
|
||||
#define FD_COPY(f,t) ((void)memmove(t,f,sizeof(*(f))))
|
||||
#define FD_ZERO(p) ((void)memset(p,0,sizeof(*(p))))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Forward declarations for below... */
|
||||
struct hostent;
|
||||
struct netent;
|
||||
struct protoent;
|
||||
struct servent;
|
||||
struct passwd;
|
||||
struct msghdr;
|
||||
struct sockaddr;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* You might want to have <netinet/in.h> included in place of
|
||||
* this local definition.
|
||||
*/
|
||||
#if defined(__USE_NETINET_IN_H)
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* These two symbols are typically defined by <netinet/in.h>, which also
|
||||
* happens to define 'struct in_addr'. We don't want to redefine it.
|
||||
*/
|
||||
#if !defined(_NETINET_IN_H) && !defined(IPPROTO_IP)
|
||||
|
||||
/* Internet address (a structure for historical reasons) */
|
||||
struct in_addr
|
||||
{
|
||||
unsigned long s_addr;
|
||||
};
|
||||
|
||||
#endif /* !_NETINET_IN_H && !IPPROTO_IP */
|
||||
|
||||
#endif /* __USE_NETINET_IN_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int accept(int sockfd,struct sockaddr *cliaddr,int *addrlen);
|
||||
extern int bind(int sockfd,struct sockaddr *name,int namelen);
|
||||
extern int connect(int sockfd,struct sockaddr *name,int namelen);
|
||||
extern struct hostent * gethostbyaddr(const char *addr, int len, int type);
|
||||
extern struct hostent * gethostbyname(const char *name);
|
||||
extern int gethostname(const char *name, int namelen);
|
||||
extern struct netent * getnetbyname(const char *name);
|
||||
extern int getpeername(int sockfd,struct sockaddr *name,int *namelen);
|
||||
extern int getsockname(int sockfd,struct sockaddr *name,int *namelen);
|
||||
extern int getsockopt(int sockfd,int level,int optname,void *optval,int *optlen);
|
||||
extern unsigned long inet_addr(const char *addr);
|
||||
extern char * inet_ntoa(struct in_addr in);
|
||||
extern int ioctl(int fd,unsigned long request, ... /* char *arg */);
|
||||
extern int listen(int sockfd,int backlog);
|
||||
extern int recv(int fd,void *buff,size_t nbytes,int flags);
|
||||
extern int recvfrom(int sockfd,void *buff,int len,int flags,struct sockaddr *from,int *fromlen);
|
||||
extern int recvmsg(int socket,struct msghdr *msg,int flags);
|
||||
extern int select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct timeval *timeout);
|
||||
extern int send(int fd,void *buff,size_t nbytes,int flags);
|
||||
extern int sendmsg(int socket,struct msghdr *msg,int flags);
|
||||
extern int sendto(int sockfd,void *buff,int len,int flags,struct sockaddr *to,int tolen);
|
||||
extern int setsockopt(int sockfd,int level,int optname,void *optval,int optlen);
|
||||
extern int shutdown(int socket, int how);
|
||||
extern int socket(int domain,int type,int protocol);
|
||||
extern long gethostid(void);
|
||||
extern struct netent * getnetbyaddr(long net,int type);
|
||||
extern struct servent * getservbyname(const char *name, const char *proto);
|
||||
extern struct servent * getservbyport(int port, const char *proto);
|
||||
extern struct protoent * getprotobyname(const char *name);
|
||||
extern struct protoent * getprotobynumber(int proto);
|
||||
extern int inet_aton(const char *cp, struct in_addr *addr);
|
||||
extern unsigned long inet_lnaof(struct in_addr in);
|
||||
extern struct in_addr inet_makeaddr(int net,int host);
|
||||
extern unsigned long inet_netof(struct in_addr in);
|
||||
extern unsigned long inet_network(const char *cp);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern char *crypt(const char *key, const char *salt);
|
||||
extern gid_t getegid(void);
|
||||
extern uid_t geteuid(void);
|
||||
extern gid_t getgid(void);
|
||||
extern struct group *getgrgid(gid_t gid);
|
||||
extern struct group *getgrnam(const char *name);
|
||||
extern int getgroups(int ngroups, gid_t *groups);
|
||||
extern char *getpass(const char *prompt);
|
||||
extern struct passwd *getpwnam(const char *name);
|
||||
extern struct passwd *getpwuid(uid_t uid);
|
||||
extern uid_t getuid(void);
|
||||
extern int initgroups(const char *name, gid_t basegroup);
|
||||
extern int setegid(gid_t g);
|
||||
extern int seteuid(uid_t u);
|
||||
extern int setgid(gid_t id);
|
||||
extern int setgroups(int ngroups, const gid_t *groups);
|
||||
extern int setregid(gid_t real, gid_t eff);
|
||||
extern int setreuid(uid_t real, uid_t eff);
|
||||
extern long setsid(void);
|
||||
extern int setuid(uid_t id);
|
||||
extern void endgrent(void);
|
||||
extern void endpwent(void);
|
||||
extern struct group *getgrent(void);
|
||||
extern struct passwd *getpwent(void);
|
||||
extern void setgrent(void);
|
||||
extern void setpwent(void);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* !FD_SET && !__NO_NET_API */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _UNISTD_H */
|
||||
73
library/include/utime.h
Normal file
73
library/include/utime.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* $Id: utime.h,v 1.1.1.1 2004-07-26 16:32:56 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _UTIME_H
|
||||
#define _UTIME_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* The following is not part of the ISO 'C' standard. */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _TIME_H
|
||||
#include <time.h>
|
||||
#endif /* _TIME_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
struct utimbuf
|
||||
{
|
||||
time_t actime; /* Access time */
|
||||
time_t modtime; /* Modification time */
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int utime(const char * path_name,const struct utimbuf * times);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _UTIME_H */
|
||||
171
library/include/wchar.h
Normal file
171
library/include/wchar.h
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* $Id: wchar.h,v 1.1.1.1 2004-07-26 16:32:57 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _WCHAR_H
|
||||
#define _WCHAR_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif /* _STDDEF_H */
|
||||
|
||||
#ifndef _STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif /* _STDIO_H */
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif /* _STDARG_H */
|
||||
|
||||
#ifndef _TIME_H
|
||||
#include <time.h>
|
||||
#endif /* _TIME_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#define WEOF (-1)
|
||||
#define WCHAR_MAX 65535
|
||||
#define WCHAR_MIN 0
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef long int wint_t;
|
||||
typedef long mbstate_t;
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wint_t btowc(int c);
|
||||
extern int wctob(wint_t c);
|
||||
extern int mbsinit(const mbstate_t *ps);
|
||||
extern size_t mbrlen(wchar_t *pwc, const char * s, size_t n, mbstate_t *ps);
|
||||
extern size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps);
|
||||
extern size_t mbsrtowcs(wchar_t *pwcs, const char **src, size_t n, mbstate_t *ps);
|
||||
extern size_t wcsrtombs(char *s, const wchar_t **src, size_t n, mbstate_t *ps);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wchar_t *wcscat(wchar_t *dest, const wchar_t *src);
|
||||
extern wchar_t *wcsncat(wchar_t *dest, const wchar_t *src, size_t n);
|
||||
extern int wcscmp(const wchar_t *s1, const wchar_t * s2);
|
||||
extern int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
||||
extern wchar_t * wcscpy(wchar_t *dest, const wchar_t *src);
|
||||
extern wchar_t * wcsncpy(wchar_t *dest, const wchar_t *src, size_t n);
|
||||
extern size_t wcslen(const wchar_t *s);
|
||||
extern wchar_t * wcschr(const wchar_t *s, wchar_t c);
|
||||
extern size_t wcsspn(const wchar_t *s, const wchar_t *set);
|
||||
extern wchar_t wcspbrk(const wchar_t *s, const wchar_t *set);
|
||||
extern wchar_t *wcstok(wchar_t *str, const wchar_t *set);
|
||||
extern wchar_t *wcsstr(const wchar_t *src, const wchar_t *sub);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern double wcstod(const wchar_t *str, wchar_t **ptr);
|
||||
extern long wcstol(const wchar_t *str, wchar_t **ptr, int base);
|
||||
extern unsigned long wcstoul(const wchar_t *str, wchar_t **ptr, int base);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int wscoll(const wchar_t *s1, const wchar_t *s2);
|
||||
extern size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wchar_t *wmemchr(const wchar_t *ptr, wchar_t val, size_t len);
|
||||
extern int wmemcmp(const wchar_t *ptr1, const wchar_t *ptr2, size_t len);
|
||||
extern wchar_t *wmemcpy(wchar_t *dest, const wchar_t *src, size_t len);
|
||||
extern wchar_t *wmemmove(wchar_t *dest, const wchar_t * src, size_t len);
|
||||
extern wchar_t *wmemset(wchar_t *ptr, int val, size_t len);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fwide(FILE *stream, int orient);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wint_t fgetwc(FILE *stream);
|
||||
extern wint_t getwc(FILE *stream);
|
||||
extern wint_t getwchar(void);
|
||||
extern wint_t ungetwc(wint_t c,FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wchar_t *fgetws(wchar_t *s, int n, FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fwscanf(FILE *stream, const wchar_t *format, ...);
|
||||
extern int wscanf(const wchar_t *format, ...);
|
||||
extern int swscanf(wchar_t *s,const wchar_t *format, ...);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wint_t fputwc(wchar_t c,FILE *stream);
|
||||
extern wint_t putwc(wchar_t c,FILE *stream);
|
||||
extern wint_t putwchar(wchar_t c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wint_t fputws(const wchar_t *s, FILE *stream);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int fwprintf(FILE *stream,const wchar_t *format,...);
|
||||
extern int wprintf(const wchar_t *format, ...);
|
||||
extern int swprintf(wchar_t *s, const wchar_t *format, ...);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int vfwprintf(FILE *stream,const wchar_t *format,va_list arg);
|
||||
extern int vwprintf(const wchar_t *format,va_list arg);
|
||||
extern int vswprintf(char *s, const wchar_t *format,va_list arg);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern size_t wcsftime(wchar_t *s, size_t maxsize, const wchar_t *format, const struct tm *timeptr);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _WCHAR_H */
|
||||
93
library/include/wctype.h
Normal file
93
library/include/wctype.h
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* $Id: wctype.h,v 1.1.1.1 2004-07-26 16:32:57 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
* Portable ISO 'C' (1994) runtime library for the Amiga computer
|
||||
* Copyright (c) 2002-2004 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 _WCYTPE_H
|
||||
#define _WCYTPE_H
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _WCHAR_H
|
||||
#include <wchar.h>
|
||||
#endif /* _WCHAR_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
typedef long wctype_t; /* ZZZ */
|
||||
typedef long wctrans_t; /* ZZZ */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern int iswalnum(wint_t c);
|
||||
extern int iswalpha(wint_t c);
|
||||
extern int iswcntrl(wint_t c);
|
||||
|
||||
extern int iswdigit(wint_t c);
|
||||
extern int iswxdigit(wint_t c);
|
||||
|
||||
extern int iswgraph(wint_t c);
|
||||
extern int iswpunc(wint_t c);
|
||||
extern int iswprint(wint_t c);
|
||||
|
||||
extern int iswlower(wint_t c);
|
||||
extern int iswupper(wint_t c);
|
||||
|
||||
extern int iswspace(wint_t c);
|
||||
|
||||
extern wint_t towlower(wint_t c);
|
||||
extern wint_t towupper(wint_t c);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wctype_t wctype(const char *property);
|
||||
extern int iswctype(wint_t c, wctype_t desc);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
extern wctrans_t wctrans(const char *property);
|
||||
extern wint_t towctrans(wint_t c, wctrans_t desc);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#endif /* _WCYTPE_H */
|
||||
Reference in New Issue
Block a user