These routines handle the elements of a single event. More...
Functions | |
int | et_event_getgroup (et_event *pe, int *grp) |
This routine gets the group number that the event is associated with. | |
int | et_event_setpriority (et_event *pe, int pri) |
This routine sets the priority of an event to either ET_LOW which is the default or ET_HIGH. | |
int | et_event_getpriority (et_event *pe, int *pri) |
This routine gets the priority of an event, either ET_LOW or ET_HIGH. | |
int | et_event_setlength (et_event *pe, size_t len) |
This routine sets the length of an event's data in bytes. | |
int | et_event_getlength (et_event *pe, size_t *len) |
This routine gets the length of an event's data in bytes. | |
int | et_event_getdata (et_event *pe, void **data) |
This routine gets the pointer to an event's data. | |
int | et_event_setcontrol (et_event *pe, int con[], int num) |
This routine sets the control array of an event. | |
int | et_event_getcontrol (et_event *pe, int con[]) |
This routine gets the control array of an event. | |
int | et_event_setdatastatus (et_event *pe, int datastatus) |
This routine sets an event's data status. | |
int | et_event_getdatastatus (et_event *pe, int *datastatus) |
This routine gets an event's data status. | |
int | et_event_setendian (et_event *pe, int endian) |
This routine sets an event's data endian value. | |
int | et_event_getendian (et_event *pe, int *endian) |
This routine gets an event's data endian value. | |
int | et_event_needtoswap (et_event *pe, int *swap) |
This routine indicates whether an event's data needs to be swapped or not. | |
int | et_event_setdatabuffer (et_sys_id id, et_event *pe, void *data) |
This routine set an event's data buffer for a remote user. |
These routines handle the elements of a single event.
int et_event_getcontrol | ( | et_event * | pe, | |
int | con[] | |||
) |
This routine gets the control array of an event.
pe | pointer to event. | |
con | control array. |
References et_event_t::control, ET_ERROR, ET_OK, and ET_STATION_SELECT_INTS.
int et_event_getdata | ( | et_event * | pe, | |
void ** | data | |||
) |
This routine gets the pointer to an event's data.
pe | pointer to event. | |
data | address of data pointer which gets filled with event's data pointer. |
References ET_ERROR, ET_OK, and et_event_t::pdata.
int et_event_getdatastatus | ( | et_event * | pe, | |
int * | datastatus | |||
) |
This routine gets an event's data status.
The status can be ET_DATA_OK, ET_DATA_CORRUPT, or ET_DATA_POSSIBLY_CORRUPT. Currently all data is ET_DATA_OK unless a user's process exits or crashes while having events obtained from the ET system but not put back. In that case, the ET system recovers the events and places them in either ET_GRANDCENTRAL station, the attachment's station's input list, or its output list depending on the station's configuration (see et_station_config_setrestore()). If the events are NOT put back into Grand Central station to be recycled but are placed in the station's input or output list, the data status will become ET_DATA_POSSIBLY_CORRUPT. This simply warns the user that a process previously crashed with the event and may have corrupted its data.
pe | pointer to event. | |
datastatus | int pointer which gets filled with the event's data status. |
References et_event_t::datastatus, ET_ERROR, and ET_OK.
int et_event_getendian | ( | et_event * | pe, | |
int * | endian | |||
) |
This routine gets an event's data endian value.
The endian value will be either ET_ENDIAN_BIG or ET_ENDIAN_LITTLE.
pe | pointer to event. | |
endian | int pointer which gets filled with endian value of event's data. |
References et_event_t::byteorder, ET_ENDIAN_BIG, ET_ENDIAN_LITTLE, ET_ERROR, and ET_OK.
int et_event_getgroup | ( | et_event * | pe, | |
int * | grp | |||
) |
This routine gets the group number that the event is associated with.
Each event in an ET system belongs to a group which is numbered starting at 1. By default an ET system only has 1 group of value 1. This group number can be used when getting new events from the system and helps to evenly distribute events between multiple producers.
pe | pointer to event. | |
pri | event's group (starts at 1).. |
References ET_ERROR, ET_OK, and et_event_t::group.
int et_event_getlength | ( | et_event * | pe, | |
size_t * | len | |||
) |
This routine gets the length of an event's data in bytes.
pe | pointer to event. | |
len | int pointer which gets filled with the length of data in bytes. |
References ET_ERROR, ET_OK, and et_event_t::length.
int et_event_getpriority | ( | et_event * | pe, | |
int * | pri | |||
) |
int et_event_needtoswap | ( | et_event * | pe, | |
int * | swap | |||
) |
This routine indicates whether an event's data needs to be swapped or not.
If the data's endian is opposite of the local host's then swapping of the data is required and ET_SWAP is returned. Otherwise ET_NOSWAP is returned.
pe | pointer to event. | |
endian | int pointer which gets filled with ET_SWAP or ET_NOSWAP. |
References et_event_t::byteorder, ET_ERROR, ET_NOSWAP, ET_OK, and ET_SWAP.
int et_event_setcontrol | ( | et_event * | pe, | |
int | con[], | |||
int | num | |||
) |
This routine sets the control array of an event.
The maximum number of control ints is ET_STATION_SELECT_INTS.
pe | pointer to event. | |
con | control array. | |
num | number of elements in control array. |
References et_event_t::control, ET_ERROR, ET_OK, and ET_STATION_SELECT_INTS.
This routine set an event's data buffer for a remote user.
This routine is a little different than other et_event_get/set routines as it must only be used in a remote application. Use this in conjunction with the mode flag of ET_NOALLOC in et_events_new. This allows the user to avoid allocating event data memory, but instead to supply a buffer. This buffer is given by the "data" argument of this routine. If the user does a "put" of an event having called this routine to set its buffer, that user-supplied buffer is not freed.
id | ||
pe | data |
References et_id_t::debug, ET_DEBUG_ERROR, ET_ERROR, et_logmsg(), ET_OK, ET_REMOTE, et_id_t::locality, and et_event_t::pdata.
int et_event_setdatastatus | ( | et_event * | pe, | |
int | datastatus | |||
) |
This routine sets an event's data status.
The status can be ET_DATA_OK, ET_DATA_CORRUPT, or ET_DATA_POSSIBLY_CORRUPT. Currently all data is ET_DATA_OK unless a user's process exits or crashes while having events obtained from the ET system but not put back. In that case, the ET system recovers the events and places them in either ET_GRANDCENTRAL station, the attachment's station's input list, or its output list depending on the station's configuration (see et_station_config_setrestore()). If the events are NOT put back into Grand Central station to be recycled but are placed in the station's input or output list, the data status will become ET_DATA_POSSIBLY_CORRUPT. This simply warns the user that a process previously crashed with the event and may have corrupted its data.
pe | pointer to event. | |
datastatus | status of an event's data. |
References et_event_t::datastatus, ET_DATA_CORRUPT, ET_DATA_OK, ET_DATA_POSSIBLY_CORRUPT, ET_ERROR, and ET_OK.
int et_event_setendian | ( | et_event * | pe, | |
int | endian | |||
) |
This routine sets an event's data endian value.
The endian value can be ET_ENDIAN_BIG, ET_ENDIAN_LITTLE, ET_ENDIAN_LOCAL, ET_ENDIAN_NOTLOCAL, or ET_ENDIAN_SWITCH. ET_ENDIAN_BIG and ET_ENDIAN_LITTL are self-explanatory. ET_ENDIAN_LOCAL sets the endianness to be the same as the local host. ET_ENDIAN_NOTLOCAL sets the endianness to be the opposite of the local host. ET_ENDIAN_SWITCH switches the endianness from its current value to the opposite.
pe | pointer to event. | |
endian | endian value of event's data. |
References et_event_t::byteorder, ET_ENDIAN_BIG, ET_ENDIAN_LITTLE, ET_ENDIAN_LOCAL, ET_ENDIAN_NOTLOCAL, ET_ENDIAN_SWITCH, ET_ERROR, ET_OK, and ET_SWAP32.
int et_event_setlength | ( | et_event * | pe, | |
size_t | len | |||
) |
This routine sets the length of an event's data in bytes.
pe | pointer to event. | |
len | length of data in bytes. |
References ET_ERROR, ET_OK, et_event_t::length, and et_event_t::memsize.