Lines Matching refs:val
39 * if (flag&INTEGER), val.i contains integer value, and type contains base.
40 * otherwise, (val.s + type) contains string value.
41 * if (flag&EXPORT), val.s contains "name=value" for E-Z exporting.
250 uint32_t h, val;
256 vn = array_index_calc(n, &array, &val);
288 vp->val.i = kshpid;
292 if ((vp->val.i = j_async()) == 0)
296 vp->val.i = exstat & 0xFF;
299 vp->val.i = l->argc;
303 vp->val.s = getoptions();
317 vp = arraysearch(vp, val);
341 uint32_t h, val;
347 vn = array_index_calc(n, &array, &val);
371 vp = arraysearch(vp, val);
396 s = vp->val.s + vp->type;
412 n = vp->val.u;
414 n = (vp->val.i < 0) ? -vp->val.u : vp->val.u;
444 if (!(vp->flag & INT_U) && vp->val.i < 0)
474 cursz = strlen(vq->val.s) + 1;
477 if (s >= vq->val.s && s < (vq->val.s + cursz)) {
491 vq->val.s = aresizeif(cursz, (vq->flag & ALLOC) ?
492 vq->val.s : NULL, n, vq->areap);
493 memcpy(vq->val.s, s, n);
517 vtemp->val.i = n;
521 vq->val.i = n;
536 /* XXX is it possible for ISSET to be set and val.s to be NULL? */
537 if (!(vp->flag & ISSET) || (!(vp->flag & INTEGER) && vp->val.s == NULL))
540 nump->i = vp->val.i;
543 s = vp->val.s + vp->type;
647 afree(vq->val.s, vq->areap);
649 vq->val.i = num;
738 * make vp->val.s be "name=value" for quick exporting.
741 exportprep(struct tbl *vp, const char *val, size_t cursz)
743 char *cp = (vp->flag & ALLOC) ? vp->val.s : NULL;
745 size_t vallen = strlen(val) + 1;
749 /* since name+val are both in memory this can go unchecked */
750 vp->val.s = aresizeif(cursz, cp, vp->type + vallen, vp->areap);
751 memmove(vp->val.s + vp->type, val == cp ? vp->val.s : val, vallen);
752 memcpy(vp->val.s, vp->name, namelen);
753 vp->val.s[namelen] = '=';
773 const char *val;
791 val = skip_varname(var, false);
792 if (val == var) {
796 if (ord(*val) == ORD('[')) {
800 len = array_ref_len(val);
814 if (!ctype(val[i], C_DIGIT))
817 val += len;
819 if (ord(val[0]) == ORD('=')) {
820 len = val - var;
824 ++val;
828 } else if (ord(val[0]) == ORD('+') && ord(val[1]) == ORD('=')) {
829 len = val - var;
833 val += 2;
835 } else if (val[0] != '\0') {
844 val = NULL;
860 if ((qval = val) == NULL) {
930 afree(tmp->val.s, tmp->areap);
949 (val || clr || (set & ~(EXPORT | RDONLY))))
967 fake_assign = (t->flag & ISSET) && (!val || t != vp) &&
976 s = t->val.s + t->type;
977 free_me = (t->flag & ALLOC) ? t->val.s :
991 if ((set & INTEGER) && base > 0 && (!val || t != vp))
1008 afree(t->val.s, t->areap);
1024 strdup2x(tvar, str_val(vp), val);
1025 val = tvar;
1029 len = strlen(vp->val.s);
1030 tlen = strlen(val) + 1;
1031 vp->val.s = aresize(vp->val.s, len + tlen, vp->areap);
1032 memcpy(vp->val.s + len, val, tlen);
1033 } else if (val != NULL) {
1037 setstr(vp, val, KSH_UNWIND_ERROR | 0x4);
1043 setstr(vp, val, KSH_RETURN_ERROR | 0x4);
1045 /* came here from vappend? need to free temp val */
1054 vpbase->val.s : null, 0);
1068 afree(vp->val.s, vp->areap);
1077 afree(tmp->val.s, tmp->areap);
1195 char *val;
1196 val = str_val(vp);
1199 setstr(vp, val, KSH_RETURN_ERROR);
1208 XPput(denv, vp->val.s);
1546 * vp, indexed by val.
1549 arraysearch(struct tbl *vp, uint32_t val)
1556 if (val == 0)
1560 while (curr && curr->ua.index < val) {
1564 if (curr && curr->ua.index == val) {
1580 news->ua.index = val;
2082 wp[i], f->val.t);
2108 vp->name, vp->val.t);