home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 328_02 / wsysrqa.c < prev    next >
C/C++ Source or Header  |  1991-03-17  |  804b  |  33 lines

  1. /* wsysrqa.c - code for wSysRq_ask()
  2.  *     this is a sample 'stub' function for insertion into the SysRq interrupt 
  3.  *     This funtion asks 'do you want to quit'
  4.  *  and quits if the answer is yes.
  5.  */
  6.  
  7. #include "wsys.h"
  8.  
  9.  
  10. void wSysRq_ask (void)
  11.     {
  12.     register int key;
  13.  
  14.     wflush_kbd();
  15.  
  16.     wopen (15,2,50,5,YELLOW+(RED<<4),SPECKLE_BORDER,YELLOW+(RED<<4),WSAVE2RAM);
  17.     wtitle ( " SysRq ");
  18.     wputs (    "\n              CTRL_C to quit program"        
  19.             "\n         ENTER and ALT-SysRq to continue"
  20.             "\n" 
  21.             "\n  Remember to press ALT-SysRq to unlock keyboard" );
  22.     
  23.     while ( ! ( (key=wread_kbd())  == CTRL('C') || key == ENTER) );
  24.  
  25.     if (key == CTRL('C')) exit (0);
  26.     
  27.     wclose();
  28.     
  29.     return;        /* wSysRq_ask */
  30.     }
  31.  
  32. /*---------------------- end of wsysrqa.c -------------------------*/
  33.