Creating an AST

From InterBase

Go Up to Continuous Processing with isc_que_events()


The event function, event_function(), should be written to take three arguments:

  1. The event_function_arg specified in the call to isc_que_events(). This is usually a pointer to the event parameter buffer that should be filled in with updated event counts.
  2. The length of the following events_list buffer.
  3. A pointer to the events_list buffer, a temporary event parameter buffer just like that passed to isc_que_events(), except for having updated event counts.

A result buffer is not automatically updated by the event occurrence; it is up to the event_function to copy the temporary events_list buffer to the more permanent buffer that the application utilizes.

event_function also needs to let the application know that it has been called, for example, by setting a global flag.

A sample event_function appears in the following example:

isc_callback event_function (char *result, short length, char *updated)
{
/* Set the global event flag. */
event_flag++
/* Copy the temporary updated buffer to the result buffer. */
while (length--)
*result++ = *updated++;
return(0);
};

Advance To: