Lines Matching defs:vp
525 register struct var *vp;
538 for (vp = vlist; vp; vp = vp->next)
539 if (eqname(vp->name, n))
540 return(vp);
542 vp = (struct var *)space(sizeof(*vp));
543 if (vp == 0 || (vp->name = space((int)(cp-n)+2)) == 0) {
547 for (cp = vp->name; (*cp = *n++) && *cp != '='; cp++)
552 setarea((char *)vp, 0);
553 setarea((char *)vp->name, 0);
554 vp->value = null;
555 vp->next = vlist;
556 vp->status = GETCELL;
557 vlist = vp;
558 return(vp);
562 * give variable at `vp' the value `val'.
565 setval(vp, val)
566 struct var *vp;
569 nameval(vp, val, (char *)NULL);
580 nameval(vp, val, name)
581 register struct var *vp;
588 if (vp->status & RONLY) {
589 for (xp = vp->name; *xp && *xp != '=';)
596 xp = space(strlen(vp->name)+strlen(val)+2);
602 for (cp = vp->name; (*xp = *cp++) && *xp!='='; xp++)
612 if (vp->status & GETCELL)
613 xfree(vp->name); /* form new string `name=value' */
614 vp->name = name;
615 vp->value = val;
616 vp->status |= fl;
620 export(vp)
621 struct var *vp;
623 vp->status |= EXPORT;
627 ronly(vp)
628 struct var *vp;
630 if (letter(vp->name[0])) /* not an internal symbol ($# etc) */
631 vp->status |= RONLY;
652 struct var *vp;
659 vp = lookup(s);
660 nameval(vp, ++cp, cf == COPYV? (char *)NULL: s);
662 vp->status &= ~GETCELL;
682 register struct var *vp;
684 for (vp = vlist; vp; vp = vp->next)
685 if (vp->status & f && letter(*vp->name)) {
686 if (vp->status & EXPORT)
688 if (vp->status & RONLY)
690 write(out, vp->name, (int)(findeq(vp->name) - vp->name));