home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / mapi / win16 / dev / cmccli / pvalloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  860 b   |  49 lines

  1. /*
  2.  -  P V A L L O C . H
  3.  -
  4.  *  Purpose:
  5.  *      Header file for sample memory manager.  Provides chained
  6.  *      memory data structures.
  7.  *
  8.  */
  9.  
  10. #ifndef __PVALLOC_H__
  11. #define __PVALLOC_H__
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. #define pvNull NULL
  18.  
  19. typedef unsigned long CB;
  20. typedef void FAR * PV;
  21. typedef char FAR * SZ;
  22. typedef BYTE FAR * PB;
  23.  
  24. /* Memory allocation node */
  25.  
  26. typedef struct
  27. {
  28.     HANDLE  hMem;
  29.     CB      cbSize;
  30.     PV      lpvNext;
  31.     PV      lpvBuf;
  32.     CB      ulBlockNum;
  33. } PVINFO, * PPVINFO;
  34.  
  35. #define cbPvMax (65520L-sizeof(PVINFO))
  36. #define cbPvMin (1024L-sizeof(PVINFO))
  37.  
  38. /* Memory manager function prototypes */
  39.  
  40. PV   PvAlloc(CB cbSize);
  41. PV   PvAllocMore(CB cbSize, PV lpvParent);
  42. BOOL PvFree(PV lpv);
  43.  
  44. #ifdef __cplusplus
  45. }       /* extern "C" */
  46. #endif
  47.  
  48. #endif  /* __PVALLOC_H__ */
  49.