XEMS provides several routines to construct event filters. These are routines to add, delete and update an event filter.
ems_filter_add - Add an Event Filter
#include <xems.h>
void ems_filter_add(
ems_handle_t handle,
ems_string_t filter_name,
ems_event_type_t type,
ems_filter_exp_list_t * exp_list,
ems_error_t * status);
This routine is used to add a new event filter to the XEMS Event Filter Database. There is currently no mechanism for indicating all events.
- Input
- handle
a handle returned from a call to ems_consumer_register call.
- filter_name
specifies the event filter name for this event filter. This name can be used to add the event filter to a consumers event filter group.
- type
specifies the event type that this filter will be applies against.
- exp_list
a list of filter expressions which are part of the event filter filter_name.
- Output
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_invalid_handle
ems_s_insufficient_permission
ems_s_filter_exits
ems_s_invalid_filter
ems_s_invalid_name
ems_filter_append - Append to an Event Filter
#include <xems.h>
void ems_filter_append(
ems_handle_t handle,
ems_string_t filter_name,
ems_filter_exp_list_t * exp_list,
ems_error_t * status);
This routine is used to add filter expressions to an event filter. The filter expressions are added to the end of the current list of filter expressions in the event filter.
- Input
- handle
should be the handle returned from a call to ems_consumer_register call.
- filter_name
specifies the name of the event filter to add the filter expressions to.
- exp_list
a list of filter expressions which will be added to the end of event filter filter_name.
- Output
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_invalid_name
ems_s_invalid_handle
ems_s_invalid_name
ems_s_filter_not_found
ems_s_insufficient_permission
ems_filter_get - Get an Event Filter
#include <xems.h>
void ems_filter_get(
ems_handle_t handle,
ems_string_t filter_name,
ems_event_type_t * type,
ems_filter_exp_list_t ** filter_exprs,
ems_error_t * status);
This routine is used to get the filter expressions in an event filter.
- Input
- handle
should be the handle returned from a call to ems_consumer_register call.
- filter_name
specifies the name of the event filter to get.
- Output
- type
the event type of the filter.
- exp_list
the list of filter expressions which are part of event filter filter_name.
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_invalid_name
ems_s_invalid_handle
ems_s_filter_not_found
ems_s_insufficient_permission
ems_filter_delete - Delete an Event Filter
#include <xems.h>
void ems_filter_delete(
ems_handle_t handle,
ems_string_t filter_name,
ems_error_t * status);
This routine is used to delete an event filter from the Event Filter Database. The name filter_name cannot appear in any consumers event filter group when this routine is called.
- Input
- handle
should be the handle returned from a call to ems_consumer_register call.
- filter_name
specifies the name of the event filter to delete.
- Output
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_filter_not_found
ems_s_filter_in_use
ems_s_insufficient_permission
ems_s_invalid_name
ems_s_invalid_handle
ems_filter_free - Free an Event Filter
#include <xems.h>
void ems_filter_free(
ems_filter_exp_list_t ** filter_exprs,
ems_error_t * status);
This routine is used to get the filter expressions in an event filter.
- Input
- exp_list
the list of filter expressions which are part of event filter filter_name.
- Output
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_filter_get_namelist - List Event Filter Names
#include <xems.h>
void ems_filter_get_namelist(
ems_handle_t handle,
ems_filtername_list_t ** name_list,
ems_error_t * status);
This routine is used to get a list of the names of the event filters in the Event Filter Database.
- Input
- handle
should be the handle returned from a call to ems_consumer_register call.
- Output
- name_list
will contain a list of all the event filter names in the Event Filter Database. The routine ems_event_filter_get can be used to find out the contents of each event filter.
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_insufficient_permission
ems_s_invalid_handle
ems_s_empty_filter_db
ems_filter_free_namelist - Free Event Filter Names
#include <xems.h>
void ems_filter_free_namelist(
ems_filtername_list_t ** name_list,
ems_error_t * status);
This routine is used to free a list of the names of returned by the ems_filter_get_namelist routine
- Input
- name_list
list of filter names to free.
- Output
- name_list
sets to NULL.
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_filter_get_list - Get Event Filter List
#include <xems.h>
void ems_filter_get_list(
ems_handle_t handle,
ems_filter_list_t ** filter_list,
ems_error_t * status);
This routine is used to get a list of the event filters in the Event Filter Database.
- Input
- handle
a handle returned from a call to ems_consumer_register call.
- Output
- filter_list
will contain a list of all the event filters in the Event Filter Database. This list should be freed using ems_filter_free_list.
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
ems_s_insufficient_permission
ems_s_invalid_handle
ems_s_empty_filter_db
ems_filter_free_list - Free Event Filter List
#include <xems.h>
void ems_filter_free_list(
ems_filter_list_t ** filter_list,
ems_error_t * status);
This routine is used by callers of ems_get_event_filter_database to free the storage used by an Event Filter Database (ems_filter_list_t) structure.
- Input
- filter_list
a list of event filters that make up the Event Filter Database as returned by the routineems_filter_get_list() .
- Output
- filter_list
will be set to NULL.
- status
returns the status code from this routine which indicates whether the routine completed successfully or, if not, why not.
The possible status codes are:
ems_s_status_ok
Contents | Next section | Index |