Initial Revision
[ohcount] / test / src_dir / c1.c
1 #include <cmqc.h>      /* MQ API header file       */
2 //
3
4 #define NUMBEROFSELECTORS  2
5
6 const MQHCONN Hconn = MQHC_DEF_HCONN;
7
8
9 static void InquireGetAndPut(char   *Message,
10                 PMQHOBJ pHobj,
11                 char   *Object)
12 {
13         /*      Declare local variables                       */
14         /*                                                    */
15         MQLONG  SelectorCount = NUMBEROFSELECTORS;
16         /* Number of selectors  */
17         MQLONG  IntAttrCount  = NUMBEROFSELECTORS;
18         /* Number of int attrs  */
19         MQLONG  CharAttrLength = 0;
20         /* Length of char attribute buffer  */
21         MQCHAR *CharAttrs ;
22         /* Character attribute buffer       */
23         MQLONG  SelectorsTable[NUMBEROFSELECTORS];
24         /* attribute selectors  */
25         MQLONG  IntAttrsTable[NUMBEROFSELECTORS];
26         /* integer attributes   */
27         MQLONG  CompCode;             /* Completion code      */
28         MQLONG  Reason;               /* Qualifying reason    */
29         /*                                                    */
30         /*     Open the queue.  If successful, do the inquire */
31         /*     call.                                          */
32         /*                                                    */
33         /*                                                 */
34         /*   Initialize the variables for the inquire      */
35         /*   call:                                         */
36         /*    - Set SelectorsTable to the attributes whose */
37         /*      status is                                  */
38         /*       required                                  */
39         /*    - All other variables are already set        */
40         /*                                                 */
41         SelectorsTable[0] = MQIA_INHIBIT_GET;
42         SelectorsTable[1] = MQIA_INHIBIT_PUT;
43         /*                                                 */
44         /*   Issue the inquire call                        */
45         /*     Test the output of the inquire call. If the */
46         /*     call failed, display an error message       */
47         /*     showing the completion code and reason code,*/
48         /*     otherwise display the status of the         */
49         /*     INHIBIT-GET and INHIBIT-PUT attributes      */
50         /*                                                 */
51         MQINQ(Hconn,
52                         *pHobj,
53                         SelectorCount,
54                         SelectorsTable,
55                         IntAttrCount,
56                         IntAttrsTable,
57                         CharAttrLength,
58                         CharAttrs,
59                         &CompCode,
60                         &Reason);
61         if (CompCode != MQCC_OK)
62         {
63                 sprintf(Message, MESSAGE_4_E,
64                                 ERROR_IN_MQINQ, CompCode, Reason);
65                 SetMsg(Message);
66         }
67         else
68         {
69                 /* Process the changes */
70         } /* end if CompCode */