Lines Matching defs:lvalue
60 static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int assign)
62 register int flag = lvalue->flag;
65 Shell_t *shp = lvalue->shp;
67 int c=0,nosub = lvalue->nosub;
72 lvalue->nosub = 0;
73 if(nosub<0 && lvalue->ovalue)
74 return((Namval_t*)lvalue->ovalue);
75 lvalue->ovalue = 0;
76 if(cp>=lvalue->expr && cp < lvalue->expr+lvalue->elen)
104 if((lvalue->emode&ARITH_COMP) && dtvnext(root) && ((sdict && (mp=nv_search(cp,sdict,flags&~NV_ADD))) || (mp=nv_search(cp,root,flags&~(NV_ADD))) || (nsdict && (mp=nv_search(cp,nsdict,flags&~(NV_ADD|HASH_NOSCOPE)))) ))
130 cp = (char*)&lvalue->expr[flag];
220 static Sfdouble_t arith(const char **ptr, struct lval *lvalue, int type, Sfdouble_t n)
222 Shell_t *shp = lvalue->shp;
230 register Namval_t *np = (Namval_t*)(lvalue->value);
231 np = scope(np,lvalue,1);
233 if(lvalue->eflag)
234 lvalue->ptr = (void*)nv_hasdisc(np,&ENUM_disc);
235 lvalue->eflag = 0;
237 lvalue->value = (char*)np;
244 lvalue->value = (char*)0;
277 lvalue->fun = 0;
282 lvalue->nargs = -np->nvalue.rp->argc;
283 lvalue->fun = (Math_f)np;
287 lvalue->fun = (Math_f)sh_mathstdfun(*ptr,fsize,&lvalue->nargs);
288 if(lvalue->fun)
290 if(lvalue->emode&ARITH_COMP)
291 lvalue->value = (char*)e_function;
293 lvalue->value = (char*)ERROR_dictionary(e_function);
296 if((lvalue->emode&ARITH_COMP) && dot)
298 lvalue->value = (char*)*ptr;
299 lvalue->flag = str-lvalue->value;
309 Dt_t *root = (lvalue->emode&ARITH_COMP)?shp->var_base:shp->var_tree;
350 lvalue->value = (char*)*ptr;
351 lvalue->flag = str-lvalue->value;
359 if(!np && lvalue->value)
361 lvalue->value = (char*)np;
364 lvalue->isfloat=1;
365 lvalue->flag = 0;
368 lvalue->flag = (str-lvalue->expr);
387 lvalue->eflag = 0;
417 lvalue->isfloat=1;
431 lvalue->isfloat=1;
441 register Namval_t *np = (Namval_t*)(lvalue->value);
444 np = scope(np,lvalue,0);
449 *ptr = lvalue->value;
454 lvalue->ovalue = (char*)np;
455 if(lvalue->eflag)
456 lvalue->ptr = (void*)nv_hasdisc(np,&ENUM_disc);
457 else if((Namfun_t*)lvalue->ptr && !nv_hasdisc(np,&ENUM_disc) && !nv_isattr(np,NV_INTEGER))
460 mp = ((Namfun_t*)lvalue->ptr)->type;
468 lvalue->eflag = 0;
469 if(((lvalue->emode&2) || lvalue->level>1 || sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER))
473 lvalue->value = (char*)ERROR_dictionary(e_notset);
474 lvalue->emode |= 010;
479 lvalue->isfloat= (r!=(Sflong_t)r);
481 lvalue->isfloat=1;
482 if((lvalue->emode&ARITH_ASSIGNOP) && nv_isarray(np))
483 lvalue->nosub = nv_aindex(np)+1;
491 errormsg(SH_DICT,ERROR_warn(0),lvalue->value,*ptr);
494 if(lvalue->emode&ARITH_COMP)
497 errormsg(SH_DICT,ERROR_exit((lvalue->emode&3)!=0),lvalue->value,*ptr);