home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / SMC21LIB.LZH / EXIT.C < prev    next >
Text File  |  2000-06-30  |  512b  |  21 lines

  1.  
  2. #define NOCCARGC
  3. #include stdio.h
  4. #include clib.def
  5. /*
  6. ** Close all open files and exit to CP/M.
  7. ** Entry: errcode = Character to be sent to stderr.
  8. ** Returns to CP/M rather than caller.
  9. */
  10. exit(errcode) char errcode; {
  11.   int fd;
  12.   if(errcode) _conout(errcode);
  13.   for(fd=0; fd < MAXFILES; fclose(fd++));
  14.   _bdos(GOCPM, NULL);
  15.   }
  16.  
  17. #asm
  18. abort   equ   exit
  19.         entry abort
  20. #endasm
  21.