/* (C) Copyright International Business Machines Corporation 23 January */
/* 1990.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
/* SCCS Info: @(#)accessors.h	1.2 2/13/92 */

#ifndef accessors_included

/* get a pointer to a component of a record, given a pointer to the */
/* record object */
#define dot(obj,comp) (&(obj->value.record->data[comp]))
/* get the valcell from a component of a record, given a valcell for */
/* the record */
#define vdot(valc, off) (valc.record->data[off].value)
/* get the valcell of a component of a dotcontainer of any type, given a */
/*pointer to the dotcontainer */
#define dcdot(valc, off) (valc->data[off].value)
/* get the tsdr of a component of a record, given a valcell for the */
/* record */
#define vdotrep(valc, off) (valc.record->data[off].tsdr)

#define vec_elem(tbl, idx) \
  ((tbl)->tbls[0].rep.vec->elements[idx])
#define get_elem(tbl, idx) (vec_elem((tbl).table,idx))
#define obj_get_elem(tobj, idx) (get_elem((tobj)->value,idx))

#define varcomp_of(varval) ((varval).variant->data[0].value)
#define obj_varcomp_of(varobj) (&(varobj)->value.variant->data[0])

#define case_of(varval) ((varval).variant->info.variant_case)
#define obj_case_of(varobj) ((varobj)->value.variant->info.variant_case)

#define size_of(tblval) ((tblval).table->size)
#define obj_size_of(tblobj) ((tblobj)->value.table->size)

#define accessors_included
#endif
