home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_03 / 2n03071a < prev    next >
Text File  |  1991-01-14  |  2KB  |  59 lines

  1. /*  PUSH_POP.h   */
  2.  
  3. #define  word   unsigned int
  4. #define  byte   unsigned char
  5.  
  6. #define  low(X)  ((byte) X)
  7. #define  high(X) ((byte) (X>>8))
  8.  
  9. #define  Signature 0xCb4b
  10.  
  11. /* 
  12.     Note that the structure below defines the memory control
  13.     block (MCB) used by MS-DOS.  This is an undocumented
  14.     structure.  Through out Push.C and Pop.C the block[] array
  15.     is used instead of the MCB structure because, although the
  16.     structure is correct, Microsoft Quick C does not allow the
  17.     structure to be packed.  As a result the MCB flag occupies
  18.     two bytes and thus makes the offsets of all of the other
  19.     variables incorrect.
  20. */
  21.  
  22. union   {
  23.     byte    block[17];
  24.     struct  {
  25.         char    flag;
  26.         word    owner;
  27.         word    length;
  28.         byte    reserved[3];
  29.         byte    process_name[8];
  30.         char    path;
  31.         }       MCB;
  32.     }       far *mem;
  33.  
  34.                     /*  MCB flag value indicating the   */
  35.                     /*    end of the chain of MCBs      */
  36. #define end_of_MCB   0x5A    
  37.  
  38.                     /*  MCB flag value indicating that  */
  39.                     /*    this control block is in the  */
  40.                     /*    MCB, but is not the end       */
  41. #define chain_of_MCB 0x4D
  42.  
  43.                     /*  Allocate memory from the first  */
  44.                     /*    block of memory that fits.    */
  45.                     /*    (Bottom-Up)                   */
  46. #define _allocate_first 0
  47.  
  48.                     /*  Find the best fit for the memory*/
  49.                     /*    block with the requested size */
  50. #define _allocate_best  1
  51.  
  52.                     /*  Allocate memory from the last   */
  53.                     /*    block of memory that fits.    */
  54.                     /*    (Top-Down)                    */
  55. #define _allocate_last  2
  56.  
  57. int     _dos_getmemmode(void);
  58. void    _dos_setmemmode(int strategy);
  59.