Lines Matching defs:shp
66 logdata.sh = context->shp;
102 register Shell_t *shp;
105 shp = context->shp;
109 shp = logp->sh;
111 pp = (struct checkpt*)shp->jmplist;
116 register struct argnod *arg=shp->envlist;
119 if(shp->subshell && !shp->subshare)
124 env_close(shp->env);
125 shp->env = env_open((char**)0,3);
127 nv_scan(shp->var_tree,noexport,0,NV_EXPORT,NV_EXPORT);
133 (*cp=0,np=nv_search(arg->argval,shp->var_tree,0)))
136 sh_envput(shp->env,np);
146 if(job_close(shp) < 0)
152 sh_freeup(shp);
153 path_exec(shp,pname,argv,NIL(struct argnod*));
154 sh_done(shp,0);
163 Shell_t *shp = context->shp;
178 r = !sh_arith(shp,arg);
185 register Shell_t *shp = context->shp;
204 return(shp->exitval);
212 register Shell_t *shp = context->shp;
213 struct sh_scoped savst, *prevscope = shp->st.self;
234 if(shp->dot_depth+1 > DOTMAX)
236 if(!(np=shp->posix_fun))
239 np = nv_search(script,shp->fun_tree,0);
244 path_search(shp,script,NIL(Pathcomp_t**),0);
258 if((fd=path_open(shp,script,path_get(shp,script))) < 0)
260 filename = path_fullname(shp,stkptr(shp->stk,PATH_OFFSET));
263 *prevscope = shp->st;
264 shp->st.lineno = np?((struct functnod*)nv_funtree(np))->functline:1;
265 shp->st.var_local = shp->st.save_tree = shp->var_tree;
268 shp->st.filename = filename;
269 shp->st.lineno = 1;
271 level = shp->fn_depth+shp->dot_depth+1;
273 shp->st.prevst = prevscope;
274 shp->st.self = &savst;
275 shp->topscope = (Shscope_t*)shp->st.self;
276 prevscope->save_tree = shp->var_tree;
278 shp->st.filename = np->nvalue.rp->fname;
279 nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE);
280 shp->posix_fun = 0;
282 argsave = sh_argnew(shp,argv,&saveargfor);
283 sh_pushcontext(shp,&buff,SH_JMPDOT);
287 shp->dot_depth++;
298 sh_popcontext(shp,&buff);
302 free((void*)shp->st.filename);
303 shp->dot_depth--;
305 sh_argreset(shp,(struct dolnod*)argsave,saveargfor);
308 prevscope->dolc = shp->st.dolc;
309 prevscope->dolv = shp->st.dolv;
311 if (shp->st.self != &savst)
312 *shp->st.self = shp->st;
314 memcpy((void*)&shp->st, (void*)prevscope, sizeof(Shscope_t));
315 shp->topscope = (Shscope_t*)prevscope;
316 nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE);
318 siglongjmp(*shp->jmplist,jmpval);
319 return(shp->exitval);
347 register Shell_t *shp = context->shp;
360 n = ((arg= *argv)?(int)sh_arith(shp,arg):1);
361 if(n<0 || shp->st.dolc<n)
365 shp->st.dolv += n;
366 shp->st.dolc -= n;
373 register Shell_t *shp = context->shp;
387 return(shp->exitval);
399 register Shell_t *shp = context->shp;
427 return(shp->exitval);
433 register Shell_t *shp = context->shp;
460 return(shp->exitval);
516 register Shell_t *shp = context->shp;
541 if(!shp->gd->lim.fs3d)
553 vend = stkalloc(shp->stk,++n);
581 if(shp->subshell && !shp->subshare)