home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / W / WWIVEDIT / DOC / EMP-HANG.MOD < prev    next >
Text File  |  1992-09-22  |  2KB  |  44 lines

  1. Filename: EMP-HANG.MOD
  2. Authors:  Adam Caldwell (1@6470 Net, 1@16470 Link) and Wayne Bell (1@1 Net)
  3. Purpose:  This provides a way for a program which performs its I/O through DOS
  4.           to be signaled of a hangup.
  5. Written for: WWIV 4.21a - Will probably work with 4.2x with no prob, and 4.1x
  6.              with a little effort.  This code will be obsolete for WWIV 4.22.
  7.  
  8. In Extern.C, int newintr() make the noted changes:
  9.  
  10.     checkhangup();
  11.     if (hangup) {
  12.       if (hanguptime1<0L) {
  13.         hanguptime1=timer1();
  14.         if (funcs[20]) {                         /* Add */
  15.           outs("Terminating...\r\n");            /* Add */
  16.           ip=FP_OFF(funcs[20]);                  /* Add */
  17.           cs=FP_SEG(funcs[20]);                  /* Add */
  18.           funcs[20]=(void far *)36;              /* Add */
  19.         } else {                                 /* Add */
  20.           outs("Aborting...\r\n");               /* Existing line... indent */
  21.           ni_r.x.ax=0x4c00;                      /* ditto */
  22.           int86x(save_dos,&ni_r,&ni_r,&ni_s);    /* ditto */
  23.         }                                        /* Add */
  24.       } else {
  25.         if (((unsigned long) funcs[20])>500)                 /* Add */
  26.           funcs[20]=(void far *)36;                          /* Add */
  27.         if (labs(timer1()-hanguptime1)>(long)funcs[20]) {    /* Modify */
  28.           hanguptime1=timer1(); 
  29.           outs("Aborting...\r\n"); 
  30.           ni_r.x.ax=0x4c00;
  31.           int86x(save_dos,&ni_r,&ni_r,&ni_s);
  32.         }
  33.       }
  34.     }
  35.  
  36.  
  37. Now, in do_it(char *cl), add the line noted:
  38.  
  39.   ss[i]=NULL;
  40.   i=spawnvpe(P_WAIT,ss[0],ss,xenviron);
  41.   funcs[20]=NULL;                             /* Add */
  42.  
  43. That's all there is to it...
  44.