home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / p / sclib2.lbr / AVAIL.CZ / AVAIL.C
Encoding:
C/C++ Source or Header  |  1993-10-25  |  512 b   |  20 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** Return the number of bytes of available memory.
  4. ** In case of a stack overflow condition, if 'abort'
  5. ** is non-zero the program aborts with an 'S' clue,
  6. ** otherwise zero is returned.
  7. */
  8.  
  9. external char *zzmem
  10.  
  11. avail(aburt) int aburt; {
  12.   char x;
  13.   if(&x < zzmem) {
  14.     if(aburt) abort('M');
  15.     return (0);
  16.     }
  17.   return (&x - zzmem);
  18.   }
  19.  
  20.