home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classsource.lha / ClassSource / Utility / hooks.c next >
Encoding:
C/C++ Source or Header  |  1995-02-12  |  630 b   |  40 lines

  1. #include <classes/Utility/Hooks.h>
  2.  
  3. #include <pragma/utility_lib.h>
  4.  
  5. #include <linkerfunc.h>
  6.  
  7. HookC::HookC(APTR data)
  8. {
  9.     h_Entry = (ULONG (*) ()) &hookEntry;
  10.     h_SubEntry = NULL;
  11.     h_Data = data;
  12. }
  13.  
  14. HookC &HookC::operator = (const HookC &s)
  15. {
  16.     if (this != &s)
  17.     {
  18.         h_SubEntry = s.h_SubEntry;
  19.         h_Data = s.h_Data;
  20.     };
  21.     return *this;
  22. }
  23.  
  24. ULONG HookC::hook(APTR object, APTR paramPkt)
  25. {
  26.     return 0;
  27. }
  28.  
  29. ULONG HookC::call(APTR object, APTR paramPkt)
  30. {
  31.     return CallHookPkt(this,object,paramPkt);
  32. }
  33.  
  34. ULONG HookC::hookEntry(register __a0 struct Hook *h,
  35.     register __a2 APTR o, register __a1 APTR msg)
  36. {
  37.     return ((HookC *) h)->hook(o,msg);
  38. }
  39.  
  40.