HP 3000 Manuals

ADDOPT [ Net IPC 3000/XL Programmer's Reference Manual ] MPE/iX 5.0 Documentation


Net IPC 3000/XL Programmer's Reference Manual

ADDOPT 

Adds an option entry to the  opt parameter.

Syntax 
__________________________________________________________________________
|                                                                        |
|                                                                        |
|     ADDOPT     (opt, entrynum, optioncode, datalength, data [, result])|
|                                                                        |
__________________________________________________________________________

Parameters 

 opt (input/output) 

Record or byte array, by reference.  The  opt parameter to which you want
to add an entry.  Refer to "Common Parameters" for more information on
the structure of this parameter.

 entrynum (input) 

16-bit integer, by value.  Indicates which entry is to be initialized.
The first entry is entry zero.

 optioncode (input) 

16-bit integer, by value.  The option code of the entry, identifies the
option.

 datalength (input) 

16-bit integer, by value.  The length (in bytes) of the data associated
with the option

 data (input) 

Byte array, by reference.  The data associated with the option.

 result (output) 

16-bit integer, by reference.  The error code returned; zero if no error.

Description 

The ADDOPT intrinsic specifies the values of an  opt parameter's option
entry fields and adds any associated data.  The intrinsic also updates
the size of the opt parameter.

The parameter must be initialized by INITOPT before options are added by
ADDOPT. Consider this program fragment:

data_offset:=10;                            {10 bytes from beginning of data array}

INITOPT (opt,1,                             {one option entry}
result);

ADDOPT (opt, 0, 8, 2,                       {first entry is entry zero, option code 8;
data_offset,result);                        entry's data area contains a 2-byte integer
                                            specifying an offset from  data parameter
                                            address}

IPCSEND (cd, data,                          {sends data located at offset from data
dlen,flags,opt,                             address specified in  opt}
result);

INITOPT and ADDOPT allow you to initialize the  opt parameter for use in
another intrinsic.  These auxiliary intrinsics make the structure of the  
opt parameter largely transparent.

Condition codes returned by ADDOPT are:

 *  CCE--Succeeded.

 *  CCL--Failed because of a user error.

 *  CCG--Not returned by this intrinsic.

This intrinsic can be called in split stack mode.



MPE/iX 5.0 Documentation