_AVECTOR - construct a shrink vector as function arg.

(GCOS8 only)


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


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


_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];

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


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


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.