home *** CD-ROM | disk | FTP | other *** search
- #ifndef __INC_POS_PEXEC_LIBRARY_H
- #define __INC_POS_PEXEC_LIBRARY_H
- /*******************************************************************
- Includes Release 24
- (C) Copyright 1995-1997 proDAD
- All Rights Reserved
-
- $AUT Holger Burkarth
- $DAT >>Library.h<< 05 Aug 1996 12:43:07 - (C) ProDAD
- *******************************************************************/
- #ifndef __INC_POS_PEXEC_LIST_H
- #include <pExec/List.h>
- #endif
-
- /*----------------------------------
- -----------------------------------*/
- struct pOS_LibraryFunction
- {
- ULONG (*func)(_R_LB struct pOS_Library*,...);
- UBYTE _d[8];
- };
-
-
- /*----------------------------------
- -----------------------------------*/
- struct pOS_Library
- {
- struct pOS_ExNode lib_Node;
- ULONG lib_Flags; /* (enum pOS_LibraryFlags) */
- UWORD lib_NegSize; /* number of bytes before library */
- UWORD lib_PosSize; /* number of bytes after library */
- UWORD lib_Version; /* major */
- UWORD lib_Revision; /* minor */
- const CHAR *lib_IdString; /* ASCII Identification */
- const struct pOS_TagItem *lib_Describe; /* */
- ULONG lib_Sum; /* the Checksum itself */
- UWORD lib_OpenCnt; /* number of current opens */
- struct pOS_SegmentLst *lib_Segm;
- UWORD lib_pad1;
- };
-
-
-
- enum pOS_LibraryFlags
- {
- LIBF_SUMMING =0x01, /* we are currently checksumming */
- LIBF_CHANGED =0x02, /* we have just changed the lib */
- LIBF_SUMUSED =0x04, /* set if we should bother to sum */
- LIBF_DELEXP =0x08, /* delayed expunge */
-
- LIBF_ROM =0x20, /* Lib is RomLib */
- /** 0x80 => reserved in resident **/
-
- LIBF_Unique =0x1000, /* Lib wird geklont, kein Multi-Open erlaubt */
- LIBF_DevAsLib =0x2000, /* Device kann als Library geöffnet werden */
- };
-
-
-
- /*----------------------------------
- Rückwärtsgerichtete Struktur, LibBase
- steht auf das Ende der Struct.
- -----------------------------------*/
- struct pOS_StdLibraryFunction
- {
- struct pOS_LibraryFunction Reserved[8];
-
- struct pOS_SegmentLst* (*Expunge_func)(_R_LB struct pOS_Library*);
- UBYTE _d3[8];
- VOID (*Close_func)(_R_LB struct pOS_Library*);
- UBYTE _d2[8];
- BOOL (*Open_func)(_R_LB struct pOS_Library*);
- UBYTE _d1[8];
- }; /* => LibBase */
-
-
- #define _pOS_GetStdLibraryFunction(lib) \
- ( (struct pOS_StdLibraryFunction*)((ULONG)(lib) - sizeof(struct pOS_StdLibraryFunction)) )
-
- #define _pOS_GetLibraryFunction(lib,index) \
- ( (struct pOS_LibraryFunction*)((ULONG)(lib) - (index)*sizeof(struct pOS_LibraryFunction)) )
-
- #define _pOS_GetStdLibFunc(type,lib) \
- ( (type*)((ULONG)(lib) - sizeof(type)) )
-
-
-
-
-
-
-
-
- /*----------------------------------
- -----------------------------------*/
- struct pOS_ResidentLibInit
- {
- size_t lit_DataSize; /* library data space size */
- __CONST__ ULONG **lit_FuncTable; /* table of entry points */
- VOID *lit_DataInit; /* table of data initializers */
- BOOL (*lit_InitFunc)(_R_LB struct pOS_ExecBase*,_R_A0 struct pOS_Library*); /* initialization function to run */
- UBYTE lit_Reserved[8];
- };
-
-
-
- enum pOS_LibraryFuncID
- {
- LIBFUNCID_Base = 0xffffff00, /** z.B. (ULONG*)(LIBFUNCID_Base | LIBFUNCID_Reverse) **/
- LIBFUNCID_Reverse = 0x80,
- };
-
-
- /*********************************/
-
- #define _pOS_FreeLibraryMem(exec,lib) \
- pOS_FreeMem(exec,(APTR)((ULONG)(lib)-(lib)->lib_NegSize),(lib)->lib_NegSize+(lib)->lib_PosSize);
-
- #define _pOS_FreeLibraryMem2(lib) \
- pOS_FreeMem((APTR)((ULONG)(lib)-(lib)->lib_NegSize),(lib)->lib_NegSize+(lib)->lib_PosSize);
-
-
- #endif
-