home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / FREDV19A.LHA / FrexxEd / fpl / QuitAndKill.FPL < prev    next >
Encoding:
Text File  |  1995-08-15  |  510 b   |  31 lines

  1. export int QuitAndKill_hook(int bufferid)
  2. {
  3.    int ret = 0;
  4.    int firstid = GetBufferID();
  5.    int id = firstid;
  6.    int numbufs = 0;
  7.  
  8.    if (!bufferid)
  9.    {
  10.       bufferid = GetBufferID();
  11.    }
  12.  
  13.    do
  14.    {
  15.       if(ReadInfo("type") & 1)
  16.          numbufs+=ReadInfo("shared");
  17.       id = NextBuffer(id);
  18.       if (id == firstid)
  19.       {
  20.      id = 0;
  21.       }
  22.    } while (id);
  23.  
  24.    if(numbufs == 1)
  25.    {
  26.       Clean("QuitAll();");
  27.    }
  28. }
  29.  
  30. Hook("Kill", "QuitAndKill_hook");     /* Patch Kill() with QuitAndKill_hook()! */
  31.