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

    CallHookPkt -- Invoke a Hook function callback. (V36)

    return = CallHookPkt( hook, object, paramPkt )
    D0                    A0    A2      A1

    ULONG CallHookPkt( struct Hook *hook, VOID *object, VOID *paramPkt );

    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:

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

    This function CallHook can be implemented in many C compilers
    like this:
    CallHook( hook, object, command, ... )
    struct Hook    *hook;
    VOID            *object;
    ULONG           command;
            return ( CallHookPkt( hook, object, (VOID *) &command ) );

    Hook           - pointer to Hook structure as defined in
    Object          - useful data structure in the particular context the
                      hook is being used for.
    ParamPkt        - pointer to a parameter packet (often built on the
                      stack); by convention this packet should start off
                      with a longword command code, and the remaining
                      data in the packet depends on that command.

    return          - The meaning of the value returned in D0 depends on
                      the context in which the Hook is being used.

    The functions called through this function should follow normal
    register conventions unless EXPLICITLY documented otherwise (and
    they have a good reason too).



[Back to Amiga Developer Docs]