IBM Version 4 SRECEIVER@, QTEMP@, Matctxopts, Cmpnvb SBYTAVL, 96 / Eqdone, LRECEIVER@, Sbytavl

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 175
Image 175

/\ Materialize the

amount of storage needed to store object￿ info

\/

 

 

MATCTX

 

S_RECEIVER@, QTEMP@, MATCTXOPTS;

 

/\ If no objects are in the library, then exit

\/

 

 

CMPNV(B)

S_BYTAVL, 96 / EQ(DONE);

 

/\ Allocate

the necessary storage (we could also have used C￿RTS

 

 

to allocate the

storage and a SPCPTR to the space for the

 

 

large receiver variable)

\/

 

 

MODASA

 

L_RECEIVER@, S_BYTAVL;

 

/\ Set the bytes provided field to indicate the allocated s￿torage

\/

 

 

CPYNV

 

L_BYTPRV, S_BYTAVL;

 

/\ Materialize the

objects within the library

\/

 

 

MATCTX

 

L_RECEIVER@, QTEMP@, MATCTXOPTS;

 

/\ Calculate how many objects were returned:

\/

/\ 1. Find the lower of bytes provided and bytes available

\/

/\

(L_BYTPRV and L_BYTAVL) as the number of objects could have

\/

/\

changed since the first materialize

\/

/\ 2. Subtract the

size of the fixed MATCTX header (96)

\/

/\ 3. Divide the remainder by the size of each entry returned￿

\/

 

 

CMPNV(B)

L_BYTPRV, L_BYTAVL / HI(ITS_AVL);

 

 

 

CPYNV

 

SIZE, L_BYTPRV;

 

 

 

B

 

CONTINUE;

 

ITS_AVL:

CPYNV

 

SIZE, L_BYTAVL;

 

CONTINUE:

SUBN(SB)

SIZE, 96 / ZER(DONE);

 

 

 

DIV

 

SIZE, SIZE, 32;

 

/\ Address the first object returned

\/

 

 

SETSPP

 

OBJ_ENTRY@, L_ENTRY;

 

/\ Loop through all materialized entries

\/

MORE:

 

 

 

 

/\ Convert the hex

object type and subtype to character for￿m

\/

 

 

CVTHC

 

OBJ_INFO_C, OBJ_INFO_X;

 

/\ Copy the

object

name to the message variable

\/

 

 

CPYBLA

 

OBJ_NAME_T, OBJ_NAME;

 

/\ Unconstrain the

array bounds (at compile time)

\/

OVRPGATR 1,3;

/\ Send a message to caller's msg queue containing the objec￿t info \/

Chapter 7. Machine Interface Programming7-35

Page 175
Image 175
IBM Version 4 SRECEIVER@, QTEMP@, Matctxopts, Cmpnvb SBYTAVL, 96 / Eqdone, LRECEIVER@, Sbytavl, Cpynv LBYTPRV, Sbytavl