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

- Reorganized the local header files, removing redundancies.

- Dropped unused stub code which is now redundant because of
  the constructor/destructor mechanism.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14891 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-18 12:38:25 +00:00
parent f492e6a6c0
commit ead29c1850
97 changed files with 1242 additions and 787 deletions

View File

@@ -1,5 +1,5 @@
# #
# $Id: GNUmakefile.68k,v 1.43 2005-03-12 14:10:09 obarthel Exp $ # $Id: GNUmakefile.68k,v 1.44 2005-03-18 12:38:20 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -326,7 +326,6 @@ C_LIB = \
stdlib_set_process_window.o \ stdlib_set_process_window.o \
stdlib_shell_escape.o \ stdlib_shell_escape.o \
stdlib_showerror.o \ stdlib_showerror.o \
stdlib_socket.o \
stdlib_srand.o \ stdlib_srand.o \
stdlib_stackargbytes.o \ stdlib_stackargbytes.o \
stdlib_stackcheck.o \ stdlib_stackcheck.o \
@@ -925,19 +924,19 @@ $(LIBC_OBJS)/stdlib_stacksize.o : stdlib_stacksize.c stdlib_gcc_help.h
$(LIBC_OBJS)/stdlib_shell_escape.o : stdlib_shell_escape.c stdlib_gcc_help.h $(LIBC_OBJS)/stdlib_shell_escape.o : stdlib_shell_escape.c stdlib_gcc_help.h
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_memory.h
############################################################################## ##############################################################################

View File

@@ -1,5 +1,5 @@
# #
# $Id: GNUmakefile.os4,v 1.43 2005-03-11 18:27:26 obarthel Exp $ # $Id: GNUmakefile.os4,v 1.44 2005-03-18 12:38:21 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -324,7 +324,6 @@ C_LIB = \
stdlib_set_process_window.o \ stdlib_set_process_window.o \
stdlib_shell_escape.o \ stdlib_shell_escape.o \
stdlib_showerror.o \ stdlib_showerror.o \
stdlib_socket.o \
stdlib_srand.o \ stdlib_srand.o \
stdlib_stackargbytes.o \ stdlib_stackargbytes.o \
stdlib_stackcheck.o \ stdlib_stackcheck.o \
@@ -929,20 +928,20 @@ $(LIBAMIGA_OBJS)/amiga.lib_rev.o : amiga.lib_rev.c amiga.lib_rev.h
# Build rules for the debug version of the library which has special # Build rules for the debug version of the library which has special
# memory allocation debugging code, controlled by the contents of # memory allocation debugging code, controlled by the contents of
# the stdlib_mem_debug.h file. # the stdlib_memory.h file.
$(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_calloc.o : stdlib_calloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_free.o : stdlib_free.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_init_exit.o : stdlib_init_exit.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_malloc.o : stdlib_malloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_realloc.o : stdlib_realloc.c stdlib_memory.h
$(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_mem_debug.h $(LIBC_OBJS)/stdlib_red_black.o : stdlib_red_black.c stdlib_memory.h
############################################################################## ##############################################################################

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: amiga_createtask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $ * $Id: amiga_createtask.c,v 1.4 2005-03-18 12:38:21 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -46,6 +46,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#include "macros.h" #include "macros.h"
#include "debug.h" #include "debug.h"

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: amiga_dotimer.c,v 1.3 2005-03-06 09:00:16 obarthel Exp $ * $Id: amiga_dotimer.c,v 1.4 2005-03-18 12:38:21 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -44,6 +44,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#include "macros.h" #include "macros.h"
#include "debug.h" #include "debug.h"

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: amiga_rexxvars.c,v 1.5 2005-03-12 14:10:09 obarthel Exp $ * $Id: amiga_rexxvars.c,v 1.6 2005-03-18 12:38:21 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -34,12 +34,20 @@
/* We don't want to pull in <clib/alib_protos.h> */ /* We don't want to pull in <clib/alib_protos.h> */
#define CLIB_ALIB_PROTOS_H #define CLIB_ALIB_PROTOS_H
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#include <rexx/rxslib.h> #include <rexx/rxslib.h>
#include <rexx/errors.h> #include <rexx/errors.h>

View File

@@ -96,6 +96,11 @@
- fcntl() did not work for sockets. Fixed. - fcntl() did not work for sockets. Fixed.
- Reorganized the local header files, removing redundancies.
- Dropped unused stub code which is now redundant because of
the constructor/destructor mechanism.
c.lib 1.189 (5.3.2005) c.lib 1.189 (5.3.2005)

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: crtbegin.c,v 1.9 2005-03-11 16:04:50 obarthel Exp $ * $Id: crtbegin.c,v 1.10 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -10,7 +10,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: ctype_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: ctype_headers.h,v 1.3 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,7 +48,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: debug_headers.h,v 1.2 2005-01-02 09:07:07 obarthel Exp $ * $Id: debug_headers.h,v 1.3 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,14 +36,15 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
/****************************************************************************/ /****************************************************************************/
#if defined(__SASC) #if defined(__SASC)
#include <clib/exec_protos.h> #include <clib/exec_protos.h>
/*#include <pragmas/exec_sysbase_pragmas.h>*/
#include <pragmas/exec_pragmas.h> #include <pragmas/exec_pragmas.h>
LONG RawMayGetChar(VOID); LONG RawMayGetChar(VOID);
@@ -57,7 +58,11 @@ VOID RawPutChar(UBYTE c);
/****************************************************************************/ /****************************************************************************/
#if defined(__amigaos4__) #if defined(__amigaos4__)
#ifndef EXEC_EMULATION_H
#include <exec/emulation.h> #include <exec/emulation.h>
#endif /* EXEC_EMULATION_H */
#endif /* __amigaos4__ */ #endif /* __amigaos4__ */
/****************************************************************************/ /****************************************************************************/
@@ -106,11 +111,13 @@ VOID RawPutChar(UBYTE c);
/****************************************************************************/ /****************************************************************************/
#include "debug.h" #ifndef _MACROS_H
/****************************************************************************/
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_closedir.c,v 1.11 2005-03-12 14:10:09 obarthel Exp $ * $Id: dirent_closedir.c,v 1.12 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,24 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _DIRENT_HEADERS_H #ifndef _DIRENT_HEADERS_H
#include "dirent_headers.h" #include "dirent_headers.h"
#endif /* _DIRENT_HEADERS_H */ #endif /* _DIRENT_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_headers.h,v 1.7 2005-02-28 10:07:30 obarthel Exp $ * $Id: dirent_headers.h,v 1.8 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,6 +48,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#ifndef _MACROS_H #ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */ #endif /* _MACROS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: dirent_opendir.c,v 1.8 2005-02-27 21:58:21 obarthel Exp $ * $Id: dirent_opendir.c,v 1.9 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _DIRENT_HEADERS_H #ifndef _DIRENT_HEADERS_H
#include "dirent_headers.h" #include "dirent_headers.h"
#endif /* _DIRENT_HEADERS_H */ #endif /* _DIRENT_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $ * $Id: fcntl_headers.h,v 1.4 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,4 +48,10 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#endif /* _FCNTL_HEADERS_H */ #endif /* _FCNTL_HEADERS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: fcntl_open.c,v 1.14 2005-03-04 09:07:09 obarthel Exp $ * $Id: fcntl_open.c,v 1.15 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _FCNTL_HEADERS_H #ifndef _FCNTL_HEADERS_H
#include "fcntl_headers.h" #include "fcntl_headers.h"
#endif /* _FCNTL_HEADERS_H */ #endif /* _FCNTL_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: ftw_ftw.c,v 1.2 2005-03-03 10:59:17 obarthel Exp $ * $Id: ftw_ftw.c,v 1.3 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -45,28 +45,10 @@
/****************************************************************************/ /****************************************************************************/
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <ftw.h>
#include <errno.h>
#include <dos.h>
/****************************************************************************/
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
#ifndef _FTW_HEADERS_H #ifndef _FTW_HEADERS_H
#include "ftw_headers.h" #include "ftw_headers.h"
#endif /* _FTW_HEADERS_H */ #endif /* _FTW_HEADERS_H */
#ifndef _STDLIB_PROTOS_H
#include "stdlib_protos.h" /* get/set errno. */
#endif /* _STDLIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/
static int static int

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: ftw_headers.h,v 1.1 2005-03-02 12:57:53 obarthel Exp $ * $Id: ftw_headers.h,v 1.2 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,11 +36,30 @@
/****************************************************************************/ /****************************************************************************/
#include <sys/stat.h> #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <ftw.h>
#include <errno.h>
#include <dos.h>
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: ftw_nftw.c,v 1.2 2005-03-03 10:59:17 obarthel Exp $ * $Id: ftw_nftw.c,v 1.3 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -44,29 +44,10 @@
/****************************************************************************/ /****************************************************************************/
#include <dirent.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <ftw.h>
#include <errno.h>
#include <dos.h>
/****************************************************************************/
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
#ifndef _FTW_HEADERS_H #ifndef _FTW_HEADERS_H
#include "ftw_headers.h" #include "ftw_headers.h"
#endif /* _FTW_HEADERS_H */ #endif /* _FTW_HEADERS_H */
#ifndef _STDLIB_PROTOS_H
#include "stdlib_protos.h" /* get/set errno. */
#endif /* _STDLIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/
static int static int

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: locale_headers.h,v 1.6 2005-02-28 10:07:30 obarthel Exp $ * $Id: locale_headers.h,v 1.7 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,13 +36,19 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef LIBRARIES_LOCALE_H
#include <libraries/locale.h> #include <libraries/locale.h>
#endif /* LIBRARIES_LOCALE_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
/****************************************************************************/ /****************************************************************************/
@@ -59,8 +65,19 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: locale_init_exit.c,v 1.11 2005-03-12 14:10:09 obarthel Exp $ * $Id: locale_init_exit.c,v 1.12 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: macros.h,v 1.18 2005-03-12 14:10:09 obarthel Exp $ * $Id: macros.h,v 1.19 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -86,138 +86,6 @@
/****************************************************************************/ /****************************************************************************/
/* Constructor and destructor functions, as used by the library for data
initialization and cleanup. These particular functions are invoked by
the startup code before and after the main() function is/was called.
How this works is very compiler specific. We support three flavours
below. */
/****************************************************************************/
#ifdef __SASC
#define CONSTRUCTOR(name,pri) \
int __stdargs _STI_##pri##_##name(void); \
int __stdargs _STI_##pri##_##name(void)
#define DESTRUCTOR(name,pri) \
void __stdargs _STD_##pri##_##name(void); \
void __stdargs _STD_##pri##_##name(void)
#define CONSTRUCTOR_SUCCEED() \
return(0)
#define CONSTRUCTOR_FAIL() \
return(1)
#endif /* __SASC */
/****************************************************************************/
#ifdef __GNUC__
#if defined(__amigaos4__)
#define CONSTRUCTOR(name,pri) \
STATIC VOID __attribute__((used)) name##_ctor(VOID); \
STATIC VOID (*__##name##_ctor)(VOID) __attribute__((used,section(".ctors._" #pri))) = name##_ctor; \
STATIC VOID name##_ctor(VOID)
#define DESTRUCTOR(name,pri) \
STATIC VOID __attribute__((used)) name##_dtor(VOID); \
STATIC VOID (*__##name##_dtor)(VOID) __attribute__((used,section(".dtors._" #pri))) = name##_dtor; \
STATIC VOID name##_dtor(VOID)
#else
#define CONSTRUCTOR(name,pri) \
asm(".stabs \"___INIT_LIST__\",22,0,0,___ctor_" #name); \
asm(".stabs \"___INIT_LIST__\",20,0,0," #pri); \
VOID __ctor_##name##(VOID); \
VOID __ctor_##name##(VOID)
#define DESTRUCTOR(name,pri) \
asm(".stabs \"___EXIT_LIST__\",22,0,0,___dtor_" #name); \
asm(".stabs \"___EXIT_LIST__\",20,0,0," #pri); \
VOID __dtor_##name##(VOID); \
VOID __dtor_##name##(VOID)
#endif /* __amigaos4__ */
#define CONSTRUCTOR_SUCCEED() \
return
#define CONSTRUCTOR_FAIL() \
exit(RETURN_FAIL)
#endif /* __GNUC__ */
/****************************************************************************/
/* These macros are for declaring functions to serve as constructors or
destructors. In which order these should be invoked is defined by the
priority, which is a number in the range 0-999. User-supplied
constructor/destructor functions should have priority 0. That way,
the user-supplied constructors will be invoked after the library
constructors and the user-supplied destructors before the library
destructors. */
#define STDLIB_CONSTRUCTOR(name) CONSTRUCTOR(name, 1)
#define STDLIB_DESTRUCTOR(name) DESTRUCTOR(name, 1)
#define STK_CONSTRUCTOR(name) CONSTRUCTOR(name, 2)
#define STK_DESTRUCTOR(name) DESTRUCTOR(name, 2)
#define STDIO_CONSTRUCTOR(name) CONSTRUCTOR(name, 3)
#define STDIO_DESTRUCTOR(name) DESTRUCTOR(name, 3)
#define FILE_CONSTRUCTOR(name) CONSTRUCTOR(name, 4)
#define FILE_DESTRUCTOR(name) DESTRUCTOR(name, 4)
#define MATH_CONSTRUCTOR(name) CONSTRUCTOR(name, 5)
#define MATH_DESTRUCTOR(name) DESTRUCTOR(name, 5)
#define SOCKET_CONSTRUCTOR(name) CONSTRUCTOR(name, 6)
#define SOCKET_DESTRUCTOR(name) DESTRUCTOR(name, 6)
#define ARG_CONSTRUCTOR(name) CONSTRUCTOR(name, 7)
#define ARG_DESTRUCTOR(name) DESTRUCTOR(name, 7)
#define CLIB_CONSTRUCTOR(name) CONSTRUCTOR(name, 8)
#define CLIB_DESTRUCTOR(name) DESTRUCTOR(name, 8)
#define PROFILE_CONSTRUCTOR(name) CONSTRUCTOR(name, 9)
#define PROFILE_DESTRUCTOR(name) DESTRUCTOR(name, 9)
/****************************************************************************/
/* Magic macros for code profiling, SAS/C style. Normally, you would find
these in <sprof.h>, which is SAS/C-specific. */
/****************************************************************************/
#ifdef __SASC
extern void ASM _PROLOG(REG(a0,char *));
extern void ASM _EPILOG(REG(a0,char *));
#if _PROFILE
#define PROFILE_OFF() _PROLOG(0L)
#define PROFILE_ON() _EPILOG(0L)
#else
#define PROFILE_OFF() ((void)0)
#define PROFILE_ON() ((void)0)
#endif /* _PROFILE */
#endif /* __SASC */
/****************************************************************************/
#ifdef __GNUC__
#define PROFILE_OFF() ((void)0)
#define PROFILE_ON() ((void)0)
#endif /* __GNUC__ */
/****************************************************************************/
/* Special data and function attributes; for OS4 most, if not all of them /* Special data and function attributes; for OS4 most, if not all of them
are in a file called <amiga_compiler.h> which is pulled in by the are in a file called <amiga_compiler.h> which is pulled in by the
<exec/types.h> header file. */ <exec/types.h> header file. */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_headers.h,v 1.6 2005-02-03 16:56:15 obarthel Exp $ * $Id: math_headers.h,v 1.7 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -43,8 +43,31 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/
#ifndef _MATH_FP_SUPPORT_H
#include "math_fp_support.h"
#endif /* _MATH_FP_SUPPORT_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/ /****************************************************************************/
@@ -52,9 +75,17 @@
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_MATHIEEESINGBAS_H
#include <proto/mathieeesingbas.h> #include <proto/mathieeesingbas.h>
#endif /* PROTO_MATHIEEESINGBAS_H */
#ifndef PROTO_MATHIEEEDOUBBAS_H
#include <proto/mathieeedoubbas.h> #include <proto/mathieeedoubbas.h>
#endif /* PROTO_MATHIEEEDOUBBAS_H */
#ifndef PROTO_MATHIEEEDOUBTRANS_H
#include <proto/mathieeedoubtrans.h> #include <proto/mathieeedoubtrans.h>
#endif /* PROTO_MATHIEEEDOUBTRANS_H */
/****************************************************************************/ /****************************************************************************/
@@ -186,20 +217,8 @@ extern double __scalbn(double x, int n);
/****************************************************************************/ /****************************************************************************/
#ifndef _MATH_FP_SUPPORT_H
#include "math_fp_support.h"
#endif /* _MATH_FP_SUPPORT_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
/* math_huge_val.c */ /* math_huge_val.c */
double __get_huge_val(void); extern double __get_huge_val(void);
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: math_init_exit.c,v 1.13 2005-03-12 14:10:09 obarthel Exp $ * $Id: math_init_exit.c,v 1.14 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,15 +37,21 @@
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_EXECBASE_H
#include <exec/execbase.h> #include <exec/execbase.h>
#endif /* EXEC_EXECBASE_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: mount_headers.h,v 1.3 2005-02-03 16:56:15 obarthel Exp $ * $Id: mount_headers.h,v 1.4 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,6 +48,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#include <sys/mount.h> #include <sys/mount.h>
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,24 +1,39 @@
/* /*
* $Id: sas_profile.c,v 1.4 2005-03-12 14:10:09 obarthel Exp $ * $Id: sas_profile.c,v 1.5 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
* Adapted from SAS/C runtime library code. * Adapted from SAS/C runtime library code.
*/ */
#ifndef EXEC_MEMORY_H
#include <exec/memory.h> #include <exec/memory.h>
#include <exec/ports.h> #endif /* EXEC_MEMORY_H */
#include <exec/devices.h>
#ifndef EXEC_PORTS_H
#include <exec/ports.h>
#endif /* EXEC_PORTS_H */
#ifndef EXEC_DEVICES_H
#include <exec/devices.h>
#endif /* EXEC_DEVICES_H */
#ifndef DEVICES_TIMER_H
#include <devices/timer.h> #include <devices/timer.h>
#endif /* DEVICES_TIMER_H */
/****************************************************************************/ /****************************************************************************/
#define __NOLIBBASE__ #define __NOLIBBASE__
#define __NOGLOBALIFACE__ #define __NOGLOBALIFACE__
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#ifndef PROTO_TIMER_H
#include <proto/timer.h> #include <proto/timer.h>
#endif /* PROTO_TIMER_H */
/****************************************************************************/ /****************************************************************************/
@@ -26,6 +41,12 @@ extern struct Library * SysBase;
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#include "macros.h" #include "macros.h"
#include "debug.h" #include "debug.h"
@@ -310,7 +331,6 @@ PROFILE_CONSTRUCTOR(profile_init)
__profile_init(); __profile_init();
SHOWVALUE(success);
LEAVE(); LEAVE();
CONSTRUCTOR_SUCCEED(); CONSTRUCTOR_SUCCEED();

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: signal_headers.h,v 1.6 2005-01-09 10:10:41 obarthel Exp $ * $Id: signal_headers.h,v 1.7 2005-03-18 12:38:22 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,14 +36,23 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef DOS_DOSEXTENS_H
#include <dos/dosextens.h> #include <dos/dosextens.h>
#endif /* DOS_DOSEXTENS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/
@@ -55,8 +64,13 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
# #
# $Id: smakefile,v 1.33 2005-03-11 18:27:26 obarthel Exp $ # $Id: smakefile,v 1.34 2005-03-18 12:38:22 obarthel Exp $
# #
# :ts=8 # :ts=8
# #
@@ -645,61 +645,61 @@ stdlib_setjmp.o : stdlib_setjmp.asm
stdlib_swapstack.o : stdlib_swapstack.asm stdlib_swapstack.o : stdlib_swapstack.asm
stdio_fdhookentry.o : stdio_fdhookentry.c stdlib_mem_debug.h stdio_fdhookentry.o : stdio_fdhookentry.c stdlib_memory.h
stdio_openiob.o : stdio_openiob.c stdlib_mem_debug.h stdio_openiob.o : stdio_openiob.c stdlib_memory.h
stdlib_alloca.o : stdlib_alloca.c stdlib_mem_debug.h stdlib_alloca.o : stdlib_alloca.c stdlib_memory.h
stdlib_calloc.o : stdlib_calloc.c stdlib_mem_debug.h stdlib_calloc.o : stdlib_calloc.c stdlib_memory.h
stdlib_free.o : stdlib_free.c stdlib_mem_debug.h stdlib_free.o : stdlib_free.c stdlib_memory.h
stdlib_init_exit.o : stdlib_init_exit.c stdlib_mem_debug.h stdlib_init_exit.o : stdlib_init_exit.c stdlib_memory.h
stdlib_malloc.o : stdlib_malloc.c stdlib_mem_debug.h stdlib_malloc.o : stdlib_malloc.c stdlib_memory.h
stdlib_realloc.o : stdlib_realloc.c stdlib_mem_debug.h stdlib_realloc.o : stdlib_realloc.c stdlib_memory.h
stdlib_red_black.o : stdlib_red_black.c stdlib_mem_debug.h stdlib_red_black.o : stdlib_red_black.c stdlib_memory.h
dirent_closedir.o : dirent_closedir.c stdlib_mem_debug.h dirent_closedir.o : dirent_closedir.c stdlib_memory.h
dirent_opendir.o : dirent_opendir.c stdlib_mem_debug.h dirent_opendir.o : dirent_opendir.c stdlib_memory.h
fcntl_open.o : fcntl_open.c stdlib_mem_debug.h fcntl_open.o : fcntl_open.c stdlib_memory.h
socket_select.o : socket_select.c stdlib_mem_debug.h socket_select.o : socket_select.c stdlib_memory.h
stdio_fclose.o : stdio_fclose.c stdlib_mem_debug.h stdio_fclose.o : stdio_fclose.c stdlib_memory.h
stdio_growfdtable.o : stdio_growfdtable.c stdlib_mem_debug.h stdio_growfdtable.o : stdio_growfdtable.c stdlib_memory.h
stdio_growiobtable.o : stdio_growiobtable.c stdlib_mem_debug.h stdio_growiobtable.o : stdio_growiobtable.c stdlib_memory.h
stdio_init_exit.o : stdio_init_exit.c stdlib_mem_debug.h stdio_init_exit.o : stdio_init_exit.c stdlib_memory.h
stdio_popen.o : stdio_popen.c stdlib_mem_debug.h stdio_popen.o : stdio_popen.c stdlib_memory.h
stdio_setvbuf.o : stdio_setvbuf.c stdlib_mem_debug.h stdio_setvbuf.o : stdio_setvbuf.c stdlib_memory.h
stdio_tmpfile.o : stdio_tmpfile.c stdlib_mem_debug.h stdio_tmpfile.o : stdio_tmpfile.c stdlib_memory.h
stdlib_atexit.o : stdlib_atexit.c stdlib_mem_debug.h stdlib_atexit.o : stdlib_atexit.c stdlib_memory.h
stdlib_setenv.o : stdlib_setenv.c stdlib_mem_debug.h stdlib_setenv.o : stdlib_setenv.c stdlib_memory.h
stdlib_arg.o : stdlib_arg.c stdlib_mem_debug.h stdlib_arg.o : stdlib_arg.c stdlib_memory.h
stdlib_system.o : stdlib_system.c stdlib_mem_debug.h stdlib_system.o : stdlib_system.c stdlib_memory.h
stdlib_unsetenv.o : stdlib_unsetenv.c stdlib_mem_debug.h stdlib_unsetenv.o : stdlib_unsetenv.c stdlib_memory.h
unistd_getcwd.o : unistd_getcwd.c stdlib_mem_debug.h unistd_getcwd.o : unistd_getcwd.c stdlib_memory.h
unistd_unlink.o : unistd_unlink.c stdlib_mem_debug.h unistd_unlink.o : unistd_unlink.c stdlib_memory.h
unistd_wildcard_expand.o : unistd_wildcard_expand.c stdlib_mem_debug.h unistd_wildcard_expand.o : unistd_wildcard_expand.c stdlib_memory.h
stdlib_main.o : stdlib_main.c stdlib_main.o : stdlib_main.c
@echo "Compiling $<" @echo "Compiling $<"

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_headers.h,v 1.7 2005-02-20 13:19:40 obarthel Exp $ * $Id: socket_headers.h,v 1.8 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -54,6 +54,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
extern struct Library * NOCOMMON __SocketBase; extern struct Library * NOCOMMON __SocketBase;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_init_exit.c,v 1.18 2005-03-12 14:10:09 obarthel Exp $ * $Id: socket_init_exit.c,v 1.19 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -45,7 +45,9 @@
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: socket_select.c,v 1.7 2005-02-28 13:22:53 obarthel Exp $ * $Id: socket_select.c,v 1.8 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -35,18 +35,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _SOCKET_HEADERS_H #ifndef _SOCKET_HEADERS_H
#include "socket_headers.h" #include "socket_headers.h"
#endif /* _SOCKET_HEADERS_H */ #endif /* _SOCKET_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
STATIC VOID STATIC VOID
copy_fd_set(fd_set * to,fd_set * from,int num_fds) copy_fd_set(fd_set * to,fd_set * from,int num_fds)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stat_headers.h,v 1.4 2005-02-03 16:56:15 obarthel Exp $ * $Id: stat_headers.h,v 1.5 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,6 +48,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
extern mode_t NOCOMMON __current_umask; extern mode_t NOCOMMON __current_umask;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_fclose.c,v 1.9 2005-03-09 12:06:10 obarthel Exp $ * $Id: stdio_fclose.c,v 1.10 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
fclose(FILE *stream) fclose(FILE *stream)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_fdhookentry.c,v 1.22 2005-03-14 10:03:06 obarthel Exp $ * $Id: stdio_fdhookentry.c,v 1.23 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,12 +31,6 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
@@ -47,6 +41,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#include <strings.h> #include <strings.h>
#include <limits.h> #include <limits.h>

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_file_init.c,v 1.5 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdio_file_init.c,v 1.6 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,12 +31,6 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
@@ -47,6 +41,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
static struct MsgPort * old_console_task; static struct MsgPort * old_console_task;
static BOOL restore_console_task; static BOOL restore_console_task;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_growfdtable.c,v 1.6 2005-03-11 09:37:29 obarthel Exp $ * $Id: stdio_growfdtable.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
__grow_fd_table(int max_fd) __grow_fd_table(int max_fd)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_growiobtable.c,v 1.6 2005-03-11 09:37:29 obarthel Exp $ * $Id: stdio_growiobtable.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
__grow_iob_table(int max_iob) __grow_iob_table(int max_iob)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_headers.h,v 1.20 2005-03-12 09:43:48 obarthel Exp $ * $Id: stdio_headers.h,v 1.21 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,28 +36,57 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef EXEC_MEMORY_H
#include <exec/memory.h> #include <exec/memory.h>
#endif /* EXEC_MEMORY_H */
#ifndef DEVICES_TIMER_H
#include <devices/timer.h> #include <devices/timer.h>
#endif /* DEVICES_TIMER_H */
#ifndef DOS_DOSEXTENS_H
#include <dos/dosextens.h> #include <dos/dosextens.h>
#endif /* DOS_DOSEXTENS_H */
#ifndef DOS_DOSTAGS_H
#include <dos/dostags.h> #include <dos/dostags.h>
#endif /* DOS_DOSTAGS_H */
#ifndef DOS_DOSASL_H
#include <dos/dosasl.h> #include <dos/dosasl.h>
#endif /* DOS_DOSASL_H */
#ifndef DOS_RECORD_H
#include <dos/record.h> #include <dos/record.h>
#endif /* DOS_RECORD_H */
#ifndef LIBRARIES_LOCALE_H
#include <libraries/locale.h> #include <libraries/locale.h>
#endif /* LIBRARIES_LOCALE_H */
#ifndef UTILITY_HOOKS_H
#include <utility/hooks.h> #include <utility/hooks.h>
#endif /* UTILITY_HOOKS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h> #include <clib/alib_protos.h>
#endif /* CLIB_ALIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/
@@ -81,6 +110,12 @@
/****************************************************************************/ /****************************************************************************/
#if defined(FLOATING_POINT_SUPPORT)
#include <math.h>
#endif /* FLOATING_POINT_SUPPORT */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
@@ -93,21 +128,25 @@
/****************************************************************************/ /****************************************************************************/
#if defined(FLOATING_POINT_SUPPORT) #ifndef _STDLIB_PROFILE_H
#include <math.h> #include "stdlib_profile.h"
#endif /* FLOATING_POINT_SUPPORT */ #endif /* _STDLIB_PROFILE_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/
/* Forward declarations for below... */ /* Forward declarations for below... */
struct fd; struct fd;
struct iob; struct iob;
struct file_action_message;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_init_exit.c,v 1.29 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdio_init_exit.c,v 1.30 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,12 +31,6 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
@@ -47,6 +41,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
/* The file handle table. */ /* The file handle table. */
struct iob ** __iob; struct iob ** __iob;
int __num_iob; int __num_iob;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_openiob.c,v 1.11 2005-03-03 14:20:55 obarthel Exp $ * $Id: stdio_openiob.c,v 1.12 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
__open_iob(const char *filename, const char *mode, int file_descriptor, int slot_number) __open_iob(const char *filename, const char *mode, int file_descriptor, int slot_number)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_popen.c,v 1.6 2005-02-28 10:07:31 obarthel Exp $ * $Id: stdio_popen.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_record_locking.c,v 1.6 2005-03-06 09:00:16 obarthel Exp $ * $Id: stdio_record_locking.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,12 +31,6 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
@@ -47,6 +41,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#include <strings.h> #include <strings.h>
#include <limits.h> #include <limits.h>

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_setvbuf.c,v 1.6 2005-02-27 18:09:11 obarthel Exp $ * $Id: stdio_setvbuf.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
setvbuf(FILE *stream,char *buf,int bufmode,size_t size) setvbuf(FILE *stream,char *buf,int bufmode,size_t size)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_tmpfile.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $ * $Id: stdio_tmpfile.c,v 1.4 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
FILE * FILE *
tmpfile(void) tmpfile(void)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdio_vasprintf.c,v 1.9 2005-02-28 10:07:31 obarthel Exp $ * $Id: stdio_vasprintf.c,v 1.10 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -43,6 +43,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDIO_HEADERS_H #ifndef _STDIO_HEADERS_H
#include "stdio_headers.h" #include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */ #endif /* _STDIO_HEADERS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_alloca.c,v 1.5 2005-01-02 09:07:08 obarthel Exp $ * $Id: stdlib_alloca.c,v 1.6 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,24 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#undef alloca #undef alloca
extern void * alloca(size_t size); extern void * alloca(size_t size);
@@ -62,7 +68,7 @@ static struct MinList alloca_memory_list;
/****************************************************************************/ /****************************************************************************/
CLIB_DESTRUCTOR(__alloca_exit) CLIB_DESTRUCTOR(alloca_exit)
{ {
ENTER(); ENTER();

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_arg.c,v 1.5 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdlib_arg.c,v 1.6 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -35,12 +35,6 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
@@ -51,6 +45,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#include <setjmp.h> #include <setjmp.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -59,10 +65,6 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
/****************************************************************************/
char ** __argv; char ** __argv;
int __argc; int __argc;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_assertion_failure.c,v 1.7 2005-02-21 16:09:44 obarthel Exp $ * $Id: stdlib_assertion_failure.c,v 1.8 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -41,12 +41,20 @@
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#define __NOLIBBASE__ #define __NOLIBBASE__
#define __NOGLOBALIFACE__ #define __NOGLOBALIFACE__
#ifndef PROTO_INTUITION_H
#include <proto/intuition.h> #include <proto/intuition.h>
#endif /* PROTO_INTUITION_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_atexit.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $ * $Id: stdlib_atexit.c,v 1.4 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
struct ExitTrapNode struct ExitTrapNode
{ {
struct MinNode etn_MinNode; struct MinNode etn_MinNode;

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_calloc.c,v 1.4 2005-01-02 09:07:08 obarthel Exp $ * $Id: stdlib_calloc.c,v 1.5 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#undef calloc #undef calloc
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_checkdetach.c,v 1.2 2005-01-02 09:07:08 obarthel Exp $ * $Id: stdlib_checkdetach.c,v 1.3 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -0,0 +1,144 @@
/*
* $Id: stdlib_constructor.h,v 1.1 2005-03-18 12:38:23 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _STDLIB_CONSTRUCTOR_H
#define _STDLIB_CONSTRUCTOR_H
/****************************************************************************/
/* Constructor and destructor functions, as used by the library for data
initialization and cleanup. These particular functions are invoked by
the startup code before and after the main() function is/was called.
How this works is very compiler specific. We support three flavours
below. */
/****************************************************************************/
#ifdef __SASC
#define CONSTRUCTOR(name,pri) \
int __stdargs _STI_##pri##_##name(void); \
int __stdargs _STI_##pri##_##name(void)
#define DESTRUCTOR(name,pri) \
void __stdargs _STD_##pri##_##name(void); \
void __stdargs _STD_##pri##_##name(void)
#define CONSTRUCTOR_SUCCEED() \
return(0)
#define CONSTRUCTOR_FAIL() \
return(1)
#endif /* __SASC */
/****************************************************************************/
#ifdef __GNUC__
#if defined(__amigaos4__)
#define CONSTRUCTOR(name,pri) \
STATIC VOID __attribute__((used)) name##_ctor(VOID); \
STATIC VOID (*__##name##_ctor)(VOID) __attribute__((used,section(".ctors._" #pri))) = name##_ctor; \
STATIC VOID name##_ctor(VOID)
#define DESTRUCTOR(name,pri) \
STATIC VOID __attribute__((used)) name##_dtor(VOID); \
STATIC VOID (*__##name##_dtor)(VOID) __attribute__((used,section(".dtors._" #pri))) = name##_dtor; \
STATIC VOID name##_dtor(VOID)
#else
#define CONSTRUCTOR(name,pri) \
asm(".stabs \"___INIT_LIST__\",22,0,0,___ctor_" #name); \
asm(".stabs \"___INIT_LIST__\",20,0,0," #pri); \
VOID __ctor_##name##(VOID); \
VOID __ctor_##name##(VOID)
#define DESTRUCTOR(name,pri) \
asm(".stabs \"___EXIT_LIST__\",22,0,0,___dtor_" #name); \
asm(".stabs \"___EXIT_LIST__\",20,0,0," #pri); \
VOID __dtor_##name##(VOID); \
VOID __dtor_##name##(VOID)
#endif /* __amigaos4__ */
#define CONSTRUCTOR_SUCCEED() \
return
#define CONSTRUCTOR_FAIL() \
exit(RETURN_FAIL)
#endif /* __GNUC__ */
/****************************************************************************/
/* These macros are for declaring functions to serve as constructors or
destructors. In which order these should be invoked is defined by the
priority, which is a number in the range 0-999. User-supplied
constructor/destructor functions should have priority 0. That way,
the user-supplied constructors will be invoked after the library
constructors and the user-supplied destructors before the library
destructors. */
#define STDLIB_CONSTRUCTOR(name) CONSTRUCTOR(name, 1)
#define STDLIB_DESTRUCTOR(name) DESTRUCTOR(name, 1)
#define STK_CONSTRUCTOR(name) CONSTRUCTOR(name, 2)
#define STK_DESTRUCTOR(name) DESTRUCTOR(name, 2)
#define STDIO_CONSTRUCTOR(name) CONSTRUCTOR(name, 3)
#define STDIO_DESTRUCTOR(name) DESTRUCTOR(name, 3)
#define FILE_CONSTRUCTOR(name) CONSTRUCTOR(name, 4)
#define FILE_DESTRUCTOR(name) DESTRUCTOR(name, 4)
#define MATH_CONSTRUCTOR(name) CONSTRUCTOR(name, 5)
#define MATH_DESTRUCTOR(name) DESTRUCTOR(name, 5)
#define SOCKET_CONSTRUCTOR(name) CONSTRUCTOR(name, 6)
#define SOCKET_DESTRUCTOR(name) DESTRUCTOR(name, 6)
#define ARG_CONSTRUCTOR(name) CONSTRUCTOR(name, 7)
#define ARG_DESTRUCTOR(name) DESTRUCTOR(name, 7)
#define CLIB_CONSTRUCTOR(name) CONSTRUCTOR(name, 8)
#define CLIB_DESTRUCTOR(name) DESTRUCTOR(name, 8)
#define PROFILE_CONSTRUCTOR(name) CONSTRUCTOR(name, 9)
#define PROFILE_DESTRUCTOR(name) DESTRUCTOR(name, 9)
/****************************************************************************/
#endif /* _STDLIB_CONSTRUCTOR_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_detach.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_detach.c,v 1.3 2005-03-18 12:38:23 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_disablerequesters.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_disablerequesters.c,v 1.3 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_dosbase.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_dosbase.c,v 1.3 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -32,7 +32,10 @@
*/ */
#define __NOLIBBASE__ #define __NOLIBBASE__
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_free.c,v 1.8 2005-02-28 10:07:31 obarthel Exp $ * $Id: stdlib_free.c,v 1.9 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#undef free #undef free
#undef __free #undef __free

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_headers.h,v 1.15 2005-03-11 18:27:27 obarthel Exp $ * $Id: stdlib_headers.h,v 1.16 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,8 +36,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#include <exec/memory.h> #endif /* EXEC_LIBRARIES_H */
/****************************************************************************/ /****************************************************************************/
@@ -49,25 +50,46 @@
/****************************************************************************/ /****************************************************************************/
#if (INCLUDE_VERSION >= 50) #if (INCLUDE_VERSION >= 50)
#ifndef DOS_ANCHORPATH_H
#include <dos/anchorpath.h> #include <dos/anchorpath.h>
#endif /* DOS_ANCHORPATH_H */
#endif /* (INCLUDE_VERSION >= 50) */ #endif /* (INCLUDE_VERSION >= 50) */
/****************************************************************************/
#ifndef DOS_DOSEXTENS_H
#include <dos/dosextens.h> #include <dos/dosextens.h>
#endif /* DOS_DOSEXTENS_H */
#ifndef DOS_DOSTAGS_H
#include <dos/dostags.h> #include <dos/dostags.h>
#endif /* DOS_DOSTAGS_H */
#ifndef DOS_DOSASL_H
#include <dos/dosasl.h> #include <dos/dosasl.h>
#endif /* DOS_DOSASL_H */
/****************************************************************************/ /****************************************************************************/
#ifndef WORKBENCH_STARTUP_H
#include <workbench/startup.h> #include <workbench/startup.h>
#endif /* WORKBENCH_STARTUP_H */
/****************************************************************************/ /****************************************************************************/
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h> #include <clib/alib_protos.h>
#endif /* CLIB_ALIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/
@@ -96,101 +118,25 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#if defined(FLOATING_POINT_SUPPORT) #if defined(FLOATING_POINT_SUPPORT)
#include <math.h> #include <math.h>
#endif /* FLOATING_POINT_SUPPORT */ #endif /* FLOATING_POINT_SUPPORT */
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/
/* We shuffle things around a bit for the debug code. This works by joining
related code which shares the same name. The debug code symbols also have
to be completely separate from the "regular" code. */
#if defined(__MEM_DEBUG)
#define __static
#define __alloca_cleanup __alloca_cleanup_debug
#define __alloca_exit __alloca_exit_debug
#define __find_memory_node __find_memory_node_debug
#define __free_memory_node __free_memory_node_debug
#define __force_free __force_free_debug
#define __get_allocation_size __get_allocation_size_debug
#define __allocate_memory __allocate_memory_debug
#define __memory_pool __memory_pool_debug
#define __memory_list __memory_list_debug
#define __vasprintf_hook_entry __vasprintf_hook_entry_debug
extern void * __alloca(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 * __malloc(size_t size,const char * file,int line);
extern void * __realloc(void *ptr,size_t size,const char * file,int line);
extern char * __strdup(const char *s,const char * file,int line);
extern char * __getcwd(char * buffer,size_t buffer_size,const char *file,int line);
#else
#define __static STATIC
#define __free(mem,file,line) free(mem)
#define __malloc(size,file,line) malloc(size)
#endif /* __MEM_DEBUG */
/****************************************************************************/
struct MemoryNode
{
struct MinNode mn_MinNode;
size_t mn_Size;
UBYTE mn_NeverFree;
#ifdef __MEM_DEBUG
UBYTE mn_AlreadyFree;
UBYTE mn_Pad0[2];
void * mn_Allocation;
size_t mn_AllocationSize;
char * mn_FreeFile;
int mn_FreeLine;
char * mn_File;
int mn_Line;
#ifdef __USE_MEM_TREES
struct MemoryNode * mn_Left;
struct MemoryNode * mn_Right;
struct MemoryNode * mn_Parent;
UBYTE mn_IsRed;
UBYTE mn_Pad1[3];
#endif /* __USE_MEM_TREES */
#else
UBYTE mn_Pad0[3];
#endif /* __MEM_DEBUG */
};
#ifdef __USE_MEM_TREES
struct MemoryTree
{
struct MemoryNode * mt_Root;
struct MemoryNode mt_RootNode;
struct MemoryNode mt_NullNode;
};
#endif /* __USE_MEM_TREES */
/****************************************************************************/ /****************************************************************************/
@@ -198,19 +144,6 @@ extern unsigned int NOCOMMON __random_seed;
/****************************************************************************/ /****************************************************************************/
extern struct MemoryTree NOCOMMON __memory_tree;
extern struct MinList NOCOMMON __memory_list;
extern APTR NOCOMMON __memory_pool;
/****************************************************************************/
extern unsigned long NOCOMMON __maximum_memory_allocated;
extern unsigned long NOCOMMON __current_memory_allocated;
extern unsigned long NOCOMMON __maximum_num_memory_chunks_allocated;
extern unsigned long NOCOMMON __current_num_memory_chunks_allocated;
/****************************************************************************/
extern jmp_buf NOCOMMON __exit_jmp_buf; extern jmp_buf NOCOMMON __exit_jmp_buf;
extern int NOCOMMON __exit_value; extern int NOCOMMON __exit_value;
@@ -251,33 +184,6 @@ extern int NOCOMMON __argc;
/****************************************************************************/ /****************************************************************************/
extern int NOCOMMON __default_pool_size;
extern int NOCOMMON __default_puddle_size;
/****************************************************************************/
#if defined(__THREAD_SAFE)
/****************************************************************************/
extern void __memory_lock(void);
extern void __memory_unlock(void);
/****************************************************************************/
#else
/****************************************************************************/
#define __memory_lock() ((void)0)
#define __memory_unlock() ((void)0)
/****************************************************************************/
#endif /* __THREAD_SAFE */
/****************************************************************************/
#ifndef _STDLIB_PROTOS_H #ifndef _STDLIB_PROTOS_H
#include "stdlib_protos.h" #include "stdlib_protos.h"
#endif /* _STDLIB_PROTOS_H */ #endif /* _STDLIB_PROTOS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_init_exit.c,v 1.10 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdlib_init_exit.c,v 1.11 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,24 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
static BOOL free_program_name; static BOOL free_program_name;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_isresident.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_isresident.c,v 1.3 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_machine_test.c,v 1.4 2005-03-07 16:56:36 obarthel Exp $ * $Id: stdlib_machine_test.c,v 1.5 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_EXECBASE_H
#include <exec/execbase.h> #include <exec/execbase.h>
#endif /* EXEC_EXECBASE_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_main.c,v 1.16 2005-03-11 16:04:51 obarthel Exp $ * $Id: stdlib_main.c,v 1.17 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -33,13 +33,21 @@
/*#define DEBUG*/ /*#define DEBUG*/
#include "stdlib_headers.h" /****************************************************************************/
#include "stdio_headers.h"
#include "time_headers.h" #ifndef EXEC_EXECBASE_H
#include <exec/execbase.h>
#endif /* EXEC_EXECBASE_H */
/****************************************************************************/ /****************************************************************************/
#include <exec/execbase.h> #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
#ifndef _STDIO_HEADERS_H
#include "stdio_headers.h"
#endif /* _STDIO_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
@@ -51,10 +59,6 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
/****************************************************************************/
typedef int (*init_func_ptr)(void); typedef int (*init_func_ptr)(void);
typedef void (*exit_func_ptr)(void); typedef void (*exit_func_ptr)(void);

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_malloc.c,v 1.11 2005-03-11 13:23:18 obarthel Exp $ * $Id: stdlib_malloc.c,v 1.12 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#undef malloc #undef malloc
#undef __malloc #undef __malloc

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_math.c,v 1.3 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_math.c,v 1.4 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,10 +37,6 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
/****************************************************************************/
int int
__math_init(void) __math_init(void)
{ {

View File

@@ -1,90 +0,0 @@
/*
* $Id: stdlib_mem_debug.h,v 1.2 2005-01-02 09:07:18 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _STDLIB_MEM_DEBUG_H
#define _STDLIB_MEM_DEBUG_H
/****************************************************************************/
/*
* Uncomment this to build a library which has the memory debugging features
* enabled.
*/
/*#define __MEM_DEBUG */
/****************************************************************************/
/*
* Uncomment this to see reports of where and how much memory is allocated
* or released.
*/
/*#define __MEM_DEBUG_LOG*/
/****************************************************************************/
/*
* Uncomment this to speed up memory data maintenance operations when
* the memory debugging mode is enabled.
*/
/*#define __USE_MEM_TREES*/
/****************************************************************************/
/*
* Memory debugging parameters; note that the head/tail size must be
* multiples of four, or you will break code that depends upon malloc()
* and friends to return long word aligned data structures! Better
* still, there are assert()s in the library which will blow your code
* out of the water if the data returned by malloc() and realloc() is
* not long word aligned...
*/
#define MALLOC_HEAD_SIZE 512 /* How many bytes to allocate in front of
each memory chunk */
#define MALLOC_TAIL_SIZE 512 /* How many bytes to allocate behind each
memory chunk */
/****************************************************************************/
#define MALLOC_NEW_FILL 0xA3 /* The byte value to fill newly created
memory allocations with */
#define MALLOC_FREE_FILL 0xA5 /* The byte value to fill freed memory
allocations with */
#define MALLOC_HEAD_FILL 0xA7 /* The byte value to fill the memory in
front of each allocation with */
#define MALLOC_TAIL_FILL 0xA9 /* The byte value to fill the memory behind
each allocation with */
/****************************************************************************/
#endif /* _STDLIB_MEM_DEBUG_H */

236
library/stdlib_memory.h Normal file
View File

@@ -0,0 +1,236 @@
/*
* $Id: stdlib_memory.h,v 1.1 2005-03-18 12:38:24 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2005 by Olaf Barthel <olsen@sourcery.han.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Neither the name of Olaf Barthel nor the names of contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _STDLIB_MEMORY_H
#define _STDLIB_MEMORY_H
/****************************************************************************/
/*
* Uncomment this to build a library which has the memory debugging features
* enabled.
*/
/*#define __MEM_DEBUG */
/****************************************************************************/
/*
* Uncomment this to see reports of where and how much memory is allocated
* or released.
*/
/*#define __MEM_DEBUG_LOG*/
/****************************************************************************/
/*
* Uncomment this to speed up memory data maintenance operations when
* the memory debugging mode is enabled.
*/
/*#define __USE_MEM_TREES*/
/****************************************************************************/
/*
* Memory debugging parameters; note that the head/tail size must be
* multiples of four, or you will break code that depends upon malloc()
* and friends to return long word aligned data structures! Better
* still, there are assert()s in the library which will blow your code
* out of the water if the data returned by malloc() and realloc() is
* not long word aligned...
*/
#define MALLOC_HEAD_SIZE 512 /* How many bytes to allocate in front of
each memory chunk */
#define MALLOC_TAIL_SIZE 512 /* How many bytes to allocate behind each
memory chunk */
/****************************************************************************/
#define MALLOC_NEW_FILL 0xA3 /* The byte value to fill newly created
memory allocations with */
#define MALLOC_FREE_FILL 0xA5 /* The byte value to fill freed memory
allocations with */
#define MALLOC_HEAD_FILL 0xA7 /* The byte value to fill the memory in
front of each allocation with */
#define MALLOC_TAIL_FILL 0xA9 /* The byte value to fill the memory behind
each allocation with */
/****************************************************************************/
#ifndef EXEC_MEMORY_H
#include <exec/memory.h>
#endif /* EXEC_MEMORY_H */
#ifndef EXEC_NODES_H
#include <exec/nodes.h>
#endif /* EXEC_NODES_H */
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h"
#endif /* _MACROS_H */
/****************************************************************************/
#include <stddef.h>
/****************************************************************************/
/* We shuffle things around a bit for the debug code. This works by joining
related code which shares the same name. The debug code symbols also have
to be completely separate from the "regular" code. */
#if defined(__MEM_DEBUG)
#define __static
#define __alloca_cleanup __alloca_cleanup_debug
#define __find_memory_node __find_memory_node_debug
#define __free_memory_node __free_memory_node_debug
#define __force_free __force_free_debug
#define __get_allocation_size __get_allocation_size_debug
#define __allocate_memory __allocate_memory_debug
#define __memory_pool __memory_pool_debug
#define __memory_list __memory_list_debug
#define __vasprintf_hook_entry __vasprintf_hook_entry_debug
extern void * __alloca(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 * __malloc(size_t size,const char * file,int line);
extern void * __realloc(void *ptr,size_t size,const char * file,int line);
extern char * __strdup(const char *s,const char * file,int line);
extern char * __getcwd(char * buffer,size_t buffer_size,const char *file,int line);
#else
#define __static STATIC
#define __free(mem,file,line) free(mem)
#define __malloc(size,file,line) malloc(size)
#endif /* __MEM_DEBUG */
/****************************************************************************/
struct MemoryNode
{
struct MinNode mn_MinNode;
size_t mn_Size;
UBYTE mn_NeverFree;
#ifdef __MEM_DEBUG
UBYTE mn_AlreadyFree;
UBYTE mn_Pad0[2];
void * mn_Allocation;
size_t mn_AllocationSize;
char * mn_FreeFile;
int mn_FreeLine;
char * mn_File;
int mn_Line;
#ifdef __USE_MEM_TREES
struct MemoryNode * mn_Left;
struct MemoryNode * mn_Right;
struct MemoryNode * mn_Parent;
UBYTE mn_IsRed;
UBYTE mn_Pad1[3];
#endif /* __USE_MEM_TREES */
#else
UBYTE mn_Pad0[3];
#endif /* __MEM_DEBUG */
};
#ifdef __USE_MEM_TREES
struct MemoryTree
{
struct MemoryNode * mt_Root;
struct MemoryNode mt_RootNode;
struct MemoryNode mt_NullNode;
};
#endif /* __USE_MEM_TREES */
/****************************************************************************/
extern struct MemoryTree NOCOMMON __memory_tree;
extern struct MinList NOCOMMON __memory_list;
extern APTR NOCOMMON __memory_pool;
/****************************************************************************/
extern unsigned long NOCOMMON __maximum_memory_allocated;
extern unsigned long NOCOMMON __current_memory_allocated;
extern unsigned long NOCOMMON __maximum_num_memory_chunks_allocated;
extern unsigned long NOCOMMON __current_num_memory_chunks_allocated;
/****************************************************************************/
extern int NOCOMMON __default_pool_size;
extern int NOCOMMON __default_puddle_size;
/****************************************************************************/
#if defined(__THREAD_SAFE)
/****************************************************************************/
extern void __memory_lock(void);
extern void __memory_unlock(void);
/****************************************************************************/
#else
/****************************************************************************/
#define __memory_lock() ((void)0)
#define __memory_unlock() ((void)0)
/****************************************************************************/
#endif /* __THREAD_SAFE */
/****************************************************************************/
#endif /* _STDLIB_MEMORY_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_socket.c,v 1.3 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_profile.h,v 1.1 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,14 +31,44 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_PROFILE_H
#include "stdlib_headers.h" #define _STDLIB_PROFILE_H
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
int /* Magic macros for code profiling, SAS/C style. Normally, you would find
__socket_init(void) these in <sprof.h>, which is SAS/C-specific. */
{
return(OK); /****************************************************************************/
}
#ifdef __SASC
/****************************************************************************/
extern void ASM _PROLOG(REG(a0,char *));
extern void ASM _EPILOG(REG(a0,char *));
#if _PROFILE
#define PROFILE_OFF() _PROLOG(0L)
#define PROFILE_ON() _EPILOG(0L)
#else
#define PROFILE_OFF() ((void)0)
#define PROFILE_ON() ((void)0)
#endif /* _PROFILE */
/****************************************************************************/
#else
/****************************************************************************/
#define PROFILE_OFF() ((void)0)
#define PROFILE_ON() ((void)0)
/****************************************************************************/
#endif /* __SASC */
/****************************************************************************/
#endif /* _STDLIB_PROFILE_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_protos.h,v 1.12 2005-03-07 11:16:43 obarthel Exp $ * $Id: stdlib_protos.h,v 1.13 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,13 +48,13 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_MEMORY_H
/* Forward declarations */ /* Forward declarations */
struct MemoryNode; struct MemoryNode;
struct MemoryTree; struct MemoryTree;
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_MEMORY_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_realloc.c,v 1.5 2005-02-03 16:56:17 obarthel Exp $ * $Id: stdlib_realloc.c,v 1.6 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#undef realloc #undef realloc
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_red_black.c,v 1.3 2005-02-25 10:14:21 obarthel Exp $ * $Id: stdlib_red_black.c,v 1.4 2005-03-18 12:38:24 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#if defined(__USE_MEM_TREES) && defined(__MEM_DEBUG) #if defined(__USE_MEM_TREES) && defined(__MEM_DEBUG)
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_setenv.c,v 1.7 2005-02-28 10:07:32 obarthel Exp $ * $Id: stdlib_setenv.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,24 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_shell_escape.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_shell_escape.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_showerror.c,v 1.10 2005-03-07 14:04:09 obarthel Exp $ * $Id: stdlib_showerror.c,v 1.11 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,22 +31,38 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef INTUITION_INTUITION_H
#include <intuition/intuition.h> #include <intuition/intuition.h>
#endif /* INTUITION_INTUITION_H */
#ifndef DOS_DOS_H
#include <dos/dos.h> #include <dos/dos.h>
#endif /* DOS_DOS_H */
#ifndef WORKBENCH_STARTUP_H
#include <workbench/startup.h> #include <workbench/startup.h>
#endif /* WORKBENCH_STARTUP_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#define __NOLIBBASE__ #define __NOLIBBASE__
#define __NOGLOBALIFACE__ #define __NOGLOBALIFACE__
#ifndef PROTO_INTUITION_H
#include <proto/intuition.h> #include <proto/intuition.h>
#endif /* PROTO_INTUITION_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/
@@ -54,10 +70,6 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stack_usage.c,v 1.4 2005-03-11 18:27:27 obarthel Exp $ * $Id: stdlib_stack_usage.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -39,10 +39,6 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
/****************************************************************************/
static struct StackSwapStruct stack_swap_struct; static struct StackSwapStruct stack_swap_struct;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stackargbytes.c,v 1.2 2005-01-02 09:07:18 obarthel Exp $ * $Id: stdlib_stackargbytes.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stackcheck.c,v 1.7 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdlib_stackcheck.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stackextension.c,v 1.10 2005-03-12 14:10:09 obarthel Exp $ * $Id: stdlib_stackextension.c,v 1.11 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,6 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#if (defined(__GNUC__) && !defined(__PPC__)) #if (defined(__GNUC__) && !defined(__PPC__))
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stackminframe.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ * $Id: stdlib_stackminframe.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_stacksafezone.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ * $Id: stdlib_stacksafezone.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,7 +31,9 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef EXEC_TYPES_H
#include <exec/types.h> #include <exec/types.h>
#endif /* EXEC_TYPES_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_sysbase.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ * $Id: stdlib_sysbase.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -32,7 +32,10 @@
*/ */
#define __NOLIBBASE__ #define __NOLIBBASE__
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_system.c,v 1.4 2005-02-03 16:56:17 obarthel Exp $ * $Id: stdlib_system.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,18 +31,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
int int
system(const char * command) system(const char * command)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: stdlib_unsetenv.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ * $Id: stdlib_unsetenv.c,v 1.6 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: string_headers.h,v 1.4 2005-03-15 11:18:32 obarthel Exp $ * $Id: string_headers.h,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -52,8 +52,13 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: string_strdup.c,v 1.6 2005-02-03 16:56:17 obarthel Exp $ * $Id: string_strdup.c,v 1.7 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -49,6 +49,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: strings_headers.h,v 1.2 2005-01-02 09:07:19 obarthel Exp $ * $Id: strings_headers.h,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -44,8 +44,13 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _MACROS_H
#include "macros.h" #include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h" #include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: time_clock.c,v 1.5 2005-03-12 14:10:09 obarthel Exp $ * $Id: time_clock.c,v 1.6 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,6 +37,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
static struct DateStamp start_time; static struct DateStamp start_time;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: time_gettimeofday.c,v 1.7 2005-02-27 21:58:21 obarthel Exp $ * $Id: time_gettimeofday.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -49,7 +49,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_TIMER_H
#include <proto/timer.h> #include <proto/timer.h>
#endif /* PROTO_TIMER_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: time_headers.h,v 1.9 2005-01-30 09:37:59 obarthel Exp $ * $Id: time_headers.h,v 1.10 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -36,26 +36,49 @@
/****************************************************************************/ /****************************************************************************/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h> #include <exec/libraries.h>
#endif /* EXEC_LIBRARIES_H */
#ifndef EXEC_DEVICES_H
#include <exec/devices.h> #include <exec/devices.h>
#endif /* EXEC_DEVICES_H */
#ifndef EXEC_MEMORY_H
#include <exec/memory.h> #include <exec/memory.h>
#endif /* EXEC_MEMORY_H */
#ifndef DOS_DOSEXTENS_H
#include <dos/dosextens.h> #include <dos/dosextens.h>
#endif /* DOS_DOSEXTENS_H */
#ifndef DEVICES_TIMER_H
#include <devices/timer.h> #include <devices/timer.h>
#endif /* DEVICES_TIMER_H */
#ifndef LIBRARIES_LOCALE_H
#include <libraries/locale.h> #include <libraries/locale.h>
#endif /* LIBRARIES_LOCALE_H */
#ifndef UTILITY_DATE_H
#include <utility/date.h> #include <utility/date.h>
#endif /* UTILITY_DATE_H */
/****************************************************************************/ /****************************************************************************/
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h> #include <clib/alib_protos.h>
#endif /* CLIB_ALIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_EXEC_H
#include <proto/exec.h> #include <proto/exec.h>
#endif /* PROTO_EXEC_H */
#ifndef PROTO_DOS_H
#include <proto/dos.h> #include <proto/dos.h>
#endif /* PROTO_DOS_H */
/****************************************************************************/ /****************************************************************************/
@@ -73,17 +96,28 @@
/****************************************************************************/ /****************************************************************************/
#include "macros.h"
#include "debug.h"
/****************************************************************************/
#ifndef _MATH_FP_SUPPORT_H #ifndef _MATH_FP_SUPPORT_H
#include "math_fp_support.h" #include "math_fp_support.h"
#endif /* _MATH_FP_SUPPORT_H */ #endif /* _MATH_FP_SUPPORT_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
#ifndef _MACROS_H
#include "macros.h"
#endif /* _MACROS_H */
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/
/* This is the difference (in seconds) between the Unix epoch (which began /* This is the difference (in seconds) between the Unix epoch (which began
on January 1st, 1970) and the AmigaOS epoch (which began eight years on January 1st, 1970) and the AmigaOS epoch (which began eight years
later on January 1st 1978). */ later on January 1st 1978). */

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_chdir_exit.c,v 1.4 2005-03-11 13:23:18 obarthel Exp $ * $Id: unistd_chdir_exit.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,6 +37,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_getcwd.c,v 1.7 2005-02-28 10:07:32 obarthel Exp $ * $Id: unistd_getcwd.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,24 +37,22 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _UNISTD_HEADERS_H #ifndef _UNISTD_HEADERS_H
#include "unistd_headers.h" #include "unistd_headers.h"
#endif /* _UNISTD_HEADERS_H */ #endif /* _UNISTD_HEADERS_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_headers.h,v 1.6 2005-02-03 16:56:17 obarthel Exp $ * $Id: unistd_headers.h,v 1.7 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -48,6 +48,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
extern char NOCOMMON __current_path_name[MAXPATHLEN]; extern char NOCOMMON __current_path_name[MAXPATHLEN];
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_init_exit.c,v 1.10 2005-03-12 14:10:09 obarthel Exp $ * $Id: unistd_init_exit.c,v 1.11 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_time_delay.c,v 1.4 2005-01-30 09:37:59 obarthel Exp $ * $Id: unistd_time_delay.c,v 1.5 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,7 +37,9 @@
/****************************************************************************/ /****************************************************************************/
#ifndef PROTO_TIMER_H
#include <proto/timer.h> #include <proto/timer.h>
#endif /* PROTO_TIMER_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_timer.c,v 1.6 2005-03-12 14:10:09 obarthel Exp $ * $Id: unistd_timer.c,v 1.7 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -41,6 +41,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_unlink.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ * $Id: unistd_unlink.c,v 1.6 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -37,18 +37,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _UNISTD_HEADERS_H #ifndef _UNISTD_HEADERS_H
#include "unistd_headers.h" #include "unistd_headers.h"
#endif /* _UNISTD_HEADERS_H */ #endif /* _UNISTD_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: unistd_wildcard_expand.c,v 1.10 2005-03-03 09:32:09 obarthel Exp $ * $Id: unistd_wildcard_expand.c,v 1.11 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -31,23 +31,27 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _STDLIB_MEM_DEBUG_H
#include "stdlib_mem_debug.h"
#endif /* _STDLIB_MEM_DEBUG_H */
/****************************************************************************/
#ifndef _STDLIB_HEADERS_H #ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_MEMORY_H
#include "stdlib_memory.h"
#endif /* _STDLIB_MEMORY_H */
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/
#ifndef CLIB_ALIB_PROTOS_H
#include <clib/alib_protos.h> #include <clib/alib_protos.h>
#endif /* CLIB_ALIB_PROTOS_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: usergroup_headers.h,v 1.5 2005-01-02 09:07:19 obarthel Exp $ * $Id: usergroup_headers.h,v 1.6 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -42,6 +42,18 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_HEADERS_H
#include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */
/****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
extern struct Library * NOCOMMON __UserGroupBase; extern struct Library * NOCOMMON __UserGroupBase;
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: usergroup_init_exit.c,v 1.9 2005-03-12 14:10:09 obarthel Exp $ * $Id: usergroup_init_exit.c,v 1.10 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -41,7 +41,9 @@
/****************************************************************************/ /****************************************************************************/
#include "stdlib_protos.h" #ifndef _STDLIB_CONSTRUCTOR_H
#include "stdlib_constructor.h"
#endif /* _STDLIB_CONSTRUCTOR_H */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: utime_utime.c,v 1.7 2005-02-28 10:07:32 obarthel Exp $ * $Id: utime_utime.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -51,6 +51,12 @@
/****************************************************************************/ /****************************************************************************/
#ifndef _STDLIB_PROFILE_H
#include "stdlib_profile.h"
#endif /* _STDLIB_PROFILE_H */
/****************************************************************************/
/* The following is not part of the ISO 'C' (1994) standard. */ /* The following is not part of the ISO 'C' (1994) standard. */
/****************************************************************************/ /****************************************************************************/

View File

@@ -1,5 +1,5 @@
/* /*
* $Id: utsname_uname.c,v 1.2 2005-03-02 14:47:10 obarthel Exp $ * $Id: utsname_uname.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $
* *
* :ts=4 * :ts=4
* *
@@ -49,10 +49,6 @@
#include "stdlib_headers.h" #include "stdlib_headers.h"
#endif /* _STDLIB_HEADERS_H */ #endif /* _STDLIB_HEADERS_H */
#ifndef _DEBUG_H
#include "debug.h"
#endif /* _DEBUG_H */
/****************************************************************************/ /****************************************************************************/
#define OSNAME "AmigaOS" #define OSNAME "AmigaOS"