home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Texteditors / FFRED10.LHA / fpl / WriteProtect.FPL < prev    next >
Encoding:
Text File  |  1994-10-26  |  2.0 KB  |  54 lines

  1. /*****************************************************************************
  2. ***************************************************************** Hook code **
  3. *****************************************************************************/
  4.  
  5. export int wp_IsProtected()
  6. {
  7.    ReturnStatus("Write protected!");
  8.    return(1);
  9. }
  10.  
  11. export int UpdateWFlag()
  12. {                    /* Set __wp according to 'w' protection bit */
  13.    SetInfo(-1,"__wp",(strstr(ReadInfo("protection"),"w")==-1));
  14.    return(0);
  15. }
  16.  
  17. /*****************************************************************************
  18. ********************************************************** No brain Hooking **
  19. *****************************************************************************/
  20.  
  21. Hook("DeleteEol", "wp_IsProtected();", "__wp");
  22.  
  23. Hook("Backspace","wp_IsProtected();","__wp");
  24. Hook("BackspaceWord","wp_IsProtected();","__wp");
  25. Hook("Delete","wp_IsProtected();","__wp");
  26. Hook("Clear","wp_IsProtected();","__wp");
  27. Hook("DownCase","wp_IsProtected();","__wp");
  28. Hook("SwapCase","wp_IsProtected();","__wp");
  29. Hook("UpCase","wp_IsProtected();","__wp");
  30. Hook("BlockMove","wp_IsProtected();","__wp");
  31. Hook("BlockPaste","wp_IsProtected();","__wp");
  32. Hook("BlockPasteRect","wp_IsProtected();","__wp");
  33. Hook("BlockSort","wp_IsProtected();","__wp");
  34. Hook("BlockCut","wp_IsProtected();","__wp");
  35. Hook("BlockCutAppend","wp_IsProtected();","__wp");
  36. Hook("BlockDelete","wp_IsProtected();","__wp");
  37. Hook("Output","wp_IsProtected();","__wp");
  38. Hook("Yank","wp_IsProtected();","__wp");
  39.  
  40.  
  41. /*****************************************************************************
  42. *********************************************************** Special Hooking **
  43. *****************************************************************************/
  44.  
  45. HookPast("Load","UpdateWFlag();","");
  46.  
  47.  
  48. /*****************************************************************************
  49. ********************************************************** Public variables **
  50. *****************************************************************************/
  51.  
  52. ConstructInfo("__wp","","", "LBH", "",0,1,0);
  53.  
  54.