Lines Matching refs:c
305 static inline void put_tty_queue(unsigned char c, struct n_tty_data *ldata) in put_tty_queue() argument
307 *read_buf_addr(ldata, ldata->read_head) = c; in put_tty_queue()
403 static inline int is_utf8_continuation(unsigned char c) in is_utf8_continuation() argument
405 return (c & 0xc0) == 0x80; in is_utf8_continuation()
416 static inline int is_continuation(unsigned char c, struct tty_struct *tty) in is_continuation() argument
418 return I_IUTF8(tty) && is_utf8_continuation(c); in is_continuation()
443 static int do_output_char(unsigned char c, struct tty_struct *tty, int space) in do_output_char() argument
451 switch (c) { in do_output_char()
468 c = '\n'; in do_output_char()
491 if (!iscntrl(c)) { in do_output_char()
493 c = toupper(c); in do_output_char()
494 if (!is_continuation(c, tty)) in do_output_char()
500 tty_put_char(tty, c); in do_output_char()
518 static int process_output(unsigned char c, struct tty_struct *tty) in process_output() argument
526 retval = do_output_char(c, tty, space); in process_output()
573 unsigned char c = *cp; in process_output_block() local
575 switch (c) { in process_output_block()
597 if (!iscntrl(c)) { in process_output_block()
600 if (!is_continuation(c, tty)) in process_output_block()
643 unsigned char c; in __process_echoes() local
649 c = echo_buf(ldata, tail); in __process_echoes()
650 if (c == ECHO_OP_START) { in __process_echoes()
742 int retval = do_output_char(c, tty, space); in __process_echoes()
749 tty_put_char(tty, c); in __process_echoes()
839 static inline void add_echo_byte(unsigned char c, struct n_tty_data *ldata) in add_echo_byte() argument
841 *echo_buf_addr(ldata, ldata->echo_head++) = c; in add_echo_byte()
913 static void echo_char_raw(unsigned char c, struct n_tty_data *ldata) in echo_char_raw() argument
915 if (c == ECHO_OP_START) { in echo_char_raw()
919 add_echo_byte(c, ldata); in echo_char_raw()
935 static void echo_char(unsigned char c, struct tty_struct *tty) in echo_char() argument
939 if (c == ECHO_OP_START) { in echo_char()
943 if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') in echo_char()
945 add_echo_byte(c, ldata); in echo_char()
975 static void eraser(unsigned char c, struct tty_struct *tty) in eraser() argument
987 if (c == ERASE_CHAR(tty)) in eraser()
989 else if (c == WERASE_CHAR(tty)) in eraser()
1015 c = read_buf(ldata, head); in eraser()
1016 } while (is_continuation(c, tty) && head != ldata->canon_head); in eraser()
1019 if (is_continuation(c, tty)) in eraser()
1024 if (isalnum(c) || c == '_') in eraser()
1038 echo_char(c, tty); in eraser()
1046 } else if (c == '\t') { in eraser()
1060 c = read_buf(ldata, tail); in eraser()
1061 if (c == '\t') { in eraser()
1064 } else if (iscntrl(c)) { in eraser()
1067 } else if (!is_continuation(c, tty)) { in eraser()
1073 if (iscntrl(c) && L_ECHOCTL(tty)) { in eraser()
1078 if (!iscntrl(c) || L_ECHOCTL(tty)) { in eraser()
1223 static void n_tty_receive_parity_error(struct tty_struct *tty, unsigned char c) in n_tty_receive_parity_error() argument
1233 put_tty_queue(c, ldata); in n_tty_receive_parity_error()
1237 put_tty_queue(c, ldata); in n_tty_receive_parity_error()
1243 n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c) in n_tty_receive_signal_char() argument
1249 echo_char(c, tty); in n_tty_receive_signal_char()
1273 n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_special() argument
1278 if (c == START_CHAR(tty)) { in n_tty_receive_char_special()
1283 if (c == STOP_CHAR(tty)) { in n_tty_receive_char_special()
1290 if (c == INTR_CHAR(tty)) { in n_tty_receive_char_special()
1291 n_tty_receive_signal_char(tty, SIGINT, c); in n_tty_receive_char_special()
1293 } else if (c == QUIT_CHAR(tty)) { in n_tty_receive_char_special()
1294 n_tty_receive_signal_char(tty, SIGQUIT, c); in n_tty_receive_char_special()
1296 } else if (c == SUSP_CHAR(tty)) { in n_tty_receive_char_special()
1297 n_tty_receive_signal_char(tty, SIGTSTP, c); in n_tty_receive_char_special()
1307 if (c == '\r') { in n_tty_receive_char_special()
1311 c = '\n'; in n_tty_receive_char_special()
1312 } else if (c == '\n' && I_INLCR(tty)) in n_tty_receive_char_special()
1313 c = '\r'; in n_tty_receive_char_special()
1316 if (c == ERASE_CHAR(tty) || c == KILL_CHAR(tty) || in n_tty_receive_char_special()
1317 (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) { in n_tty_receive_char_special()
1318 eraser(c, tty); in n_tty_receive_char_special()
1322 if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) { in n_tty_receive_char_special()
1334 if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && L_IEXTEN(tty)) { in n_tty_receive_char_special()
1338 echo_char(c, tty); in n_tty_receive_char_special()
1347 if (c == '\n') { in n_tty_receive_char_special()
1354 if (c == EOF_CHAR(tty)) { in n_tty_receive_char_special()
1355 c = __DISABLED_CHAR; in n_tty_receive_char_special()
1358 if ((c == EOL_CHAR(tty)) || in n_tty_receive_char_special()
1359 (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) { in n_tty_receive_char_special()
1367 echo_char(c, tty); in n_tty_receive_char_special()
1374 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_special()
1375 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1379 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1389 if (c == '\n') in n_tty_receive_char_special()
1395 echo_char(c, tty); in n_tty_receive_char_special()
1401 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_special()
1402 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1404 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1409 n_tty_receive_char_inline(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_inline() argument
1422 echo_char(c, tty); in n_tty_receive_char_inline()
1426 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_inline()
1427 put_tty_queue(c, ldata); in n_tty_receive_char_inline()
1428 put_tty_queue(c, ldata); in n_tty_receive_char_inline()
1431 static void n_tty_receive_char(struct tty_struct *tty, unsigned char c) in n_tty_receive_char() argument
1433 n_tty_receive_char_inline(tty, c); in n_tty_receive_char()
1437 n_tty_receive_char_fast(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_fast() argument
1450 echo_char(c, tty); in n_tty_receive_char_fast()
1453 put_tty_queue(c, ldata); in n_tty_receive_char_fast()
1456 static void n_tty_receive_char_closing(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_closing() argument
1459 c &= 0x7f; in n_tty_receive_char_closing()
1461 c = tolower(c); in n_tty_receive_char_closing()
1464 if (c == STOP_CHAR(tty)) in n_tty_receive_char_closing()
1466 else if (c == START_CHAR(tty) || in n_tty_receive_char_closing()
1468 c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && in n_tty_receive_char_closing()
1469 c != SUSP_CHAR(tty))) { in n_tty_receive_char_closing()
1477 n_tty_receive_char_flagged(struct tty_struct *tty, unsigned char c, char flag) in n_tty_receive_char_flagged() argument
1487 n_tty_receive_parity_error(tty, c); in n_tty_receive_char_flagged()
1500 n_tty_receive_char_lnext(struct tty_struct *tty, unsigned char c, char flag) in n_tty_receive_char_lnext() argument
1507 c &= 0x7f; in n_tty_receive_char_lnext()
1509 c = tolower(c); in n_tty_receive_char_lnext()
1510 n_tty_receive_char(tty, c); in n_tty_receive_char_lnext()
1512 n_tty_receive_char_flagged(tty, c, flag); in n_tty_receive_char_lnext()
1579 unsigned char c = *cp++; in n_tty_receive_buf_standard() local
1582 c &= 0x7f; in n_tty_receive_buf_standard()
1584 c = tolower(c); in n_tty_receive_buf_standard()
1586 put_tty_queue(c, ldata); in n_tty_receive_buf_standard()
1589 if (!test_bit(c, ldata->char_map)) in n_tty_receive_buf_standard()
1590 n_tty_receive_char_inline(tty, c); in n_tty_receive_buf_standard()
1591 else if (n_tty_receive_char_special(tty, c) && count) { in n_tty_receive_buf_standard()
1613 unsigned char c = *cp++; in n_tty_receive_buf_fast() local
1615 if (!test_bit(c, ldata->char_map)) in n_tty_receive_buf_fast()
1616 n_tty_receive_char_fast(tty, c); in n_tty_receive_buf_fast()
1617 else if (n_tty_receive_char_special(tty, c) && count) { in n_tty_receive_buf_fast()
2045 size_t n, size, more, c; in canon_copy_from_read_buf() local
2077 c = n; in canon_copy_from_read_buf()
2085 __func__, eol, found, n, c, size, more); in canon_copy_from_read_buf()
2102 smp_store_release(&ldata->read_tail, ldata->read_tail + c); in canon_copy_from_read_buf()
2183 int c; in n_tty_read() local
2190 c = job_control(tty, file); in n_tty_read()
2191 if (c < 0) in n_tty_read()
2192 return c; in n_tty_read()
2360 int c; in n_tty_write() local
2398 c = *b; in n_tty_write()
2399 if (process_output(c, tty) < 0) in n_tty_write()
2410 c = tty->ops->write(tty, b, nr); in n_tty_write()
2412 if (c < 0) { in n_tty_write()
2413 retval = c; in n_tty_write()
2416 if (!c) in n_tty_write()
2418 b += c; in n_tty_write()
2419 nr -= c; in n_tty_write()