utility.library/CallHookPkt

Previous:
utility.library/AttemptRemNamedObject
TOC:
Table of Contents
Index:
All Documents
Next:
utility.library/CheckDate

     Title:
CallHookPkt -- invoke a Hook function callback. (V36)
     Synopsis:
return = CallHookPkt(hook,object,message);
D0      A0   A2  A1

ULONG CallHookPkt(struct Hook *,APTR,APTR);
     Function:
Performs the callback standard defined by a Hook structure.
This function is really very simple; it effectively performs
a JMP to Hook->h_Entry.

It is probably just as well to do this operation in an
assembly language function linked in to your program, possibly
from a compiler supplied library or a builtin function.

It is anticipated that C programs will often call a 'varargs'
variant of this function which will be named CallHook. This
function must be provided in a compiler specific library, but
an example of use would be:

result = CallHook(hook,dataobject,COMMAND_ID,param1,param2);

The function CallHook() can be implemented in many C compilers
like this:

ULONG CallHook(struct Hook *hook, APTR object, ULONG command, ... )
{
    return(CallHookPkt(hook,object,(APTR)&command));
}
     Parameters:
hook - pointer to an initialized Hook structure as defined in
       <utility/hooks.h>
object - useful data structure in the particular context the hook is
 being used for.
message - pointer to a message to be passed to the hook. This is not
  an Exec Message structure, but is a message in the OOP sense.
     Results:
return - the value returned by the hook function.
     *** WARNING ***:
The functions called through this function should follow normal
register conventions unless EXPLICITLY documented otherwise (and
they have a good reason too).
     Related topics:
<utility/hooks.h>

Browse your own file: