isc_event_block()

From InterBase

Go Up to API Function Reference


Allocates two event parameter buffers (EPBs) for subsequent use with other API event calls.

Syntax

 long isc_event_block(
 char **event_buffer,
 char **result_buffer,
 unsigned short id_count,
 . . .);
Parameter Type Description

event_buffer

char **

Address of a character pointer; this function allocates and initializes an event parameter buffer and stores its address into the character pointer

result_buffer

char **

Address of a character pointer; this function allocates an event parameter buffer, and stores its address into the character pointer

id_count

unsigned short

Number of event identifier strings that follow

char *

Up to 15 null-terminated and comma-separated strings that each name an event

Description

isc_event_block() must be called before any other event functions. It:

  • Allocates two event parameter buffers of the same size, and stores their addresses into the character pointers addressed by event_buffer and result_buffer.
  • Stores into the buffer referenced by event_buffer the names and event counts for each of the specified events. The names are the ones that appear as the final arguments to isc_event_block(). The event counts are initialized to zero and are used to specify how many times each event has been posted prior to each wait for events to occur.
  • Returns the length, in bytes, of the buffers.

The buffers, and their lengths, are used in subsequent calls to the functions isc_wait_for_event(), isc_que_events(), and isc_event_counts(). event_buffer is used to indicate the events of interest, and to hold the counts in effect before a wait for one of the events. After an event is posted, result_buffer is filled in exactly as event_buffer, except that the event counts are updated. isc_event_counts() is then called to determine which events were posted between the time the counts were set in event_buffer, and the time the counts are set in result_buffer.

Example

The following program fragment illustrates a call to isc_event_block():

#define number_of_stocks 3;
char *event_buffer, *result_buffer;
long length;
length = isc_event_block( &event_buffer, &result_buffer, number_of_stocks,
"DEC", "HP", "SUN");

Return value

isc_event_block() returns a number that is the size, in bytes, of each event parameter buffer it allocates.

See Also

Advance To: