/* Macro */ #include <climb.h> func(/* arguments */, _AVECTOR(obj), /* more args */) or func(/* args */, _avector(length,obj), /*more args*/)
_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; _wire_vector(_AVECTOR(arr));
_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 */)
expl nsc lib _VECTOR
Copyright © 1996, Thinkage Ltd.