evmvarget.3 (2010 09)

e
EvmVarGet(3) EvmVarGet(3)
following types are supported:
Boolean, Char, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Double, String.
Use
EvmVarSetStringI18N()
to set a string variable with a non-zero I18N message-ID. Use
EvmVarSetOpaque()
to set an opaque variable. Each of these routines requires one more operand
than the others in this group.
The
EvmVarGet() routine returns the event variable indicated by v_name in the var variable. The
caller must free any space used by the variable by calling
EvmVarRelease()
.
The
EvmVarGetType()
routine returns the type of the named variable.
The
EvmVarGetXxx()
, EvmVarGetString()
, and EvmVarGetOpaque()
routines offer a simpler
means of retrieving a variable value than the generic
EvmVarGet() routine. These routines can
retrieve a variable of a specific type with a single call. To use these routines, replace the Xxx() in the rou-
tine name with the required type name, and supply a pointer to a location of the corresponding type as
the item_value pointer. Refer to the description of
EvmVarSetXxx() above for details of the supported
types.
Use
EvmVarGetString()
to retrieve a string variable, specifying NULL for the msg_id operand if you
do not want to receive an I18N message-ID. Use
EvmVarGetOpaque()
to retrieve an opaque variable.
Each of these routines requires one more operand than the others in this group.
Note that
EvmVarGetString()
and EvmVarGetOpaque() return their variable values in heap
memory. Use
free() to free this space when it is no longer needed.
The
EvmVarRelease()
routine releases any storage space allocated when the specified var was
retrieved from an event using
EvmVarGet(). It is important that this routine is called when the vari-
able is no longer needed to ensure that all memory associated with the variable is released. Do not use
this routine to release variables retrieved with any of the EvmVarGetXxx()
routines.
The
EvmVarListGet() routine returns, in the varList reference argument, a pointer to an array of
pointers to names of all the variables contained in the event. The last entry in the array is a NULL
pointer. The var_count argument receives the number of names in the list, not counting the terminating
null value. The caller must free the memory used by the list by calling
EvmVarListFree()
.
The
EvmVarListFree()
routine frees the memory used by a variable list (varList ).
Notes
The caller must specify the size when adding an opaque variable to an event.
To avoid memory leakage, memory that is supplied to the caller from API routines must be freed with the
appropriate routine.
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 pro-
cessed.
ERRORS
The value of
errno is not set.
SEE ALSO
Event Management
EVM(5).
EVM Events
EvmEvent(5)
EVM Programmer’s Guide.
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3