User guide
18-50
DirectC Interface
{
int a,b,c,d;
a=1;
b=2;
c=3;
d=9999999;
vc_putInteger(h1,a);
vc_putInteger(h2,b);
vc_putInteger(h3,c);
vc_putInteger(h4,d);
}
vec32 *vc_4stVectorRef(vc_handle)
Returns a vec32 pointer to a four state vector. Returns NULL if the
specified vc_handle is not to a four state vector reg. For example:
typedef struct vector_descriptor {
int width; /* number ofbits */
int is4stte; /* TRUE/FALSE */
} VD;
void WriteVector(vc_handle file_handle, vc_handle a_vector)
{
FILE *fp;
int n, size;
vec32 *v;
VD vd;
fp = vc_getPointer(file_handle);
/* write vector’s size and type */
vd.is4state = vc_is4stVector(a_vector);
vd.width = vc_width(a_vector);
size = (vd.width + 31) >> 5; /* number of 32-bit chunks */
/* printf("writing: %d bits, is 4 state: %d, #chunks:
%d\n", vd.width, vd.is4state, size); */
n = fwrite(&vd, sizeof(vd), 1, fp);