home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume2 / basic / part2 / newbs / getplace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  488 b   |  21 lines

  1. /* getplace() -- get a pointer to place of value for vlist entry on top of stack
  2.  *    For arrays, getplace() expects the indexes to be on the stack as well.
  3.  *    The parser should properly arrange for this to happen.
  4.  */
  5. union value *getplace(dp)
  6. struct dictnode *dp;
  7. {
  8.     int qual;
  9.     union value ind,*place;
  10.  
  11.     qual = dp->type_of_value&T_QMASK;
  12.     if(qual == Q_ARY) {
  13.     ind = pop();
  14.     mpop();
  15.     place = & dp->val.arval[ind.ival+2];
  16.     }
  17.     else
  18.     place = & dp->val;
  19.     return(place);
  20. }
  21.