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 wrong type

OPC_ERR_WRONG_MSITYPE:
interface assigned to interface_id is of wrong type

OPC_ERR_EINTR:
reading from pipe failed

OPC_ERR_MSI_BUF_FULL:
number of messages exceeds 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 A.07.50 and later

See Also

HPOM Interfaces

HPOM Data Structures