Lines Matching refs:c
84 #define ungetC(c) peekc = c argument
85 #define ungetD(c) peekd = c argument
91 int c; in lex() local
101 c = readc(0); in lex()
102 while (issp(c)); in lex()
104 if (HIST && c == HISTSUB && intty) in lex()
106 getexcl(c); in lex()
108 unreadc(c); in lex()
193 tchar c, c1; in word() local
205 while (issp(c = getC(DOALL))) in word()
207 if (cmap(c, _META|_ESC)||isauxsp(c)) in word()
208 switch (c) { in word()
213 *wp++ = c; in word()
215 if (c1 == c) in word()
224 c = 0; in word()
226 c1 = c; in word()
227 c = getC(0); in word()
228 } while (c != '\n'); in word()
237 *wp++ = c; in word()
241 c = getC(0); in word()
242 if (c == '\n') { in word()
247 if (c != HIST) in word()
249 c |= QUOTE; in word()
255 if (c == c1) { in word()
258 } else if (c == '\\') { in word()
259 c = getC(0); in word()
260 if (c == HIST) in word()
261 c |= QUOTE; in word()
263 if (c == '\n') in word()
266 c = ' '; in word()
269 c |= QUOTE; in word()
270 ungetC(c); in word()
271 c = '\\'; in word()
273 } else if (c == '\n') { in word()
275 ungetC(c); in word()
278 } else if (cmap(c, _META|_Q|_Q1|_ESC)||isauxsp(c)) { in word()
279 if (c == '\\') { in word()
280 c = getC(0); in word()
281 if (c == '\n') { in word()
286 if (c != HIST) in word()
288 c |= QUOTE; in word()
289 } else if (cmap(c, _Q|_Q1)) { /* '"` */ in word()
290 c1 = c; in word()
291 dolflg = c == '"' ? DOALL : DOEXCL; in word()
292 } else if (c != '#' || !intty) { in word()
293 ungetC(c); in word()
298 *wp++ = c; in word()
299 c = getC(dolflg); in word()
317 tchar c; in getC1() local
320 if (c = peekc) { in getC1()
322 return (c); in getC1()
325 if ((c = *lap++) == 0) in getC1()
333 if (!err && cmap(c, _META|_Q|_Q1)||isauxsp(c)) in getC1()
334 c |= QUOTE; in getC1()
335 return (c); in getC1()
338 if (c = peekd) { in getC1()
340 return (c); in getC1()
343 if (c = *exclp++) in getC1()
344 return (c); in getC1()
361 c = readc(0); in getC1()
362 if (c == '$' && (flag & DODOL)) { in getC1()
366 if (c == HIST && (flag & DOEXCL)) { in getC1()
370 return (c); in getC1()
378 int c; in getdol() local
386 c = sc = getC(DOEXCL); in getdol()
387 if (isspnl(c)) { in getdol()
388 ungetD(c); in getdol()
392 if (c == '{') in getdol()
393 *np++ = c, c = getC(DOEXCL); in getdol()
394 if (c == '#' || c == '?') in getdol()
395 special++, *np++ = c, c = getC(DOEXCL); in getdol()
396 *np++ = c; in getdol()
397 switch (c) { in getdol()
407 ungetD(c); in getdol()
413 if (digit(c)) { in getdol()
415 while (digit(c = getC(DOEXCL)) && (np - p) < MAX_VAR_LEN) { in getdol()
416 *np++ = c; in getdol()
418 } else if (letter(c)) { in getdol()
419 while ((letter(c = getC(DOEXCL)) || digit(c)) && in getdol()
421 *np++ = c; in getdol()
433 if (c == '[') { in getdol()
434 *np++ = c; in getdol()
436 c = getC(DOEXCL); in getdol()
437 if (c == '\n') { in getdol()
438 ungetD(c); in getdol()
448 *np++ = c; in getdol()
449 } while (c != ']'); in getdol()
450 c = getC(DOEXCL); in getdol()
452 if (c == ':') { in getdol()
453 *np++ = c, c = getC(DOEXCL); in getdol()
454 if (c == 'g') in getdol()
455 *np++ = c, c = getC(DOEXCL); in getdol()
456 *np++ = c; in getdol()
457 if (!any(c, S_htrqxe)) in getdol()
460 ungetD(c); in getdol()
462 c = getC(DOEXCL); in getdol()
463 if (c != '}') { in getdol()
464 ungetC(c); in getdol()
467 *np++ = c; in getdol()
515 int c; in getexcl() local
542 ungetC('s'), unreadc(HISTSUB), c = ':'; in getexcl()
545 c = getC(0); in getexcl()
547 if (! (c == ':' || c == '^' || c == '$' || c == '*' || in getexcl()
548 c == '-' || c == '%')) in getexcl()
551 if (c == ':') { in getexcl()
552 c = getC(0); in getexcl()
553 unreadc(c); in getexcl()
554 if (letter(c) || c == '&') { in getexcl()
555 c = ':'; in getexcl()
560 ungetC(c); in getexcl()
563 c = getC(0); in getexcl()
564 if (c == '*') in getexcl()
565 ungetC(c), c = '-'; in getexcl()
566 if (c == '-') { in getexcl()
569 c = getC(0); in getexcl()
575 if (sc == HISTSUB || c == ':') { in getexcl()
578 c = getC(0); in getexcl()
579 } while (c == ':'); in getexcl()
581 unreadc(c); in getexcl()
583 c = getC(0); in getexcl()
584 if (c != '}') in getexcl()
595 int c; in getsub() local
604 sc = c = getC(0); in getsub()
605 if (c == 'g') in getsub()
606 global++, c = getC(0); in getsub()
607 switch (c) { in getsub()
650 c = getC(0); in getsub()
651 if (c == '\n') { in getsub()
652 unreadc(c); in getsub()
655 if (c == delim) in getsub()
659 if (c == '\\') { in getsub()
660 c = getC(0); in getsub()
661 if (c != delim && c != '\\') in getsub()
664 *cp++ = c; in getsub()
676 c = getC(0); in getsub()
677 if (c == '\n') { in getsub()
678 unreadc(c); in getsub()
681 if (c == delim) in getsub()
684 if (c == '~') { in getsub()
698 if (c == '\\') { in getsub()
699 c = getC(0); in getsub()
700 if (c != delim /* && c != '~' */) in getsub()
703 *cp++ = c; in getsub()
709 if (c == '\n') in getsub()
710 unreadc(c); in getsub()
711 seterrc(gettext("Bad ! modifier: "), c); in getsub()
824 int c; in domod() local
834 for (xp = wp; c = *xp; xp++) in domod()
835 if (!issp(c) || type == 'q') in domod()
883 int c = getC(0); in getsel() local
890 switch (c) { in getsel()
904 unreadc(c); in getsel()
932 if (digit(c)) { in getsel()
934 while (digit(c)) { in getsel()
935 i = i * 10 + c - '0'; in getsel()
936 c = getC(0); in getsel()
948 unreadc(c); in getsel()
952 c = getC(0); in getsel()
953 unreadc(c); in getsel()
955 if (c == '-' || c == '$' || c == '*') in getsel()
972 int c; in gethent() local
979 c = sc == HISTSUB ? HIST : getC(0); in gethent()
980 if (c == HIST) { in gethent()
986 switch (c) { in gethent()
993 ungetC(c); in gethent()
1001 c = getC(0); in gethent()
1009 if (c == '(' || c == '=' || c == '~') { in gethent()
1010 unreadc(c); in gethent()
1014 if (digit(c)) in gethent()
1018 while (! (c == ':' || c == '\\' || isspnl(c) || c == '}')) { in gethent()
1020 *np++ = c; in gethent()
1021 c = getC(0); in gethent()
1023 unreadc(c); in gethent()
1037 c = getC(0); in gethent()
1038 if (c == '\n') { in gethent()
1039 unreadc(c); in gethent()
1042 if (c == '?') in gethent()
1045 *np++ = c; in gethent()
1061 while (digit(c)) { in gethent()
1062 event = event * 10 + c - '0'; in gethent()
1063 c = getC(0); in gethent()
1067 unreadc(c); in gethent()
1149 unreadc(tchar c) in unreadc() argument
1152 peekread = c; in unreadc()
1158 int c; in readc() local
1161 if (c = peekread) { in readc()
1163 return (c); in readc()
1167 if (c = *alvecp++) in readc()
1168 return (c); in readc()
1183 if (c = *evalp++) in readc()
1184 return (c); in readc()
1210 if ((c = *arginp++) == 0) { in readc()
1214 return (c); in readc()
1217 c = bgetc(); in readc()
1218 if (c < 0) { in readc()
1256 if (c == '\n' && onelflg) in readc()
1258 } while (c == 0); in readc()
1259 return (c); in readc()
1281 int buf, off, c; local
1296 c = read_(SHIN, fbuf[0], BUFSIZ);
1297 while (c < 0 && errno == EINTR);
1298 if (c <= 0)
1300 feobp += c;
1302 c = fbuf[0][fseekp - fbobp];
1304 return (c);
1318 c = read_(SHIN, fbuf[buf] + off, BUFSIZ - off);
1323 c = tenex(ttyline, BUFSIZ);
1324 if (c > roomleft) {
1329 (c - roomleft) * sizeof (tchar));
1330 } else if (c > 0) {
1332 c * sizeof (tchar));
1335 c = read_(SHIN, fbuf[buf] + off, roomleft);
1336 if (c > roomleft) {
1340 (c - roomleft) * sizeof (tchar));
1344 if (c >= 0)
1353 if (c <= 0)
1355 feobp += c;
1363 c = fbuf[buf][(int)fseekp % BUFSIZ];
1365 return (c);