Lines Matching refs:shp

41 #define	DONE()	{flag |= HIST_ERROR; cp = 0; stkseek(shp->stk,0); goto done;}
59 static char *parse_subst(Shell_t *shp,const char *s, struct subst *sb) in parse_subst() argument
65 off = stktell(shp->stk); in parse_subst()
82 if(stktell(shp->stk) != off) in parse_subst()
85 sfputc(shp->stk,'\0'); in parse_subst()
88 sb->str[n] = strdup(stkptr(shp->stk,off)); in parse_subst()
89 stkseek(shp->stk,off); in parse_subst()
101 sfputc(shp->stk,del); in parse_subst()
106 sfputc(shp->stk,'&'); in parse_subst()
110 sfputc(shp->stk,'\\'); in parse_subst()
114 sfputr(shp->stk,sb->str[0],-1); in parse_subst()
116 sfputc(shp->stk,*cp); in parse_subst()
121 stkseek(shp->stk,off); in parse_subst()
130 int hist_expand(Shell_t *shp,const char *ln, char **xp) in hist_expand() argument
161 if((np = nv_open("histchars",shp->var_tree,0)) && (cp = nv_getval(np))) in hist_expand()
176 if(off = stktell(shp->stk)) in hist_expand()
177 sp = stkfreeze(shp->stk,0); in hist_expand()
188 sfputc(shp->stk,*cp++); in hist_expand()
192 sfputc(shp->stk,*cp); in hist_expand()
195 sfputc(shp->stk,*cp++); in hist_expand()
201 sfputc(shp->stk,*cp++); in hist_expand()
202 sfputr(shp->stk,cp,-1); in hist_expand()
231 sfputc(shp->stk,hc[0]); in hist_expand()
236 n = stktell(shp->stk); /* terminate string and dup */ in hist_expand()
237 sfputc(shp->stk,'\0'); in hist_expand()
238 cc = strdup(stkptr(shp->stk,0)); in hist_expand()
239 stkseek(shp->stk,n); /* remove null byte again */ in hist_expand()
585 cp = parse_subst(shp, cp, &sb); in hist_expand()
655 sfputc(shp->stk,'\''); in hist_expand()
675 sfputc(shp->stk,'\''); in hist_expand()
676 sfputc(shp->stk,c); in hist_expand()
677 sfputc(shp->stk,'\''); in hist_expand()
680 sfputc(shp->stk,c); in hist_expand()
684 sfputc(shp->stk,'\''); in hist_expand()
685 sfputc(shp->stk,'\\'); in hist_expand()
686 sfputc(shp->stk,c); in hist_expand()
687 sfputc(shp->stk,'\''); in hist_expand()
690 sfputc(shp->stk,c); in hist_expand()
693 sfputc(shp->stk,'\''); in hist_expand()
697 sfputc(shp->stk,'\0'); in hist_expand()
709 if(stktell(shp->stk) && !(flag & HIST_ERROR)) in hist_expand()
710 *xp = strdup(stkfreeze(shp->stk,1)); in hist_expand()
714 stkset(shp->stk,sp,off); in hist_expand()
716 stkseek(shp->stk,0); in hist_expand()