[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


   NAME
        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));
        }

   INPUTS
        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).

   SEE ALSO
        <utility/hooks.h>