home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / alib / hookentry.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.5 KB  |  61 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: hookentry.c,v 1.2 1997/01/27 00:16:37 ldp Exp $
  4.  
  5.     Desc: amiga.lib function HookEntry()
  6.     Lang: english
  7. */
  8. #include <aros/system.h>
  9. #include <stdarg.h>
  10. #include "alib_intern.h"
  11.  
  12. /******************************************************************************
  13.  
  14.     NAME */
  15. #include <aros/asmcall.h>
  16. #include <proto/alib.h>
  17.  
  18.     AROS_UFH3(IPTR, HookEntry,
  19.  
  20. /*  SYNOPSIS */
  21.     AROS_UFHA(struct Hook *, hook,   A0),
  22.     AROS_UFHA(APTR,          object, A2),
  23.     AROS_UFHA(APTR,          param,  A1))
  24.  
  25. /*  FUNCTION
  26.     Some high level languages (HLL) don't allow to pass arguments in
  27.     registers. For these HLLs, it's not possible to call a hook
  28.     directly. To use hooks with these HLLs, you must put HookEntry into
  29.     hook->h_Entry and the real callback function into hook->h_SubEntry.
  30.     HookEntry will push the registers on the stack and then call
  31.     hook->h_SubEntry.
  32.  
  33.     INPUTS
  34.     hook - Call this hook.
  35.     object - This is the object which is passed to the hook. The valid
  36.         values for this parameter depends on the definition of the called
  37.         hook.
  38.     param - Pass these parameters to the specified object
  39.  
  40.     RESULT
  41.     The return value depends on the definition of the hook.
  42.  
  43.     NOTES
  44.  
  45.     EXAMPLE
  46.  
  47.     BUGS
  48.  
  49.     SEE ALSO
  50.     CallHookA(), CallHook()
  51.  
  52.     HISTORY
  53.     28.11.96 digulla created
  54.  
  55. ******************************************************************************/
  56. {
  57.     return ((IPTR (*)(struct Hook *, APTR, APTR))(hook->h_SubEntry))
  58.             (hook, object, param);
  59. } /* HookEntry */
  60.  
  61.