Lines Matching refs:shp

66 	logdata.sh = context->shp;  in b_exec()
102 register Shell_t *shp; in B_login() local
105 shp = context->shp; in B_login()
109 shp = logp->sh; in B_login()
111 pp = (struct checkpt*)shp->jmplist; in B_login()
112 if(sh_isoption(shp,SH_RESTRICTED)) in B_login()
116 register struct argnod *arg=shp->envlist; in B_login()
119 if(shp->subshell && !shp->subshare) in B_login()
124 env_close(shp->env); in B_login()
125 shp->env = env_open((char**)0,3); in B_login()
127 nv_scan(shp->var_tree,noexport,0,NV_EXPORT,NV_EXPORT); in B_login()
133 (*cp=0,np=nv_search(arg->argval,shp->var_tree,0))) in B_login()
136 sh_envput(shp,np); in B_login()
146 if(job_close(shp) < 0) in B_login()
151 sh_sigreset(shp,2); in B_login()
152 sh_freeup(shp); in B_login()
153 path_exec(shp,pname,argv,NIL(struct argnod*)); in B_login()
154 sh_done(shp,0); in B_login()
163 Shell_t *shp = context->shp; in b_let() local
178 r = !sh_arith(shp,arg); in b_let()
185 register Shell_t *shp = context->shp; in b_eval() local
201 sh_offstate(shp,SH_MONITOR); in b_eval()
202 sh_eval(shp,sh_sfeval(argv),0); in b_eval()
204 return(shp->exitval); in b_eval()
212 register Shell_t *shp = context->shp; in b_dot_cmd() local
213 struct sh_scoped savst, *prevscope = shp->st.self; in b_dot_cmd()
234 if(shp->dot_depth+1 > DOTMAX) in b_dot_cmd()
236 if(!(np=shp->posix_fun)) in b_dot_cmd()
239 np = nv_search(script,shp->fun_tree,0); in b_dot_cmd()
244 path_search(shp,script,NIL(Pathcomp_t**),0); in b_dot_cmd()
258 if((fd=path_open(shp,script,path_get(shp,script))) < 0) in b_dot_cmd()
260 filename = path_fullname(shp,stkptr(shp->stk,PATH_OFFSET)); in b_dot_cmd()
263 *prevscope = shp->st; in b_dot_cmd()
264 shp->st.lineno = np?((struct functnod*)nv_funtree(np))->functline:1; in b_dot_cmd()
265 shp->st.var_local = shp->st.save_tree = shp->var_tree; in b_dot_cmd()
268 shp->st.filename = filename; in b_dot_cmd()
269 shp->st.lineno = 1; in b_dot_cmd()
271 level = shp->fn_depth+shp->dot_depth+1; in b_dot_cmd()
273 shp->st.prevst = prevscope; in b_dot_cmd()
274 shp->st.self = &savst; in b_dot_cmd()
275 shp->topscope = (Shscope_t*)shp->st.self; in b_dot_cmd()
276 prevscope->save_tree = shp->var_tree; in b_dot_cmd()
278 shp->st.filename = np->nvalue.rp->fname; in b_dot_cmd()
279 nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE); in b_dot_cmd()
280 shp->posix_fun = 0; in b_dot_cmd()
282 argsave = sh_argnew(shp,argv,&saveargfor); in b_dot_cmd()
283 sh_pushcontext(shp,&buff,SH_JMPDOT); in b_dot_cmd()
287 shp->dot_depth++; in b_dot_cmd()
289 sh_exec(shp,(Shnode_t*)(nv_funtree(np)),sh_isstate(shp,SH_ERREXIT)); in b_dot_cmd()
294 sh_offstate(shp,SH_NOFORK); in b_dot_cmd()
295 sh_eval(shp,iop,sh_isstate(shp,SH_PROFILE)?SH_FUNEVAL:0); in b_dot_cmd()
298 sh_popcontext(shp,&buff); in b_dot_cmd()
302 free((void*)shp->st.filename); in b_dot_cmd()
303 shp->dot_depth--; in b_dot_cmd()
305 sh_argreset(shp,(struct dolnod*)argsave,saveargfor); in b_dot_cmd()
308 prevscope->dolc = shp->st.dolc; in b_dot_cmd()
309 prevscope->dolv = shp->st.dolv; in b_dot_cmd()
311 if (shp->st.self != &savst) in b_dot_cmd()
312 *shp->st.self = shp->st; in b_dot_cmd()
314 memcpy((void*)&shp->st, (void*)prevscope, sizeof(Shscope_t)); in b_dot_cmd()
315 shp->topscope = (Shscope_t*)prevscope; in b_dot_cmd()
316 nv_putval(SH_PATHNAMENOD, shp->st.filename ,NV_NOFREE); in b_dot_cmd()
318 siglongjmp(*shp->jmplist,jmpval); in b_dot_cmd()
319 return(shp->exitval); in b_dot_cmd()
347 register Shell_t *shp = context->shp; in b_shift() local
360 n = ((arg= *argv)?(int)sh_arith(shp,arg):1); in b_shift()
361 if(n<0 || shp->st.dolc<n) in b_shift()
365 shp->st.dolv += n; in b_shift()
366 shp->st.dolc -= n; in b_shift()
373 register Shell_t *shp = context->shp; in b_wait() local
387 return(shp->exitval); in b_wait()
399 register Shell_t *shp = context->shp; in b_bg() local
417 if(!sh_isoption(shp,SH_MONITOR) || !job.jobcontrol) in b_bg()
419 if(sh_isstate(shp,SH_INTERACTIVE)) in b_bg()
425 if(job_walk(shp,sfstdout,job_switch,flag,argv)) in b_bg()
427 return(shp->exitval); in b_bg()
433 register Shell_t *shp = context->shp; in b_jobs() local
457 if(job_walk(shp,sfstdout,job_list,flag,argv)) in b_jobs()
460 return(shp->exitval); in b_jobs()
516 register Shell_t *shp = context->shp; in b_vpath() local
541 if(!shp->gd->lim.fs3d) in b_vpath()
553 vend = stkalloc(shp->stk,++n); in b_vpath()
581 if(shp->subshell && !shp->subshare) in b_vpath()