IBM Version 4 manual Valid, All

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 275
Image 275

_RSLV_Template_T rslvsp_template; _ENQ_Msg_Prefix_T enq_msg_prefix; _DEQ_Msg_Prefix_T deq_msg_prefix; char enq_msg[5ð],

deq_msg[5ð];

int success=ð;

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Create a library to create the user queue into.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

system("CRTLIB LIB(QUEUELIB)");

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Initialize the error code parameter.\/ /\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/ error_code.ec_fields.Bytes_Provided=sizeof(error_code_str￿uct);

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

/\ Call the QUSCRTUQ API to create a user queue.

\/

/\

 

 

 

\/

/\

This will create a user queue called EXAMPLEQ in library

\/

/\

QUEUELIB, with the following attributes:

\/

/\

 

 

 

\/

/\

1.

Extended attribute of "VALID

", which could have

\/

/\

 

been any valid \NAME.

 

\/

/\

2.

A queue type of "F", or First-in, first-out.

\/

/\

3.

A key length of ð. If the queue is not keyed, this

\/

/\

 

value must be ð.

 

\/

/\

4.

A maximum message size of 1ð bytes. This number can

\/

/\

 

be as large as 64K bytes.

 

\/

/\

5.

The initial number of messages set to 1ð.

\/

/\

6.

Additional number of messages set to 1ð.

\/

/\

7.

Public authority of \USE.

 

\/

/\

8.

A valid text description.

 

\/

/\

9.

Replace option of \YES. This means that if a user queue \/

/\

 

already exists by the name specified, in the library

\/

/\

 

specified, that it will be replaced by this

\/

/\

 

request.

 

\/

/\

1ð.

Domain value of \USER.

 

\/

/\

11.

Pointer value of \NO. Messages in the queue cannot

\/

/\

 

contain pointer data.

 

\/

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

memcpy(text_desc, "THIS IS TEXT FOR THE EXAMPLE USER QUEUE

",

5ð);

 

 

 

QUSCRTUQ("EXAMPLEQ

QUEUELIB

", /\ Qualified user queue name

\/

"VALID

",

/\ Extended attribute

\/

"F",

 

/\ Queue type

\/

ð,

 

/\ Key length

\/

1ð,

 

/\ Maximum message size

\/

1ð,

 

/\ Initial number of messages

\/

1ð,

 

/\ Additional number of messages \/

"\ALL

",

/\ Public authority

\/

text_desc,

 

/\ Text Description

\/

"\YES

",

/\ Replace existing user queue

\/

&error_code,

/\ Error code

\/

Appendix A. Performing Tasks Using APIs—ExamplesA-19

Page 275
Image 275
IBM Version 4 manual Valid, All