_AVECTOR - construct a shrink vector as function arg.

(GCOS8 only)

Usage:

/* Macro */
#include <climb.h>
func(/* arguments */, _AVECTOR(obj), /* more args */)
           or
func(/* args */, _avector(length,obj), /*more args*/)

Where:

func
is any function which requires a shrink vector (i.e. a "struct _vector") as an argument.
obj
is any data object (e.g. a variable, an array, a structure, etc.).
length
is the length of the data object, if you don't want to use the size determined by "sizeof".

Description:

_AVECTOR is a macro that should only be used in function argument lists. The result is a "struct _vector" shrink vector that frames the given object. The shrink vector gives full permissions on the framed object.

_AVECTOR uses the "sizeof" operator to determine the size of the given object. For example, in

int arr[100];
_wire_vector(_AVECTOR(arr));

_AVECTOR creates a shrink vector framing the "arr" array which is then passed as an argument to "_wire_vector".

Notes:

_AVECTOR does its work by using a library macro named "_avector" (lowercase). This macro has the calling sequence

_avector(length,object)

where "length" must be a non-zero "size_t" value giving a length in bytes, and "object" is a pointer to the beginning of the object.

If you wish to obtain a null (zero-length) shrink vector, use the manifest _ANULLVEC, defined in <climb.h>, as in

func(/* arguments */, _ANULLVEC, /* more args */)

See Also:

expl nsc lib _VECTOR

Copyright © 1996, Thinkage Ltd.