AFIfEvent(3) AFIfEvent(3) NAME AFIfEvent, AFCheckIfEvent, AFPeekIfEvent - check the event queue with a predicate procedure SYNTAX #include <AF/AFlib.h> void AFIfEvent (AFAudioConn *aud, AFEvent *event_return, ABool (*predicate)(), char *arg) ABool AFCheckIfEvent (AFAudioConn *aud, AFEvent *event_return, ABool (*predicate)(), char *arg) void AFPeekIfEvent (AFAudioConn *aud, AFEvent *event_return, ABool (*predicate)(), char *arg) ARGUMENTS arg Specifies the user-supplied argument that will be passed to the predicate procedure. aud Specifies the connection to the AF server. event_return Returns either a copy of or the matched event's associated struc- ture. predicate Specifies the procedure that is to be called to determine if the next event in the queue matches what you want. DESCRIPTION The AFIfEvent function completes only when the specified predicate pro- cedure returns ATrue for an event, which indicates an event in the queue matches. AFIfEvent flushes the output buffer if it blocks waiting for additional events. AFIfEvent removes the matching event from the queue and copies the structure into the client-supplied AFEvent structure. When the predicate procedure finds a match, AFCheckIfEvent copies the matched event into the client-supplied AFEvent structure and returns ATrue. (This event is removed from the queue.) If the predicate procedure finds no match, AFCheckIfEvent returns AFalse, and the output buffer will have been flushed. All earlier events stored in the queue are not discarded. The AFPeekIfEvent function returns only when the specified predicate pro- cedure returns ATrue for an event. After the predicate procedure finds a match, AFPeekIfEvent copies the matched event into the client-supplied AFEvent structure without removing the event from the queue. AFPeekIfEvent flushes the output buffer if it blocks waiting for additional events. SEE ALSO AFNextEvent(3), AF(1) BUGS If you encounter a reproducible bug, please submit a problem report to (af-bugs@crl.dec.com). COPYRIGHT Copyright 1990-1994, Digital Equipment Corporation. See AF(1) for a full statement of rights and permissions. AUTHORS Digital Cambridge Research Lab