HP-UX Event ManagerProgrammer's Guide
3 The EVM Programming Interface
The EVM events are opaque data structures that can be accessed and manipulated by using
EVM's application programming interface (API) functions.
This chapter addresses the following topics:
• “EVM Header File” (page 31)
• “EVM API Library” (page 31)
• “Return Status Codes” (page 31)
• “Signal Handling” (page 32)
• “EVM Multithreaded Programs” (page 32)
• “Reassigning and Replicating EVM Events” (page 32)
• “Callback Functions” (page 33)
• “Choosing a Connection Policy” (page 34)
• “Handling Disconnections” (page 34)
• “Missed Events” (page 35)
• “Using Event Filters” (page 35)
EVM Header File
Programs that use EVM functions must include the following header file:
#include <evm/evm.h>
EVM API Library
Programs that use the EVM API functions must link against the shared library libevm.so. The
shared library is located in the directory, /usr/lib/hpux64, and is available to programs that
may need to be run when the system is in single-user mode.
Building Your Code Using EVM APIs
The EVM library consists of a mixture of C and C++ code. On HP-UX you need to use the aCC
compiler to do the link instead of ld to bring in the required C++ support libraries. Use
${C++C}instead of ${LD} in your Makefiles. You also need to use the -AA option to perform
the link.
You will see unresolved symbols on your PA-RISC builds if you do not use the -AA option, but
not on Itanium-based systems, because the -AA option is the default for Itanium builds.
Return Status Codes
The status codes returned by EVM functions are enumerated in the header file evm/evm.h. EVM
functions commonly return the following values:
• EvmERROR_NONE — The operation completed without error.
• EvmERROR_INVALID_ARGUMENT — One of the arguments passed to a function was invalid.
• EvmERROR_INVALID_VALUE — A structure contained an invalid value.
• EvmERROR_NO_MEMORY — An operation failed because an attempt to acquire heap memory
failed.
• EvmERROR_NOT_PRESENT — A requested item is not present in the event.
Refer to the evm/evm.h file for a complete list of status codes.
EVM Header File 31