|
» |
|
|
|
NAMEEvmItemGet(), EvmItemListFree(), EvmItemListGet(), EvmItemRelease(), EvmItemSet(), EvmItemSetVa() — create and manipulate event items SYNOPSIS#include <evm/evm.h>
EvmStatus_t EvmItemGet(
EvmEvent_t event,
EvmItemId_t item_id,
EvmItemValue_t *item_value );
EvmStatus_t EvmItemListGet(
EvmEvent_t event,
EvmCount_t *item_count,
EvmItemList_t *itemList );
EvmStatus_t EvmItemRelease(
EvmItemId_t item_id,
EvmItemValue_t item_value );
EvmStatus_t EvmItemSet(
EvmEvent_t event,
EvmItemId_t item_id,
EvmItemValue_t item_value );
EvmStatus_t EvmItemSetVa(
EvmEvent_t event,
[EvmItemId_t item_id,
EvmItemValue_t item_value]...,
EvmITEM_NONE );
void EvmItemListFree(
EvmItemList_t itemList ); LibraryEVM Support Library
(libevm.so). Parameters- event
The event containing the item to be manipulated. - item_id
The identifier for the event data item to be set, obtained, or released
by the called routine.
Possible values for this operand, and the data
contained by the data item are identified in the following list.
See the
EvmEvent(5)
manpage for a description of the event data items.
It is also possible to supply a separate
item_id
for each of the
supported variable types.
In these cases, an extra one or two operands
(depending on the type) must be supplied in addition to the
item_value.
See the description below for more information.
The following extended
variable item IDs are supported:
- item_value
The value stored into the item indicated by the associated
item_id.
For
EvmItemGet(),
this is the location where the value extracted from the event is stored. - item_count
This is the return operand. It is the number of entries in
item_list,
exclusive of the terminating
EvmItem_NONE
entry.
DESCRIPTIONThese routines manipulate data in the standard
items in an event. The
EvmItemSet()
routine sets the value of the event data item specified by
item_id
to the
item_value
supplied by the caller. The
EvmItemSetVa()
routine sets item values in the event.
The list of
item_id
and
item_value
operands is terminated by an instance of
item_id
of
EvmITEM_NONE. The inclusion of extended variable item-IDs simplifies programming by
allowing variable items to be added to an event without first having to set
up an
EvmVarStruct_t
structure, or to release it afterwards.
To use
these extended item-IDs, follow each with the name of the variable,
then a value of the appropriate type.
In addition, an
EvmITEM_VAR_STRING_I18N
value must be followed by an I18N message ID, and an
EvmITEM_VAR_OPAQUE
value must be followed by a size. The
EvmItemGet()
routine returns, in the
item_value
reference argument, the value of the event data item specified by
item_id.
The caller must use
EvmItemRelease()
to free any space allocated for the item. The
EvmItemRelease()
routine releases any storage space that was allocated
when the data item named by
item_id
was retrieved from an event using
EvmItemGet(). The
EvmItemListGet()
routine returns, in the
itemList
reference argument, a list of all of the items,
which are currently defined for the event.
The last item in the list has an
item_id
value of
EvmITEM_NONE.
The number of items in the list, not including the terminating null identifier,
is returned in
item_count.
The caller is responsible for freeing the memory used by the list by calling
EvmItemListFree(). The
EvmItemListFree()
routine frees the memory used by an item list.
The
itemList
operand is a list of items in an event generated by
EvmItemListGet(). RETURN VALUE- EvmERROR_NONE
The operation completed without error. - EvmERROR_INVALID_ARGUMENT
One of the arguments to the function is invalid. - EvmERROR_INVALID_VALUE
A value in a structure member is invalid. - EvmERROR_NO_MEMORY
An operation failed because an attempt to acquire heap memory failed. - EvmERROR_NOT_PRESENT
A request specified an item or variable name component in an
itemList
or a
varList
that is not part of the event being processed.
ERRORSThe value of
errno
is not set.
|