mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Moved all the constructor code out of "stdlib_init_exit.c" and into the
files which initialize global data, such as the new "stdlib_program_name.c" and "stdlib_malloc.c". - Until I can find a way to invoke it from within the library, the __machine_test() function is no longer invoked. - Tagged global data with NOCOMMON attributes. - Added the __lib_init() and __lib_exit() functions, which are part of the thread-safe library and which can be used to hook up clib2 with standard Amiga shared library/device code. Some documentation on how to use them can be found in the <dos.h> header file. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14999 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dos.h,v 1.9 2005-03-06 09:04:44 obarthel Exp $
|
||||
* $Id: dos.h,v 1.10 2005-07-03 10:36:48 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -52,6 +52,10 @@ extern "C" {
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef EXEC_LIBRARIES_H
|
||||
#include <exec/libraries.h>
|
||||
#endif /* EXEC_LIBRARIES_H */
|
||||
|
||||
#ifndef WORKBENCH_STARTUP_H
|
||||
#include <workbench/startup.h>
|
||||
#endif /* WORKBENCH_STARTUP_H */
|
||||
@ -328,6 +332,38 @@ extern int __translate_io_error_to_errno(LONG io_error);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/*
|
||||
* Routines for use with shared libraries: invoke __lib_init() in your own
|
||||
* shared library initialization function and __lib_exit() in your shared
|
||||
* library cleanup function.
|
||||
*
|
||||
* __lib_init() will initialize the global SysBase/DOSBase variables
|
||||
* (and the IExec/IDOS variables for OS4) and invoke the constructor
|
||||
* functions required by your library code. It returns FALSE upon
|
||||
* failure and TRUE otherwise. Make this the very first function you
|
||||
* call in your shared library initialization function. The __lib_init()
|
||||
* function expects to be called with a pointer to the exec.library
|
||||
* base, which is normally passed to your shared library as part of the
|
||||
* library startup code initialization performed by the operating
|
||||
* system.
|
||||
*
|
||||
* __lib_exit() will undo all the initializations performed by the
|
||||
* __lib_init() function, but leave the global SysBase variable
|
||||
* (and the IExec variable for OS4) intact. Make this the very last
|
||||
* function you call in your shared library cleanup function.
|
||||
*
|
||||
* Note that neither __lib_init() nor __lib_exit() are reentrant. You must
|
||||
* make sure that while you are calling them no other library user can
|
||||
* call them by accident.
|
||||
*
|
||||
* Both functions are only available as part of the thread-safe clib2
|
||||
* linker library.
|
||||
*/
|
||||
extern VOID __lib_exit(VOID);
|
||||
extern BOOL __lib_init(struct Library * SysBase);
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in New Issue
Block a user