home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / hang.c < prev    next >
C/C++ Source or Header  |  1993-10-14  |  2KB  |  72 lines

  1. /*
  2.  * File......: HANG.C
  3.  * Author....: Dave Pearson
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Dave Pearson
  7.  * Date......: $Date$
  8.  * Revision..: $Revision$
  9.  * Log file..: $Logfile$
  10.  *
  11.  * This is an original work by Dave Pearson and is placed in the public
  12.  * domain.
  13.  *
  14.  * Modification history:
  15.  * ---------------------
  16.  *
  17.  * $Log$
  18.  *
  19.  */
  20.  
  21. // NOTE: This code has been written for and compiled with Borland C++
  22. //       Version 3.1
  23. //
  24.  
  25. #include <extend.h>
  26.  
  27. /*  $DOC$
  28.  *  $FUNCNAME$
  29.  *      GT_HANG()
  30.  *  $CATEGORY$
  31.  *      General
  32.  *  $ONELINER$
  33.  *      Hang the computer.
  34.  *  $SYNTAX$
  35.  *      GT_Hang([<lAllowCtrlAltDel>]) --> <ThisNeverReturns!>
  36.  *  $ARGUMENTS$
  37.  *      <lAllowCtrlAltDel> is an optional logical value. If true (.T.)
  38.  *      the user will be able to use Ctrl-Alt-Del to reset the machine,
  39.  *      if false (.F.) the user will have to turn the machine off.
  40.  *      The deafult value is .F.
  41.  *  $RETURNS$
  42.  *      This function should never return!
  43.  *  $DESCRIPTION$
  44.  *      Err.... I'm sure that one of you will find a use for this! <g>
  45.  *  $EXAMPLES$
  46.  *      // Get the user to log into the system, if the login is invalid
  47.  *      // hang the machine.
  48.  *
  49.  *      if SysLogin()
  50.  *         RunSystem()
  51.  *      else
  52.  *         GT_Hang()
  53.  *      endif
  54.  *  $END$
  55.  */
  56.  
  57. CLIPPER GT_Hang()
  58. {
  59.         Boolean AllowCtrlAltDel = FALSE;
  60.  
  61.         if (PCOUNT >= 1 && ISLOG(1))
  62.         {
  63.                 AllowCtrlAltDel = _parl(1);
  64.         }
  65.         if (!AllowCtrlAltDel)
  66.         {
  67.                 asm     Cli
  68.         }
  69. HangLoop:
  70.         asm     Jmp     HangLoop
  71. }
  72.