HP Operations Manager for Windows

opcif_read()


   #include opcapi.h

   int opcif_read(
                 int           interface_id,     /* in */
                 opcdata       data              /* in/out */
                 );

Parameters

interface_id
Specifies which interface instance is used.
data
HPOM data structure.

Description

The function opcif_read() reads a message from the queue of the specified interface instance. If the interface instance has been opened with OPCIF_READ_WAIT, the calling process is blocked until the information is available. The API returns an error if the application receives an interrupt signal. The data parameter specified in the call must be created with opcdata_create(). Memory for the actual message data is allocated, and if memory was assigned to data before the call to opcif_read(), it is deallocated.

Return Values

OPC_ERR_OK
OK.
OPC_ERR_CANT_INIT
Initialization of queues failed.
OPC_ERR_INVALID_INTERFACE_ID
No such interface opened.
OPC_ERR_INVALID_OUTPARAM
data is NULL or is of the wrong type.
OPC_ERR_WRONG_MSITYPE
Interface assigned to interface_id is of the wrong type.
OPC_ERR_EINTR
Reading from the pipe failed.
OPC_ERR_MSI_BUF_FULL
Number of messages exceeds the specified number in max_entries while opening.
OPC_ERR_NO_DATA
Queue is empty.
OPC_ERR_CANT_READ_MSG
Reading message, event, or response failed.
OPC_ERR_NO_MEMORY
Memory allocation failed.

Versions

HPOM for Windows 8.00 and higher