home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / SMALL_C / AVAIL.C < prev    next >
Text File  |  1987-10-04  |  512b  |  18 lines

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