Lines Matching refs:c
90 #define ungetC(c) peekc = c argument
91 #define ungetD(c) peekd = c argument
97 int c; in lex() local
107 c = readc(0); in lex()
108 while (issp(c)); in lex()
110 if (HIST && c == HISTSUB && intty) in lex()
112 getexcl(c); in lex()
114 unreadc(c); in lex()
199 tchar c, c1; in word() local
211 while (issp(c = getC(DOALL))) in word()
213 if (cmap(c, _META|_ESC)||isauxsp(c)) in word()
214 switch (c) { in word()
219 *wp++ = c; in word()
221 if (c1 == c) in word()
230 c = 0; in word()
232 c1 = c; in word()
233 c = getC(0); in word()
234 } while (c != '\n'); in word()
243 *wp++ = c; in word()
247 c = getC(0); in word()
248 if (c == '\n') { in word()
253 if (c != HIST) in word()
255 c |= QUOTE; in word()
261 if (c == c1) { in word()
264 } else if (c == '\\') { in word()
265 c = getC(0); in word()
266 if (c == HIST) in word()
267 c |= QUOTE; in word()
269 if (c == '\n') in word()
272 c = ' '; in word()
275 c |= QUOTE; in word()
276 ungetC(c); in word()
277 c = '\\'; in word()
279 } else if (c == '\n') { in word()
281 ungetC(c); in word()
284 } else if (cmap(c, _META|_Q|_Q1|_ESC)||isauxsp(c)) { in word()
285 if (c == '\\') { in word()
286 c = getC(0); in word()
287 if (c == '\n') { in word()
292 if (c != HIST) in word()
294 c |= QUOTE; in word()
295 } else if (cmap(c, _Q|_Q1)) { /* '"` */ in word()
296 c1 = c; in word()
297 dolflg = c == '"' ? DOALL : DOEXCL; in word()
298 } else if (c != '#' || !intty) { in word()
299 ungetC(c); in word()
304 *wp++ = c; in word()
305 c = getC(dolflg); in word()
323 tchar c; in getC1() local
326 if (c = peekc) { in getC1()
328 return (c); in getC1()
331 if ((c = *lap++) == 0) in getC1()
339 if (!err_msg && cmap(c, _META|_Q|_Q1)||isauxsp(c)) in getC1()
340 c |= QUOTE; in getC1()
341 return (c); in getC1()
344 if (c = peekd) { in getC1()
346 return (c); in getC1()
349 if (c = *exclp++) in getC1()
350 return (c); in getC1()
367 c = readc(0); in getC1()
368 if (c == '$' && (flag & DODOL)) { in getC1()
372 if (c == HIST && (flag & DOEXCL)) { in getC1()
376 return (c); in getC1()
384 int c; in getdol() local
392 c = sc = getC(DOEXCL); in getdol()
393 if (isspnl(c)) { in getdol()
394 ungetD(c); in getdol()
398 if (c == '{') in getdol()
399 *np++ = c, c = getC(DOEXCL); in getdol()
400 if (c == '#' || c == '?') in getdol()
401 special++, *np++ = c, c = getC(DOEXCL); in getdol()
402 *np++ = c; in getdol()
403 switch (c) { in getdol()
413 ungetD(c); in getdol()
419 if (digit(c)) { in getdol()
421 while (digit(c = getC(DOEXCL)) && (np - p) < MAX_VAR_LEN) { in getdol()
422 *np++ = c; in getdol()
424 } else if (letter(c)) { in getdol()
425 while ((letter(c = getC(DOEXCL)) || digit(c)) && in getdol()
427 *np++ = c; in getdol()
439 if (c == '[') { in getdol()
440 *np++ = c; in getdol()
442 c = getC(DOEXCL); in getdol()
443 if (c == '\n') { in getdol()
444 ungetD(c); in getdol()
454 *np++ = c; in getdol()
455 } while (c != ']'); in getdol()
456 c = getC(DOEXCL); in getdol()
458 if (c == ':') { in getdol()
459 *np++ = c, c = getC(DOEXCL); in getdol()
460 if (c == 'g') in getdol()
461 *np++ = c, c = getC(DOEXCL); in getdol()
462 *np++ = c; in getdol()
463 if (!any(c, S_htrqxe)) in getdol()
466 ungetD(c); in getdol()
468 c = getC(DOEXCL); in getdol()
469 if (c != '}') { in getdol()
470 ungetC(c); in getdol()
473 *np++ = c; in getdol()
522 int c; in getexcl() local
549 ungetC('s'), unreadc(HISTSUB), c = ':'; in getexcl()
552 c = getC(0); in getexcl()
554 if (! (c == ':' || c == '^' || c == '$' || c == '*' || in getexcl()
555 c == '-' || c == '%')) in getexcl()
558 if (c == ':') { in getexcl()
559 c = getC(0); in getexcl()
560 unreadc(c); in getexcl()
561 if (letter(c) || c == '&') { in getexcl()
562 c = ':'; in getexcl()
567 ungetC(c); in getexcl()
570 c = getC(0); in getexcl()
571 if (c == '*') in getexcl()
572 ungetC(c), c = '-'; in getexcl()
573 if (c == '-') { in getexcl()
576 c = getC(0); in getexcl()
582 if (sc == HISTSUB || c == ':') { in getexcl()
585 c = getC(0); in getexcl()
586 } while (c == ':'); in getexcl()
588 unreadc(c); in getexcl()
590 c = getC(0); in getexcl()
591 if (c != '}') in getexcl()
602 int c; in getsub() local
611 sc = c = getC(0); in getsub()
612 if (c == 'g') in getsub()
613 global++, c = getC(0); in getsub()
614 switch (c) { in getsub()
657 c = getC(0); in getsub()
658 if (c == '\n') { in getsub()
659 unreadc(c); in getsub()
662 if (c == delim) in getsub()
666 if (c == '\\') { in getsub()
667 c = getC(0); in getsub()
668 if (c != delim && c != '\\') in getsub()
671 *cp++ = c; in getsub()
683 c = getC(0); in getsub()
684 if (c == '\n') { in getsub()
685 unreadc(c); in getsub()
688 if (c == delim) in getsub()
691 if (c == '~') { in getsub()
705 if (c == '\\') { in getsub()
706 c = getC(0); in getsub()
707 if (c != delim /* && c != '~' */) in getsub()
710 *cp++ = c; in getsub()
716 if (c == '\n') in getsub()
717 unreadc(c); in getsub()
718 seterrc(gettext("Bad ! modifier: "), c); in getsub()
831 int c; in domod() local
841 for (xp = wp; c = *xp; xp++) in domod()
842 if (!issp(c) || type == 'q') in domod()
890 int c = getC(0); in getsel() local
897 switch (c) { in getsel()
911 unreadc(c); in getsel()
939 if (digit(c)) { in getsel()
941 while (digit(c)) { in getsel()
942 i = i * 10 + c - '0'; in getsel()
943 c = getC(0); in getsel()
955 unreadc(c); in getsel()
959 c = getC(0); in getsel()
960 unreadc(c); in getsel()
962 if (c == '-' || c == '$' || c == '*') in getsel()
979 int c; in gethent() local
986 c = sc == HISTSUB ? HIST : getC(0); in gethent()
987 if (c == HIST) { in gethent()
993 switch (c) { in gethent()
1000 ungetC(c); in gethent()
1008 c = getC(0); in gethent()
1016 if (c == '(' || c == '=' || c == '~') { in gethent()
1017 unreadc(c); in gethent()
1021 if (digit(c)) in gethent()
1025 while (! (c == ':' || c == '\\' || isspnl(c) || c == '}')) { in gethent()
1027 *np++ = c; in gethent()
1028 c = getC(0); in gethent()
1030 unreadc(c); in gethent()
1044 c = getC(0); in gethent()
1045 if (c == '\n') { in gethent()
1046 unreadc(c); in gethent()
1049 if (c == '?') in gethent()
1052 *np++ = c; in gethent()
1068 while (digit(c)) { in gethent()
1069 event = event * 10 + c - '0'; in gethent()
1070 c = getC(0); in gethent()
1074 unreadc(c); in gethent()
1156 unreadc(tchar c) in unreadc() argument
1159 peekread = c; in unreadc()
1165 int c; in readc() local
1168 if (c = peekread) { in readc()
1170 return (c); in readc()
1174 if (c = *alvecp++) in readc()
1175 return (c); in readc()
1190 if (c = *evalp++) in readc()
1191 return (c); in readc()
1217 if ((c = *arginp++) == 0) { in readc()
1221 return (c); in readc()
1224 c = bgetc(); in readc()
1225 if (c < 0) { in readc()
1263 if (c == '\n' && onelflg) in readc()
1265 } while (c == 0); in readc()
1266 return (c); in readc()
1288 int buf, off, c; local
1303 c = read_(SHIN, fbuf[0], BUFSIZ);
1304 while (c < 0 && errno == EINTR);
1305 if (c <= 0)
1307 feobp += c;
1309 c = fbuf[0][fseekp - fbobp];
1311 return (c);
1325 c = read_(SHIN, fbuf[buf] + off, BUFSIZ - off);
1330 c = tenex(ttyline, BUFSIZ);
1331 if (c > roomleft) {
1336 (c - roomleft) * sizeof (tchar));
1337 } else if (c > 0) {
1339 c * sizeof (tchar));
1342 c = read_(SHIN, fbuf[buf] + off, roomleft);
1343 if (c > roomleft) {
1347 (c - roomleft) * sizeof (tchar));
1351 if (c >= 0)
1360 if (c <= 0)
1362 feobp += c;
1370 c = fbuf[buf][(int)fseekp % BUFSIZ];
1372 return (c);