home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol2 / ii-65 / restoreshell.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  1KB  |  43 lines

  1. ;/* RestoreShell.c - Execute me to compile me with SAS/C 6.56
  2. ; (c)  Copyright 1992 Commodore-Amiga, Inc.   All rights reserved.
  3. ; The information contained herein is subject to change without notice,
  4. ; and is provided "as is" without warranty of any kind, either expressed
  5. ; or implied.  The entire risk as to the use of this information is
  6. ; assumed by the user.
  7. ;
  8. sc DATA=NEAR NMINC STRMERGE NOSTKCHK NODEBUG IGNORE=73 RestoreShell.c
  9. slink FROM lib:c.o RestoreShell.o TO RestoreShell LIBRARY lib:sc.lib lib:amiga.lib smallcode smalldata
  10. quit
  11. */
  12. /* restore the BootShell as the UserShell.  Note that this
  13.    only switches back the BootShell, it does not unload the
  14.    current user shell ("shell" on the resident list) as it
  15.    is possible that some instance of it can still be running.
  16. */
  17. #include <exec/types.h>
  18. #include <dos/dosextens.h>
  19. #include <clib/exec_protos.h>
  20. #include <clib/dos_protos.h>
  21.  
  22. #ifdef LATTICE
  23. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  24. int chkabort(void) { return(0); }
  25. #endif
  26.  
  27. UBYTE *vers = "\0$VER: RestoreShell 1.0";
  28.  
  29. void main(void)
  30. {
  31.     struct Segment
  32.         *bootshell_seg,
  33.         *shell_seg;
  34.  
  35.     Forbid();
  36.     shell_seg = FindSegment("shell", NULL, CMD_SYSTEM);
  37.     bootshell_seg = FindSegment("bootshell", NULL, CMD_SYSTEM);
  38.     if (bootshell_seg)
  39.         shell_seg->seg_Seg = bootshell_seg->seg_Seg;
  40.     Permit();
  41. }
  42.  
  43.