t3x.org / t3x / t3x-manual / 324.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.2.3 CLOSE
TOC | Index | Back Next:
3.2.5 GETARG

3.2.4 CVALIST

T.CVALIST(n, bmap, ilist, olist) ! Num,Num,Vec,Vec => 0

Convert a private Tcode argument list to global argument list. Since the Tcode machine uses a private address space, arguments have to be exported to the global address space before passing them to external procedures.

Exporting an argument list is done by adding the offset of the Tcode machine's data area to pointer type arguments. The bitmap 'bmap' specifies the type of each argument.

Argument lists may not be longer than 16 elements (plus a trailing null word).

'N' specifies the number of elements of the argument list 'ilist'. If a trailing null is required, it must be included in this number. 'Ilist' is a vector containing the arguments. 'Bmap' is a bit field where each bit is associated with an argument of 'ilist'. A bit of 'bmap' is set if the associated argument is a pointer: if bit #0 is set (bmap & 1), ilist[0] is a pointer, if bit #1 is set (bmap & 2), ilist[1] is a pointer, etc. 'Olist' will be filled with the extended argument list. It must provide up to 18 times the size of a generic pointer. It may be allocated using:

VAR olist[18];

CVALIST may relocate 'olist' if it is not aligned to a native machine word boundary. It returns the number of bytes 'olist' was moved. This number should be used to compute the new address of olist:

offset := t.cvalist(n, bmap, ilist, olist);
new_olist := @olist::offset.

When a negative count is supplied, the effect of CVALIST is reversed. In this case, each member of 'olist' will be copied to 'ilist'. No pointers may be processed in this direction. The 'bmap' argument is ignored when importing argument lists.

CVALIST is used to prepare argument lists for passing them to interface procedures. For example, SYSTEM.SPAWN uses CVALIST internally. Most programs do not require its use.

See also: SYSTEM.SPAWN

Previous:
3.2.3 CLOSE
TOC | Index | Back Next:
3.2.5 GETARG