Add Block (QteAddBlock) API


  Required Parameter Group:


  Service Program: QTECRTVS

  Threadsafe: No

The Add Block (QteAddBlock) API is used to add a block in an existing source region. A block is a scope in the region. It may be marked by a pair of braces, a function body, a data structure, or a starting and ending label. It can enclose other blocks or can be enclosed in its parent block. Every block should belong to a source region, which must be added by QteAddSourceRegionDescription API.

It is assumed block 0 is the outmost block for every source region and its range will cover the entire region. Block 0 is added by this API implicitly. Functions and global data declarations in the region should be assigned to block 0. All blocks explicitly defined in the region will be inner blocks of block 0. A block's enclosing block is its parent block which encloses it immediately. The enclosing block for block 0 is meaningless, since it is the outmost block and no block encloses it. When a block is added, its range defined by the starting and ending line number is checked against the range of its enclosing block. If the range is not within its enclosing block, this API will fail with an error.


Authorities and Locks

None.


Required Parameter Group

Source region number
INPUT; BINARY(4)

The number of the source region which this block belongs to. The source region should be added previously via QteAddSourceRegionDescription API.

Enclosing block number
INPUT; BINARY(4)

The number of the parent block which encloses this block immediately. The enclosing block should be added previously by this API. If there is no enclosing block, set 0 for this parameter to indicate the block is enclosed by block 0.

Block descriptor
INPUT; CHAR(*)

The adding block descriptor.

Block descriptor format name
INPUT; CHAR(10)

The format name of the information supplied by the calling program in the block descriptor parameter.

Valid values are:

BLKFMT0100

For more information, see BLKFMT0100 Format.

Block number
OUTPUT; BINARY(4)

The number used to identify this block. Other APIs can use this number to refer to this block.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of this structure, see Error code parameter.


BLKFMT0100 Format



Field Descriptions

Block name. The field containing the name of the block. For example, if this block is marked by a starting label and ending label, the starting label can be the name of this block. Or if it is marked by a data structure, the structure name can be the name of this block. It is the preprocessor's responsibility to name a block. The block name doesn't need to be null terminated. NULL value for this field means the block name is empty. If so the value of block name length field will be ignored.

Block name length. The length of the block name. The value is in bytes. If the pointer to block name is NULL. The value of this field is ignored.

Start line number of the block. The number of the line where this block begins.

End line number of the block. The number of the line where this block ends.



Error Messages

Message ID Error Message Text
CPF3C21 E Format name &1 is not valid.
CPF3CF1 E Error code parameter not valid.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF9549 E Error addressing API parameter.
CPF9CA2 E Source region not correct.
CPF9CA3 E Block already exists.
CPF9CA4 E Block does not exist.
CPF9CA5 E Block scope not valid.
CPF9556 E API not valid at this time.
CPF955D E View data overflow. All debug data lost.


API introduced: V7R3

[ Back to top | Debugger APIs | APIs by category ]