home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / PCRESEXT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  772 b   |  32 lines

  1. /**
  2. *
  3. * Name        pcresext -- Exit but stay resident
  4. *
  5. * Synopsis    pcresext(excode);
  6. *
  7. *        int excode;      Exit code to return to DOS
  8. *
  9. * Description    This function terminates the current process but makes
  10. *        the program resident as part of DOS.  The value of
  11. *        excode is passed to DOS (or to the parent process) and
  12. *        may be inspected with either the ERRORLEVEL command or
  13. *        by the PCWAIT function.
  14. *
  15. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  16. *
  17. **/
  18.  
  19. #include <bmemory.h>
  20. #include <bprogctl.h>
  21. #include <butility.h>
  22.  
  23. void pcresext(excode)
  24. int excode;
  25. {
  26.     DOSREG   reg;
  27.  
  28.     reg.ax = utbyword(0x31,excode);   /* DOS function 0x31          */
  29.     mmshrink(®.dx);              /* Get the program size          */
  30.     dos(®);
  31. }
  32.