ET System  16.4
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Stations

These routines handle interactions with stations. More...

Functions

int et_station_create_at (et_sys_id id, et_stat_id *stat_id, const char *stat_name, et_statconfig sconfig, int position, int parallelposition)
 This routine creates a station provided that it does not already exist and the maximum number of stations has not been reached. More...
 
int et_station_create (et_sys_id id, et_stat_id *stat_id, const char *stat_name, et_statconfig sconfig)
 This routine creates a station provided that it does not already exist and the maximum number of stations has not been reached. More...
 
int et_station_remove (et_sys_id id, et_stat_id stat_id)
 This routine deletes a station provided it is not GRAND_CENTRAL and provided there are no attached processes. More...
 
int et_station_attach (et_sys_id id, et_stat_id stat_id, et_att_id *att)
 This routine will attach the user to a station. More...
 
int et_station_detach (et_sys_id id, et_att_id att)
 This routine will detach the user from a station. More...
 
int et_station_setposition (et_sys_id id, et_stat_id stat_id, int position, int parallelposition)
 This routine sets a station's position in the linked list of active and idle stations and its position within a group of parallel stations if it is one. More...
 
int et_station_getposition (et_sys_id id, et_stat_id stat_id, int *position, int *parallelposition)
 This routine gets a station's position in the linked list of active and idle stations and its position within a group of parallel stations if it is one. More...
 
int et_station_isattached (et_sys_id id, et_stat_id stat_id, et_att_id att)
 Is an attachment attached to a particular station? More...
 
int et_station_exists (et_sys_id id, et_stat_id *stat_id, const char *stat_name)
 This routine tells whether a station exists or not, given the name of a station, If it does, it gives its id. More...
 
int et_station_name_to_id (et_sys_id id, et_stat_id *stat_id, const char *stat_name)
 This routine gives a station id, given the name of a station,. More...
 
int et_station_getattachments (et_sys_id id, et_stat_id stat_id, int *numatts)
 This routine gets the number of attachments to the given station. More...
 
int et_station_getstatus (et_sys_id id, et_stat_id stat_id, int *status)
 This routine gets the status of a station which may be one of the following values. More...
 
int et_station_getinputcount (et_sys_id id, et_stat_id stat_id, int *cnt)
 This routine gets the number of events in a station's input list. More...
 
int et_station_getoutputcount (et_sys_id id, et_stat_id stat_id, int *cnt)
 This routine gets the number of events in a station's output list. More...
 
int et_station_getblock (et_sys_id id, et_stat_id stat_id, int *block)
 This routine gets the block mode of a station which may be ET_STATION_BLOCKING or ET_STATION_NONBLOCKING. More...
 
int et_station_setblock (et_sys_id id, et_stat_id stat_id, int block)
 This routine sets a station's block mode. More...
 
int et_station_getuser (et_sys_id id, et_stat_id stat_id, int *user)
 This routine gets a station's user mode which is the maximum number of simultaneous attachments allowed with 0 meaning multiple. More...
 
int et_station_setuser (et_sys_id id, et_stat_id stat_id, int user)
 This routine sets a station's user mode which is the maximum number of simultaneous attachments allowed to a station. More...
 
int et_station_getrestore (et_sys_id id, et_stat_id stat_id, int *restore)
 This routine gets a station's restore mode which determines where events go when the attachment that owns those events detaches from a station. More...
 
int et_station_setrestore (et_sys_id id, et_stat_id stat_id, int restore)
 This routine sets a station's restore mode which determines where events go when the attachment that owns those events detaches from a station. More...
 
int et_station_getprescale (et_sys_id id, et_stat_id stat_id, int *prescale)
 This routine gets a station's prescale value. More...
 
int et_station_setprescale (et_sys_id id, et_stat_id stat_id, int prescale)
 This routine sets a station's prescale value. More...
 
int et_station_getcue (et_sys_id id, et_stat_id stat_id, int *cue)
 This routine gets a station's queue size, the size of the input event list for nonblocking stations. More...
 
int et_station_setcue (et_sys_id id, et_stat_id stat_id, int cue)
 This routine sets a station's queue size, the size of the input event list for nonblocking stations. More...
 
int et_station_getselectwords (et_sys_id id, et_stat_id stat_id, int select[])
 This routine gets a station's array of selection integers used to select events. More...
 
int et_station_setselectwords (et_sys_id id, et_stat_id stat_id, int select[])
 This routine sets a station's array of selection integers used to select events. More...
 
int et_station_getselect (et_sys_id id, et_stat_id stat_id, int *select)
 This routine gets a station's select mode which determines the algorithm this station uses to decide which events to let into its input list. More...
 
int et_station_getlib (et_sys_id id, et_stat_id stat_id, char *lib)
 This routine gets the name of the shared library containing an event selection function provided by the user. More...
 
int et_station_getclass (et_sys_id id, et_stat_id stat_id, char *classs)
 This routine gets the Java class defining an event selection method provided by the user for Java-based ET systems. More...
 
int et_station_getfunction (et_sys_id id, et_stat_id stat_id, char *function)
 This routine gets the name of the selection function in the shared library provided by the user. More...
 

Detailed Description

These routines handle interactions with stations.

Function Documentation

int et_station_attach ( et_sys_id  id,
et_stat_id  stat_id,
et_att_id att 
)

This routine will attach the user to a station.

This means that the user is free to read and write events from that station or to request new events. It returns a unique attachment id in the second argument which is to be used in all transactions with the station. When a user process attaches to a station, it is marked as an active station, which means it will start receiving events. To remove an attachment, call the routine et_station_detach().

Parameters
idid of the ET system.
stat_idstation id.
attpointer to a attachment id which gets filled in by this routine.
Returns
ET_OK if successful.
ET_ERROR if error.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
ET_ERROR_TOOMANY if the existing number of attachments is already equal to the station or system limit.
ET_ERROR_REMOTE for a memory allocation error of a remote user

References et_stat_data_t::att, et_proc::att, et_system_t::attach, et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_ATT_ACTIVE, ET_DEBUG_ERROR, ET_DEBUG_INFO, ET_DEBUG_SEVERE, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_TOOMANY, et_init_attachment(), ET_LOCAL, et_logmsg(), ET_MAXHOSTNAMELEN, et_mem_unlock(), et_memRead_lock(), ET_OK, ET_STATION_ACTIVE, ET_STATION_IDLE, et_station_lock(), ET_STATION_PARALLEL, et_station_unlock(), ET_SYS, et_system_lock(), et_system_unlock(), et_transfer_lock_all(), et_transfer_unlock_all(), etr_station_attach(), et_stat_config_t::flow_mode, et_id_t::grandcentral, et_attach::host, et_id_t::locality, et_station_t::name, et_stat_data_t::nattachments, et_proc::nattachments, et_sys_config_t::nattachments, et_system_t::nattachments, et_sys_config_t::nstations, et_attach::num, et_attach::pid, et_attach::proc, et_system_t::proc, et_id_t::proc, et_attach::stat, et_stat_data_t::status, et_attach::status, et_id_t::sys, and et_stat_config_t::user_mode.

int et_station_create ( et_sys_id  id,
et_stat_id stat_id,
const char *  stat_name,
et_statconfig  sconfig 
)

This routine creates a station provided that it does not already exist and the maximum number of stations has not been reached.

The station's status is set to ET_STATION_IDLE. This changes to ET_STATION_ACTIVE when a process attaches to it. The ET system is immediately notified of the new station upon creation and will transfer events in and out as soon as it is active. It is placed at the end of the linked list of stations. The station may already exist, but if it has the same configuration, the id of the existing station is returned.

Parameters
idid of the ET system.
stat_idpointer to a station id number and returns the value of the newly created station's id.
stat_namestation name.
sconfigstation configuration.
Returns
ET_OK if successful.
ET_ERROR if error.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_EXISTS if station already exists and has a different configuration (stat_id is still set to the existing station's id).
ET_ERROR_TOOMANY if the maximum number of stations already exist.
ET_ERROR_REMOTE for a memory allocation error of a remote user.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References ET_END, and et_station_create_at().

int et_station_create_at ( et_sys_id  id,
et_stat_id stat_id,
const char *  stat_name,
et_statconfig  sconfig,
int  position,
int  parallelposition 
)

This routine creates a station provided that it does not already exist and the maximum number of stations has not been reached.

The station's status is set to ET_STATION_IDLE. This changes to ET_STATION_ACTIVE when a process attaches to it. The ET system is immediately notified of the new station upon creation and will transfer events in and out as soon as it is active. It is placed at in the linked list of stations in the position given by the last argument or at the end if that argument is larger than the existing number of stations. The station may already exist, but if it has the same configuration, the id of the existing station is returned.

Parameters
idid of the ET system of interest.
stat_idpointer to a station id number and returns the value of the newly created station's id.
stat_namestation name.
sconfigstation configuration.
positionposition of the newly created station in the linked list of stations. It may have the value ET_END which specifies the end of that list. It may not have the value of zero which is the first position and reserved for ET_GRANDCENTRAL station.
parallelpositionposition of the newly created station in the linked list of 1 group of parallel stations. It may have the value ET_END which specifies the end of that group. It may also have the value of ET_NEWHEAD which specifies that a new group of parallel stations is being created and this is its head. However, if the head already exists, it may not have the value of zero, which is the first position, so that any existing head is never moved.
Returns
ET_OK if successful.
ET_ERROR if error.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_EXISTS if station already exists and has a different configuration (stat_id is still set to the existing station's id).
ET_ERROR_TOOMANY if the maximum number of stations already exist.
ET_ERROR_REMOTE for a memory allocation error of a remote user.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_stat_config_t::block_mode, et_id_t::closed, et_station_t::conductor, et_station_t::config, et_system_t::config, et_list_t::cread, et_stat_config_t::cue, et_station_t::data, et_id_t::debug, err_abort, et_alive(), ET_DEBUG_ERROR, ET_DEBUG_INFO, ET_DEBUG_SEVERE, ET_END, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_ERROR_EXISTS, ET_ERROR_TOOMANY, et_init_station(), ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_NEWHEAD, ET_OK, et_station_config_check(), et_station_config_destroy(), et_station_config_init(), ET_STATION_CREATING, et_station_exists(), et_station_getstatus(), ET_STATION_IDLE, et_station_lock(), ET_STATION_SELECT_INTS, ET_STATION_SELECT_USER, et_station_unlock(), ET_STATION_UNUSED, ET_STATNAME_LENGTH, ET_STRUCT_OK, ET_THREAD_KILL, et_transfer_lock_all(), et_transfer_unlock_all(), etr_station_create_at(), et_stat_config_t::flow_mode, et_id_t::grandcentral, et_stat_config_t::init, et_station_t::list_out, et_id_t::locality, et_station_t::name, et_sys_config_t::nstations, et_system_t::nstations, et_station_t::num, et_stat_data_t::pid_create, et_stat_config_t::prescale, et_stat_config_t::restore_mode, et_stat_config_t::select, et_stat_config_t::select_mode, et_system_t::statadd, et_system_t::statadd_mutex, et_system_t::statdone, et_stat_data_t::status, et_id_t::sys, and et_stat_config_t::user_mode.

Referenced by et_station_create().

int et_station_detach ( et_sys_id  id,
et_att_id  att 
)

This routine will detach the user from a station.

This means that the user is no longer able to read or write events from that station. It undoes what et_station_attach() does.

If this routine detaches the last attachment to a station, it marks the station as idle. In other words, the station stops receiving events since no one is there to read them. All events remaining in the station's input list (after the detachment) will be moved to the output list and sent to other stations. One must detach all attachments to a station before the station can be removed.

Parameters
idid of the ET system.
attattachment id.
Returns
ET_OK if successful.
ET_ERROR if bad attachment id or not attached to a station.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_stat_data_t::att, et_proc::att, et_system_t::attach, et_id_t::cleanup, et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_ATT_UNUSED, ET_ATTACHMENTS_MAX, ET_DEBUG_ERROR, ET_DEBUG_INFO, ET_DEBUG_WARN, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_flush_events(), ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memWrite_lock(), ET_OK, et_restore_events(), ET_STATION_IDLE, et_station_lock(), et_station_unlock(), ET_SYS, et_system_lock(), et_system_unlock(), et_transfer_lock_all(), et_transfer_unlock_all(), etr_station_detach(), et_id_t::grandcentral, et_id_t::locality, et_station_t::name, et_stat_data_t::nattachments, et_proc::nattachments, et_sys_config_t::nattachments, et_system_t::nattachments, et_attach::num, et_system_t::proc, et_id_t::proc, et_attach::stat, et_stat_data_t::status, et_attach::status, and et_id_t::sys.

int et_station_exists ( et_sys_id  id,
et_stat_id stat_id,
const char *  stat_name 
)

This routine tells whether a station exists or not, given the name of a station, If it does, it gives its id.

Parameters
idET system id.
stat_idpointer to station id which gets filled if station exists.
stat_namestation name.
Returns
1 if station exists.
0 if station does not exist.
ET_ERROR stat_name argument is NULL.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
ET_ERROR_REMOTE for a memory allocation error of a remote user

References et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_REMOTE, ET_STATION_UNUSED, etr_station_exists(), et_id_t::grandcentral, et_id_t::locality, et_station_t::name, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

Referenced by et_station_create_at(), and et_station_name_to_id().

int et_station_getattachments ( et_sys_id  id,
et_stat_id  stat_id,
int *  numatts 
)

This routine gets the number of attachments to the given station.

Parameters
idET system id.
stat_idstation id.
numattsint pointer which gets filled with the number of attachments.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getattachments(), et_id_t::grandcentral, et_id_t::locality, et_stat_data_t::nattachments, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

int et_station_getblock ( et_sys_id  id,
et_stat_id  stat_id,
int *  block 
)

This routine gets the block mode of a station which may be ET_STATION_BLOCKING or ET_STATION_NONBLOCKING.

Parameters
idET system id.
stat_idstation id.
blockint pointer which gets filled with the station block mode which may be ET_STATION_BLOCKING, or ET_STATION_NONBLOCKING.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setblock()

References et_stat_config_t::block_mode, et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getblock(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

int et_station_getclass ( et_sys_id  id,
et_stat_id  stat_id,
char *  classs 
)

This routine gets the Java class defining an event selection method provided by the user for Java-based ET systems.

Meaningful only if the ET_STATION_SELECT_USER select mode is being used.

Parameters
idET system id.
stat_idstation id.
classspointer which gets filled with the class name.
Returns
ET_OK if successful.
ET_ERROR if station is unused, bad stat_id argument, or select mode is not ET_STATION_SELECT_USER.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_stat_config_t::classs, et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_LANG_JAVA, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_SELECT_USER, ET_STATION_UNUSED, etr_station_getclass(), et_id_t::grandcentral, et_id_t::lang, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select_mode, et_stat_data_t::status, and et_id_t::sys.

int et_station_getcue ( et_sys_id  id,
et_stat_id  stat_id,
int *  cue 
)

This routine gets a station's queue size, the size of the input event list for nonblocking stations.

Parameters
idET system id.
stat_idstation id.
cueint pointer which gets filled with the queue size.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setcue().

References et_id_t::closed, et_station_t::config, et_system_t::config, et_stat_config_t::cue, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getcue(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

int et_station_getfunction ( et_sys_id  id,
et_stat_id  stat_id,
char *  function 
)

This routine gets the name of the selection function in the shared library provided by the user.

Meaningful only if the ET_STATION_SELECT_USER select mode is being used.

Parameters
idET system id.
stat_idstation id.
libpointer which gets filled with the selection function name.
Returns
ET_OK if successful.
ET_ERROR if station is unused, bad stat_id argument, or select mode is not ET_STATION_SELECT_USER.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_LANG_JAVA, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_SELECT_USER, ET_STATION_UNUSED, etr_station_getfunction(), et_stat_config_t::fname, et_id_t::grandcentral, et_id_t::lang, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select_mode, et_stat_data_t::status, and et_id_t::sys.

int et_station_getinputcount ( et_sys_id  id,
et_stat_id  stat_id,
int *  cnt 
)

This routine gets the number of events in a station's input list.

This number changes rapidly and is likely to be out-of-date immediately.

Parameters
idET system id.
stat_idstation id.
cntint pointer which gets filled with the number of events in the input list.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_list_t::cnt, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, etr_station_getinputcount(), et_id_t::grandcentral, et_station_t::list_in, et_id_t::locality, et_sys_config_t::nstations, and et_id_t::sys.

int et_station_getlib ( et_sys_id  id,
et_stat_id  stat_id,
char *  lib 
)

This routine gets the name of the shared library containing an event selection function provided by the user.

Meaningful only if the ET_STATION_SELECT_USER select mode is being used.

Parameters
idET system id.
stat_idstation id.
libpointer which gets filled with the library name.
Returns
ET_OK if successful.
ET_ERROR if station is unused, bad stat_id argument, or select mode is not ET_STATION_SELECT_USER.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_LANG_JAVA, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_SELECT_USER, ET_STATION_UNUSED, etr_station_getlib(), et_id_t::grandcentral, et_id_t::lang, et_stat_config_t::lib, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select_mode, et_stat_data_t::status, and et_id_t::sys.

int et_station_getoutputcount ( et_sys_id  id,
et_stat_id  stat_id,
int *  cnt 
)

This routine gets the number of events in a station's output list.

This number changes rapidly and is likely to be out-of-date immediately.

Parameters
idET system id.
stat_idstation id.
cntint pointer which gets filled with the number of events in the output list.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_list_t::cnt, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, etr_station_getoutputcount(), et_id_t::grandcentral, et_station_t::list_out, et_id_t::locality, et_sys_config_t::nstations, and et_id_t::sys.

int et_station_getposition ( et_sys_id  id,
et_stat_id  stat_id,
int *  position,
int *  parallelposition 
)

This routine gets a station's position in the linked list of active and idle stations and its position within a group of parallel stations if it is one.

Parameters
idid of the ET system.
stat_idstation id number. GRAND_CENTRAL station's position may not be changed.
positionpointer to int which gets filled with its position in the linked list of stations.
parallelpositionpointer to int which gets filled with its position within the group parallel stations. if it is one.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_STATION_ACTIVE, ET_STATION_IDLE, et_station_lock(), et_station_unlock(), et_transfer_lock_all(), et_transfer_unlock_all(), etr_station_getposition(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

int et_station_getprescale ( et_sys_id  id,
et_stat_id  stat_id,
int *  prescale 
)

This routine gets a station's prescale value.

Parameters
idET system id.
stat_idstation id.
prescaleint pointer which gets filled with the prescale value.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setprescale().

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getprescale(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::prescale, et_stat_data_t::status, and et_id_t::sys.

int et_station_getrestore ( et_sys_id  id,
et_stat_id  stat_id,
int *  restore 
)

This routine gets a station's restore mode which determines where events go when the attachment that owns those events detaches from a station.

Parameters
idET system id.
stat_idstation id.
restoreint pointer which gets filled with ET_STATION_RESTORE_OUT, ET_STATION_RESTORE_IN, ET_STATION_RESTORE_GC, or ET_STATION_RESTORE_REDIST.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setrestore()

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getrestore(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::restore_mode, et_stat_data_t::status, and et_id_t::sys.

int et_station_getselect ( et_sys_id  id,
et_stat_id  stat_id,
int *  select 
)

This routine gets a station's select mode which determines the algorithm this station uses to decide which events to let into its input list.

  • The value ET_STATION_SELECT_ALL allows all events in.

  • The value ET_STATION_SELECT_USER indicates a user-provided function will decide.

  • The value ET_STATION_SELECT_MATCH uses a built-in algorithm. To understand what this algorithm does, one must realize that each event has an array of integers associated with it - metadata which can be set by the user. Likewise, each station has a corresponding array of integers of the same size associated with it - again, metadata which can be set by the user. The function compares each element of the 2 arrays together and ORs the results. The first elements are checked for equality, the second elements with a bitwise AND, the third for equality, the fourth with a bitwise AND etc., etc. If the result is 1 or true, then the event is accepted into the input list.

  • The value ET_STATION_SELECT_RROBIN only applies to parallel stations and results in a round-robin distribution of events between all parallel stations in the same group.

  • The value ET_STATION_SELECT_EQUALCUE only applies to parallel stations and results in a distribution of events between all parallel stations in the same group such that all input lists contain the same number of events (load distribution).
Parameters
idET system id.
stat_idstation id.
selectint pointer that gets filled with select mode which may be ET_STATION_SELECT_ALL, ET_STATION_SELECT_USER, ET_STATION_SELECT_MATCH, ET_STATION_SELECT_RROBIN, or ET_STATION_SELECT_EQUALCUE..
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getselect(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select_mode, et_stat_data_t::status, and et_id_t::sys.

int et_station_getselectwords ( et_sys_id  id,
et_stat_id  stat_id,
int  select[] 
)

This routine gets a station's array of selection integers used to select events.

Parameters
idET system id.
stat_idstation id.
selectinteger array with at least ET_STATION_SELECT_INTS number of elements which gets filled in with the station's selection array.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setselectwords().

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_SELECT_INTS, ET_STATION_UNUSED, etr_station_getselectwords(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select, et_stat_data_t::status, and et_id_t::sys.

int et_station_getstatus ( et_sys_id  id,
et_stat_id  stat_id,
int *  status 
)

This routine gets the status of a station which may be one of the following values.

Parameters
idET system id.
stat_idstation id.
statusint pointer which gets filled with the station status which may be ET_STATION_UNUSED, ET_STATION_CREATING, ET_STATION_IDLE, or ET_STATION_ACTIVE.
Returns
ET_OK if successful.
ET_ERROR if bad stat_id argument.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, etr_station_getstatus(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

Referenced by et_station_create_at().

int et_station_getuser ( et_sys_id  id,
et_stat_id  stat_id,
int *  user 
)

This routine gets a station's user mode which is the maximum number of simultaneous attachments allowed with 0 meaning multiple.

Parameters
idET system id.
stat_idstation id.
userint pointer which gets filled with max number of allowed simultaneous attachments where 0 (ET_STATION_USER_MULTI) means multiple.
Returns
ET_OK if successful.
ET_ERROR if station is unused or bad stat_id argument
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
See Also
et_station_setuser()

References et_id_t::closed, et_station_t::config, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_REMOTE, ET_STATION_UNUSED, etr_station_getuser(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, et_id_t::sys, and et_stat_config_t::user_mode.

int et_station_isattached ( et_sys_id  id,
et_stat_id  stat_id,
et_att_id  att 
)

Is an attachment attached to a particular station?

Parameters
idET system id.
stat_idstation id.
attattachment id.
Returns
1 if attached.
0 if not attached.
ET_ERROR for bad argument(s).
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_stat_data_t::att, et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_REMOTE, etr_station_isattached(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nattachments, et_sys_config_t::nstations, and et_id_t::sys.

int et_station_name_to_id ( et_sys_id  id,
et_stat_id stat_id,
const char *  stat_name 
)

This routine gives a station id, given the name of a station,.

Parameters
idET system id.
stat_idpointer to station id which gets filled if station exists.
stat_namestation name.
Returns
ET_OK if successful.
ET_ERROR if no station by that name exists or stat_name is NULL.
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.
ET_ERROR_REMOTE for a memory allocation error of a remote user

References ET_ERROR, ET_OK, and et_station_exists().

int et_station_remove ( et_sys_id  id,
et_stat_id  stat_id 
)
int et_station_setblock ( et_sys_id  id,
et_stat_id  stat_id,
int  block 
)

This routine sets a station's block mode.

Determines whether all events pass through the station (ET_STATION_BLOCKING) or whether only a fixed size cue of events is filled while all others by-pass the station (ET_STATION_NONBLOCKING).

Parameters
idET system id.
stat_idstation id.
blockstation block mode which may be ET_STATION_BLOCKING, or ET_STATION_NONBLOCKING.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id, or bad block argument value
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_stat_config_t::block_mode, et_id_t::closed, et_station_t::config, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, ET_STATION_BLOCKING, et_station_lock(), ET_STATION_NONBLOCKING, ET_STATION_SELECT_EQUALCUE, ET_STATION_SELECT_RROBIN, et_station_unlock(), etr_station_setblock(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select_mode, and et_id_t::sys.

int et_station_setcue ( et_sys_id  id,
et_stat_id  stat_id,
int  cue 
)

This routine sets a station's queue size, the size of the input event list for nonblocking stations.

If the queue size is set to the total number of events in the system, it effectively changes the behavior of the station to act as if it were blocking.

Parameters
idET system id.
stat_idstation id.
cueinteger from 1 up to the total number of events in the system.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id or bad user argument value,
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_stat_config_t::cue, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, et_llist_lock(), et_llist_unlock(), ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, et_station_lock(), et_station_unlock(), etr_station_setcue(), et_id_t::grandcentral, et_station_t::list_in, et_id_t::locality, et_sys_config_t::nevents, et_sys_config_t::nstations, and et_id_t::sys.

int et_station_setposition ( et_sys_id  id,
et_stat_id  stat_id,
int  position,
int  parallelposition 
)

This routine sets a station's position in the linked list of active and idle stations and its position within a group of parallel stations if it is one.

Parameters
idid of the ET system.
stat_idstation id number. GRAND_CENTRAL station's position may not be changed.
positionposition in the linked list of stations and must be greater than 0 as the first position (0) is reserved for GRAND_CENTRAL station. It may be ET_END to put it at the end of the list.
parallelpositionposition within the group of a linked list of stations if it is one. It may be ET_NEWHEAD to make it the head of a new group of parallel stations. It may be ET_END to put it at the end. If the position parameter refers to an existing parallel station, this may be any value > 0 as it may not take the place of an existing head. Its configuration must also be compatible with existing parallel stations in the group.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, if bad stat_id, or bad position arguments values
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_system_t::config, et_station_t::data, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_END, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_NEWHEAD, ET_OK, ET_STATION_ACTIVE, ET_STATION_IDLE, et_station_lock(), et_station_unlock(), et_transfer_lock_all(), et_transfer_unlock_all(), etr_station_setposition(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_data_t::status, and et_id_t::sys.

int et_station_setprescale ( et_sys_id  id,
et_stat_id  stat_id,
int  prescale 
)

This routine sets a station's prescale value.

The prescale is 1 by default and selects every Nth event into the input list out of the normally accepted events.

Parameters
idET system id.
stat_idstation id.
prescaleprescale value with is any positive integer.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id or bad user argument value,
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, et_llist_lock(), et_llist_unlock(), ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, et_station_lock(), ET_STATION_SELECT_EQUALCUE, ET_STATION_SELECT_RROBIN, et_station_unlock(), etr_station_setprescale(), et_id_t::grandcentral, et_station_t::list_in, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::prescale, et_stat_config_t::select_mode, and et_id_t::sys.

int et_station_setrestore ( et_sys_id  id,
et_stat_id  stat_id,
int  restore 
)

This routine sets a station's restore mode which determines where events go when the attachment that owns those events detaches from a station.

The value may be ET_STATION_RESTORE_OUT which places events in this station's output list, The value may be ET_STATION_RESTORE_IN which places events in this station's input list - unless there are no more attachments in which case they go to the output list. The value may be ET_STATION_RESTORE_GC which places events in Grand Central's input list. The value may be ET_STATION_RESTORE_REDIST which places events in the previous station's output list for redistribution among a group of parallel stations.

Parameters
idET system id.
stat_idstation id.
restoreET_STATION_RESTORE_OUT, ET_STATION_RESTORE_IN, ET_STATION_RESTORE_GC, or ET_STATION_RESTORE_REDIST.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id, or bad restore argument value
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, et_station_lock(), ET_STATION_RESTORE_GC, ET_STATION_RESTORE_IN, ET_STATION_RESTORE_OUT, ET_STATION_SELECT_EQUALCUE, ET_STATION_SELECT_RROBIN, et_station_unlock(), etr_station_setrestore(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::restore_mode, et_stat_config_t::select_mode, and et_id_t::sys.

int et_station_setselectwords ( et_sys_id  id,
et_stat_id  stat_id,
int  select[] 
)

This routine sets a station's array of selection integers used to select events.

These integers are used to filter events out of the station when the station's select mode is set to ET_STATION_SELECT_MATCH. This may also be true if set to the ET_STATION_SELECT_USER mode but that depends on the user's specific filtering routine.

Parameters
idET system id.
stat_idstation id.
selectinteger array with at least ET_STATION_SELECT_INTS number of elements.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id or bad user argument value,
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, et_llist_lock(), et_llist_unlock(), ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, et_station_lock(), ET_STATION_SELECT_INTS, et_station_unlock(), etr_station_setselectwords(), et_id_t::grandcentral, et_station_t::list_in, et_id_t::locality, et_sys_config_t::nstations, et_stat_config_t::select, and et_id_t::sys.

int et_station_setuser ( et_sys_id  id,
et_stat_id  stat_id,
int  user 
)

This routine sets a station's user mode which is the maximum number of simultaneous attachments allowed to a station.

Value may be ET_STATION_USER_SINGLE for only 1 user, or ET_STATION_USER_MULTI for multiple users, or may be set to a specific positive integer for only that many simultaneous attachments.

Parameters
idET system id.
stat_idstation id.
userET_STATION_USER_MULTI, ET_STATION_USER_SINGLE or a positive integer.
Returns
ET_OK if successful.
ET_ERROR if station is GRAND_CENTRAL, bad stat_id or bad user argument value,
ET_ERROR_CLOSED if et_close already called.
ET_ERROR_DEAD if ET system is dead.
ET_ERROR_READ for a remote user's network read error.
ET_ERROR_WRITE for a remote user's network write error.

References et_id_t::closed, et_station_t::config, et_system_t::config, et_id_t::debug, et_alive(), ET_DEBUG_ERROR, ET_ERROR, ET_ERROR_CLOSED, ET_ERROR_DEAD, ET_GRANDCENTRAL, ET_LOCAL, et_logmsg(), et_mem_unlock(), et_memRead_lock(), ET_OK, et_station_lock(), et_station_unlock(), etr_station_setuser(), et_id_t::grandcentral, et_id_t::locality, et_sys_config_t::nstations, et_id_t::sys, and et_stat_config_t::user_mode.