User guide

18-40
DirectC Interface
int vc_arraySize(vc_handle)
Returns the number of elements in a memory or multi-dimensional
array. The previous example also shows a use of vc_arraySize().
scalar vc_getScalar(vc_handle)
Returns the value of a scalar reg or bit. For example:
void rotate_scalars(vc_handle h1, vc_handle h2, vc_handle
h3)
{
scalar a;
a = vc_getScalar(h1);
vc_putScalar(h1, vc_getScalar(h2));
vc_putScalar(h2, vc_getScalar(h3));
vc_putScalar(h3, a);
return;
}
void vc_putScalar(vc_handle, scalar)
Passes the value of a scalar reg or bit to a vc_handle by reference.
The previous example also shows a use of vc_putScalar().
char vc_toChar(vc_handle)
Returns the 0, 1, x, or z character. For example:
void print_scalar(vc_handle h) {
printf("%c", vc_toChar(h));
return;
}