/*PDSA_DEFS.H of 8-Mar-1994 16-May-1991. PAE. Initial version. This is include file for structure definitions for portable dynamic storage routines. 23-May-1991. PAE. Add codes for int/ext memory 12-Dec-1992. PAE. Need the extra stuff to get size_t definition. 6-Jan-1993. PAE. Also need size_t in VOS[/vms only?] case 13-Aug-1993. PAE. Only define size_t if we have to. Allow for native_vms 7-Sep-1993. PAE. Add in the function profiles 8-sep-1993. PAE. Take care with 'standard' includes! 8-Mar-1994. PAE. with ultra C - try something for OS9 */ #include #ifdef __STDC__ #include #include #ifndef _POSIX_SOURCE #ifndef OS9 #include #endif #endif #endif #ifdef _POSIX_SOURCE #include #include #endif #ifdef OSK /*defult in C2.3, not ultra c*/ typedef int size_t ; #endif /*define the header for the stuff in shared memory. After the header will come the bitmap, and then the data space*/ struct pdsa_header { int size ; /* size of memory available to user*/ int quantum ; /*allocation unit*/ int mode ; /*internal/external*/ int item ; /* might contain address or rounding factor */ int base ; /* relative if internal; pointer if external*/ int freebits ; /*number of free bits*/ int maplen ; /*sie of the bitmap*/ } ; /*define a structure to make it easy to access everything*/ /*this will be set up per process and so can contain pointers*/ struct pdsa_ptr { struct pdsa_header *header; char *bitmap ; char *memory ; /*points to real memory*/ } ; /*define some symbolic codes*/ #define PDSA_INTERNAL 1 #define PDSA_EXTERNAL 2 /* Function profiles for the pdsa_ routines */ #ifdef __STDC__ extern void pdsa_attach(char *name, struct pdsa_ptr *uptr) ; extern void pdsa_detach( struct pdsa_header *uptr) ; extern int pdsa_free(char **begadr, char **endadr, struct pdsa_ptr *uptr) ; extern int pdsa_get(int *numbytes, char **address, struct pdsa_ptr *uptr) ; extern int pdsa_init(char *name, int size, int quantum, int mode, int item) ; #else extern void pdsa_attach(); extern void pdsa_detach(); extern int pdsa_free(); extern int pdsa_get(); extern int pdsa_init(); #endif /*end of pdsa_defs.h */