AFFlush(3)							   AFFlush(3)



NAME
  AFFlush, AFSync, AFEventsQueued, AFPending - handle output buffer or event
  queue

SYNTAX
  #include <AF/AFlib.h>

  void AFFlush(AFAudioConn *aud)

  void AFSync(AFAudioConn *aud,	ABool discard)

  int AFEventsQueued (AFAudioConn *aud,	int mode)

  int AFPending	(AFAudioConn *aud)

ARGUMENTS

  discard   Specifies a	boolean	value that indicates whether AFSync discards
	    all	events on the event queue.

  aud	    Specifies the connection to	the AF server.

  mode	    Specifies the mode.	 You can pass QueuedAlready, QueuedAfter-
	    Flush, or QueuedAfterReading.

DESCRIPTION
  The AFFlush function flushes the output buffer.  Most	client applications
  need not use this function because the output	buffer is automatically
  flushed as needed by calls to	AFPending and AFNextEvent. Events generated
  by the server	may be enqueued	into the library's event queue.

  The AFSync function flushes the output buffer	and then waits until all
  requests have	been received and processed by the AF server.  Any errors
  generated must be handled by the error handler.  For each error event
  received by AFlib, AFSync calls the client application's error handling
  routine.  Any	events generated by the	server are enqueued into the
  library's event queue.

  If discard is	passed False, AFSync does not discard the events in the
  queue.  If you passed	True, AFSync discards all events in the	queue,
  including those events that were on the queue	before AFSync was called.
  Client applications seldom need to call AFSync.

  If mode is QueuedAlready, AFEventsQueued returns the number of events
  already in the event queue (and never	performs a system call).  If mode is
  QueuedAfterFlush, AFEventsQueued returns the number of events	already	in
  the queue if the number is nonzero.  If there	are no events in the queue,
  AFEventsQueued flushes the output buffer, attempts to	read more events out
  of the application's connection, and returns the number read.	 If mode is
  QueuedAfterReading, AFEventsQueued returns the number	of events already in
  the queue if the number is nonzero. If there are no events in	the queue,
  AFEventsQueued attempts to read more events out of the application's con-
  nection without flushing the output buffer and returns the number read.

  AFEventsQueued always	returns	immediately without I/O	if there are events
  already in the queue.	 AFEventsQueued	with mode QueuedAfterFlush is identi-
  cal in behavior to AFPending.	 AFEventsQueued	with mode QueuedAlready	is
  identical to the AFQLength function.

  The AFPending	function returns the number of events that have	been received
  from the AF server but have not been removed from the	event queue.  AFPend-
  ing is identical to AFEventsQueued with the mode QueuedAfterFlush speci-
  fied.

SEE ALSO
  AFIfEvent(3),	AFNextEvent(3)


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