/* librock/prcl.h - - - - - - - - - - - - Copyright Notice - - - - - - - - - - - - Copyright 1998 Forrest J. Cavalier III See http://www.mibsoftware.com/librock/ for documentation and original copies of this software. This software shall be distributed with the implementation source code according to the license terms therein. */ #ifndef librock_INC_PRCL_H #define librock_INC_PRCL_H #ifdef librock_EXPERIMENTAL_PRCL_x001 /* 2002-01-26 */ /**************************************************************/ /**************************************************************/ #if 0 struct librock_PRCL_s { struct librock_PRCL_s librock_PTR *link; unsigned size; /* Size in bytes */ void librock_PTR *pNextAlloc;/* Next allocation point */ /* Immediately followed by data */ }; #endif struct librock_PRCL_s { struct librock_PRCLseg_s *pSegList; int cSegsUsed; int cSegsAlloc; }; struct librock_PRCLseg_s { char librock_PTR *pMemAlloc; char librock_PTR *pLastAlloc; char librock_PTR *pFirstUsed; char librock_PTR *pNextUse; }; struct librock_PRCL_s librock_PTR *librock_PRCLgraft(struct librock_PRCL_s librock_PTR * librock_PTR *ppPRCL, /* Pointer to pointer to heap */ unsigned allocsize); int librock_PRCLfreeall(struct librock_PRCL_s librock_PTR * librock_PTR *ph); void librock_PTR *librock_PRCLperm(struct librock_PRCL_s librock_PTR * librock_PTR *ph,unsigned size); void librock_PTR *librock_PRCLpermcpy(struct librock_PRCL_s librock_PTR * librock_PTR *ph,const void librock_PTR *m,unsigned size); #ifdef __cplusplus #define librock_CPRCL librock_CPRCL_x001 class librock_CPRCL { /* Wrapper for PRCL_t */ /* Made librock_PTR 6-28-96 */ protected: struct librock_PRCL_s librock_PTR *m_prcl; public: librock_CPRCL() { m_prcl = 0; }; ~librock_CPRCL() { PRCLfreeall(); m_prcl = 0; }; void librock_PTR *PRCLperm(unsigned size) { return ::librock_PRCLperm(&m_prcl,size); }; void librock_PTR *PRCLpermcpy(const void librock_PTR *m,unsigned size) { return ::librock_PRCLpermcpy(&m_prcl,m,size); }; int PRCLfreeall() { int ret = ::librock_PRCLfreeall(&m_prcl); m_prcl = 0; return ret; } }; #undef librock_CPRCL #endif /* __cplusplus */ #endif #endif /* $Log: prcl.h,v $ Revision 1.3 2002/02/10 02:54:38 forrest@mibsoftware.com rights=#1 Standardized chg log, fix __cplusplus bracketing. Revision 1.2 2002/01/29 20:20:52 forrest@mibsoftware.com rights=#1 bracketed with librock_EXPERIMENTAL Revision 1.1 2002/01/29 13:53:09 forrest@mibsoftware.com rights=#1 Initial rights#1 Copyright (c) Forrest J Cavalier III d-b-a Mib Software rights#1 License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */