QMHRCVPM(), QMHRCVPM1(), and QMHRCVPM2()--Receive Program Message for IBM PASE for i


  Syntax
 #include <os400msg.h>

 int QMHRCVPM(void         *msginfo,
              int          msginfoLen,    
              const char   *format,
              const char   *pgmq,
              int          pgmqDelta,
              const char   *msgtype,
              int          *msgkey,
              int          wait,
              const char   *action,
              void         *errcode);

 int QMHRCVPM1(void        *msginfo,
               int         msginfoLen,
               const char  *format,
               const char  *pgmq,
               int         pgmqDelta,
               const char  *msgtype,
               int         *msgkey,
               int         wait,
               const char  *action,
               void        *errcode,
               int         pgmqLen,
               const char  *pgmqQual);

 int QMHRCVPM2(void        *msginfo,
               int         msginfoLen,
               const char  *format,
               const void  *pgmq,
               int         pgmqDelta,
               const char  *msgtype,
               int         *msgkey,
               int         wait,
               const char  *action,
               void        *errcode,
               int         pgmqLen,
               const char  *pgmqQual,
               const char  *pgmqType,
               int         ccsid);
  Public Default Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes


Note: These functions can only be used in an IBM® i PASE program. See the IBM PASE for i topic collection for more information about creating IBM PASE for i programs.

The Receive Program Message (QMHRCVPM, QMHRCVPM1, and QMHRCVPM2) IBM PASE for i runtime functions allow an IBM PASE for i program to receive a message from a program call message queue or from the job external message queue.


Parameters

These IBM PASE for i runtime functions accept the same arguments as the Receive Program Message (QMHRCVPM) IBM i API, except that the IBM PASE for i functions use character string inputs that are null-terminated strings in the IBM PASE for i CCSID. IBM PASE for i runtime automatically converts input character strings to the job default CCSID and pads with blanks (as necessary) to match the fixed-length inputs required by the system API.

No conversions are done by IBM PASE for i runtime for the msginfo and errcode (input/output) arguments because they can contain a mixture of character and binary data. The ccsid argument specifies the CCSID for character data returned by the system API in the msginfo argument, and users can request CCSID information for the errcode argument by using ERRC0200 format. The QMHRCVPM and QMHRCVPM1 IBM PASE for i runtime functions use a default for the ccsid value passed to the system API that does not do any CCSID conversion for character data in the received message.

See Receive Program Message (QMHRCVPM) API for further description of the arguments for the QMHRCVPM, QMHRCVPM1, and QMHRCVPM2 IBM PASE for i runtime functions.


Authorities

See Receive Program Message (QMHRCVPM) API for information about authorities required for the QMHRCVPM, QMHRCVPM1, and QMHRCVPM2 IBM PASE for i runtime functions.


Return Value

The function result is zero for normal completion. The result is nonzero if any input character string could not be converted to the job default CCSID or was too long for the QMHRCVPM API, or if the QMHRCVPM API returned error information in the errcode argument.


Usage Notes

  1. The system only creates program call message queues ILE procedures and OMI programs, so you cannot send to or receive from a program message queue for a specific function in an IBM PASE for i program.
  2. When "*" is specified for the pgmq argument, the system locates the program call message queue for an (internal) ILE procedure in service program QP2USER that is the apparent caller of any ILE procedure called by the IBM PASE for i program using IBM PASE for i runtime function _ILECALLX or _ILECALL. This queue is the target for messages a called ILE procedure sends to its caller, and is also used for machine exceptions caused by operations inside the IBM PASE for i program (such as message MCH0601 a for storage reference error).

Related Information



API introduced: V5R1

[ Back to top | IBM PASE for i APIs | APIs by category ]