gtpc2m1x | C/C++ Language Support User's Guide |
This function queries the status of a named event. It is used with
the evntc and postc functions.
Format
#include <tpfapi.h>
int evnqc (struct ev0bk *evninf, enum t_evn_typ type);
- evninf
- The evnqc parameter block. For more information about
the evnqc parameter block, see struct ev0bk
and struct tpf_ev0bk_list_data.
- type
- The type of event being completed. The argument must belong to the
enumerated type t_evn_typ defined in
tpfapi.h. Use one of the predefined terms:
- EVENT_MSK
- for mask events.
- EVENT_CNT
- for count events.
- EVENT_CB_Dx
- where x is a single hexadecimal digit
(0-F) for core events.
- EVENT_LIST
- for list events.
Normal Return
One of the following:
- EVNQC_INC is returned if the event has not completed.
- If the event is count-type, evninf->evnpstinf.evnbkc1
contains the remaining count value for the event.
- If the event is list-type, evninf->evnbklc contains the count
of data items in the list, evninf->evnbkls contains the size of
each data item, and evninf->evnbkli contains the list of data items
for the event. To determine if a specific data item has been posted,
locate that data item in the list and check the value of the status flag field
for that data item.
- If the event is mask-type, evninf->evnpstinf.evnbkm1
contains the remaining mask value for the event.
- evninf->evnbkm2 contains the accumulated POST MASK 2 for the
event.
- evninf->evnbke contains the error indicator if an error has
occurred, or zero if no error has occurred.
- EVNQC_COM is returned if the event has completed.
- EVNQC_NFD is returned if the event name is not found.
Error Return
None.
Programming Considerations
- The evnqc function returns any current information about an
outstanding event but does not affect the state of the event. If the
event has completed, an evnwc function is still required to cause
the event to be deleted from the system.
- Any ECB is allowed to interrogate any existing event of its
subsystem.
- For core block type events, only the evnbkm1,
evnbkm2, and evnbke fields can be returned. The
core block information is returned on the evnwc macro.
- For list-type events, the returned list of data items is the same as the
created list. If any data items were posted with an error, the gross
error indicator is set in evnbke. Check the status flag
field for each data item in the list to determine the item or items that are
in error.
Examples
The following example queries the control program about a count type event
that it has created and prints "event finished" to the
terminal if the function does not return EVNQC_INC.
#include <tpfeq.h>
struct ev0bk *event_ptr;
·
·
·
event_ptr->evnpstin.evnbkc1=1;
evntc(event_ptr, EVENT_CNT, 'N', 250, EVNTC_NORM);
if (evnqc(event_ptr,EVENT_CNT) != EVNQC_INC)
printf("event finished\n");
Related Information