Lines Matching +full:en +full:- +full:global

4 /*-
138 * special parsing rules apply for source -h
156 hp->next = hp->prev = hp; in lex()
157 hp->word = STRNULL; in lex()
177 new->word = NULL; in lex()
178 new->prev = wdp; in lex()
179 new->next = hp; in lex()
180 wdp->next = new; in lex()
181 hp->prev = new; in lex()
183 wdp->word = word(parsehtime); in lex()
188 } while (wdp->word[0] != '\n'); in lex()
192 if (histline.len != 0 && histline.s[histline.len - 1] == '\n') in lex()
193 histline.s[histline.len - 1] = '\0'; in lex()
215 ret = ret * 10 + (time_t)((unsigned char)*s - '0'); in a2time_t()
227 struct wordent *sp = sp0->next; in prlex()
230 xprintf("%S", sp->word); in prlex()
231 sp = sp->next; in prlex()
234 if (sp->word[0] != '\n') in prlex()
245 fp = fp->next; in copylex()
250 new->word = NULL; in copylex()
251 new->prev = wdp; in copylex()
252 new->next = hp; in copylex()
253 wdp->next = new; in copylex()
254 hp->prev = new; in copylex()
256 wdp->word = Strsave(fp->word); in copylex()
257 fp = fp->next; in copylex()
258 } while (wdp->word[0] != '\n'); in copylex()
264 vp->word = STRNULL; in initlex()
265 vp->prev = vp; in initlex()
266 vp->next = vp; in initlex()
274 while (vp->next != vp) { in freelex()
275 fp = vp->next; in freelex()
276 vp->next = fp->next; in freelex()
277 xfree(fp->word); in freelex()
280 vp->prev = vp; in freelex()
380 * Actually, all I really want to be able to say is 'foo\'bar' --> foo'bar in word()
460 if (exclnxt && --exclc >= 0) { in getC1()
461 exclnxt = exclnxt->next; in getC1()
462 setexclp(exclnxt->word); in getC1()
472 exclnxt = exclnxt->next; in getC1()
473 if (--exclc < 0) in getC1()
476 setexclp(exclnxt->word); in getC1()
531 name.len--; in getdol()
558 /* Bugfix for ${v123x} from Chris Torek, DAS DEC-90. */ in getdol()
569 name.len--; in getdol()
585 name.len--; in getdol()
596 * -strike in getdol()
631 if (c == delim) delimcnt--; in getdol()
674 Strbuf_appendn(&buf, labuf.s + lap, labuf.len - lap); in addla()
683 /* left-hand side of last :s or search string of last ?event? */
685 static struct Strbuf slhs; /* = Strbuf_INIT; left-hand side of last :s */
686 static struct Strbuf rhsb; /* = Strbuf_INIT; right-hand side of last :s */
703 quesarg = -1; in getexcl()
712 for (ip = hp->next->next; ip != alhistt; ip = ip->next) in getexcl()
715 for (ip = hp->next->next; ip != hp->prev; ip = ip->next) in getexcl()
723 if (!any(":^$*-%", c)) in getexcl()
725 left = right = -1; in getexcl()
741 ungetC(c), c = '-'; in getexcl()
742 if (c == '-') { in getexcl()
748 exclc = right - left + 1; in getexcl()
749 while (--left >= 0) in getexcl()
750 hp = hp->next; in getexcl()
767 getsub(struct wordent *en) in getsub() argument
772 int global; in getsub() local
776 global = 0; in getsub()
779 global |= (c == 'g') ? FLAG_G : FLAG_A; in getsub()
786 return (en); in getsub()
790 global |= FLAG_G; in getsub()
804 return (en); in getsub()
824 return (en); in getsub()
847 return (en); in getsub()
873 return (en); in getsub()
880 en = dosub(sc, en, global); in getsub()
884 return (en); in getsub()
893 * the shell might either freeze (hang) or core-dump.
897 #define HIST_PURGE -50000000
899 dosub(Char sc, struct wordent *en, int global) in dosub() argument
909 while (--i >= 0) { in dosub()
912 new->word = 0; in dosub()
913 new->prev = wdp; in dosub()
914 new->next = hp; in dosub()
915 wdp->next = new; in dosub()
917 en = en->next; in dosub()
918 if (en->word) { in dosub()
921 if ((global & FLAG_G) || didsub == 0) { in dosub()
925 tword = subword(en->word, sc, &didone, &pos); in dosub()
928 if (global & FLAG_A) { in dosub()
942 tword = Strsave(en->word); in dosub()
943 wdp->word = tword; in dosub()
948 hp->prev = wdp; in dosub()
951 * return &enthist(HIST_PURGE, &lexi, 0)->Hlex; in dosub()
953 hst = enthist(HIST_PURGE, &lexi, 0, 0, -1); in dosub()
954 return &(hst->Hlex); in dosub()
990 Strbuf_appendn(&wbuf, cp, mp - cp); in subword()
1053 xp = Strnsave(cp, wp - cp); in domod()
1059 for (wp--; wp >= cp && *wp != '/'; wp--) in domod()
1064 xp = Strnsave(cp, wp - cp); in domod()
1093 if (quesarg == -1) { in getsel()
1102 case '-': in getsel()
1105 *ar = dol - 1; in getsel()
1137 i = i * 10 + c - '0'; in getsel()
1149 *ar = dol - 1; in getsel()
1156 if (any("-$*", c)) in getsel()
1197 if (--hleft == 0) { in gethent()
1205 case '-': in gethent()
1219 while (!cmap(c, _ESC | _META | _QF | _QB) && !any("^*-%${}:#", c)) { in gethent()
1220 if (event != -1 && Isdigit(c)) in gethent()
1221 event = event * 10 + c - '0'; in gethent()
1223 event = -1; in gethent()
1234 if (event != -1) { in gethent()
1239 event = eventno + (alhistp == 0) - event; in gethent()
1245 memmove(lhsb.s + 1, lhsb.s, (lhsb.len - 1) * sizeof (*lhsb.s)); in gethent()
1246 lhsb.s[0] = '-'; in gethent()
1250 lastev = hp->Hnum; in gethent()
1251 return (&hp->Hlex); in gethent()
1277 lastev = hp->Hnum; in gethent()
1278 return (&hp->Hlex); in gethent()
1281 for (hp = Histlist.Hnext; hp; hp = hp->Hnext) in gethent()
1282 if (hp->Hnum == event) { in gethent()
1283 hp->Href = eventno; in gethent()
1284 lastev = hp->Hnum; in gethent()
1285 return (&hp->Hlex); in gethent()
1298 for (hp = Histlist.Hnext; hp; hp = hp->Hnext) { in findev()
1301 struct wordent *lp = hp->Hlex.next; in findev()
1310 if (hp->Hnum < 0) in findev()
1312 if (lp->word[0] == '\n') in findev()
1316 q = lp->word; in findev()
1324 for (dp = lp->word; *dp; dp++) { in findev()
1334 lp = lp->next; in findev()
1336 } while (lp->word[0] != '\n'); in findev()
1480 if (tpgrp != -1 && in readc()
1481 (ctpgrp = tcgetpgrp(FSHTTY)) != -1 && in readc()
1500 /* What follows is complicated EOF handling -- sterling@netcom.com */ in readc()
1539 onelflg--; in readc()
1578 size_t len = nchars > partial ? nchars - partial : 1; in wide_read()
1592 tlen = normal_mbtowc(buf + res, cbuf + i, partial - i); in wide_read()
1593 if (tlen == -1) { in wide_read()
1595 if ((partial - i) < MB_LEN_MAX && r > 0) in wide_read()
1609 nchars--; in wide_read()
1612 memmove(cbuf, cbuf + i, partial - i); in wide_read()
1613 partial -= i; in wide_read()
1618 lseek(fildes, -(off_t)partial, L_INCR); in wide_read()
1641 for (i = 0; i < (size_t)(feobp - fbobp); i++) in bgetc()
1656 ch = fbuf[0][fseekp - fbobp]; in bgetc()
1660 ch = fbuf[0][fseekp - fbobp]; in bgetc()
1684 roomleft = BUFSIZE - off; in bgetc()
1687 (void) memcpy(fbuf[buf] + off, InputBuf + c - numleft, in bgetc()
1689 numleft -= roomleft; in bgetc()
1696 roomleft = BUFSIZE - off; in bgetc()
1701 if (c == 0 || (c < 0 && fixio(SHIN, errno) == -1)) in bgetc()
1729 sb = (int) (fseekp - 1) / BUFSIZE; in bfree()
1734 fseekp -= BUFSIZE * sb; in bfree()
1735 feobp -= BUFSIZE * sb; in bfree()
1736 fblocks -= sb; in bfree()
1743 switch (aret = l->type) { in bseek()
1745 evalvec = l->a_seek; in bseek()
1746 evalp = l->c_seek; in bseek()
1752 alvec = l->a_seek; in bseek()
1753 alvecp = l->c_seek; in bseek()
1762 fseekp = l->f_seek; in bseek()
1770 for (i = 0; i < (size_t)(feobp - fbobp); i++) { in bseek()
1796 switch (l->type = aret) { in btell()
1798 l->a_seek = evalvec; in btell()
1799 l->c_seek = evalp; in btell()
1805 l->a_seek = alvec; in btell()
1806 l->c_seek = alvecp; in btell()
1816 l->f_seek = fbobp; in btell()
1817 for (i = 0; i < (size_t)(fseekp - fbobp); i++) in btell()
1818 l->f_seek += fclens[i]; in btell()
1822 l->f_seek = fseekp; in btell()
1823 l->a_seek = NULL; in btell()
1855 if ((x = lseek(SHIN, (off_t) 0, L_INCR)) == -1) in settell()