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()
1220 static void n_tty_receive_parity_error(struct tty_struct *tty, unsigned char c) in n_tty_receive_parity_error() argument
1230 put_tty_queue(c, ldata); in n_tty_receive_parity_error()
1234 put_tty_queue(c, ldata); in n_tty_receive_parity_error()
1238 n_tty_receive_signal_char(struct tty_struct *tty, int signal, unsigned char c) in n_tty_receive_signal_char() argument
1244 echo_char(c, tty); in n_tty_receive_signal_char()
1268 n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_special() argument
1273 if (c == START_CHAR(tty)) { in n_tty_receive_char_special()
1278 if (c == STOP_CHAR(tty)) { in n_tty_receive_char_special()
1285 if (c == INTR_CHAR(tty)) { in n_tty_receive_char_special()
1286 n_tty_receive_signal_char(tty, SIGINT, c); in n_tty_receive_char_special()
1288 } else if (c == QUIT_CHAR(tty)) { in n_tty_receive_char_special()
1289 n_tty_receive_signal_char(tty, SIGQUIT, c); in n_tty_receive_char_special()
1291 } else if (c == SUSP_CHAR(tty)) { in n_tty_receive_char_special()
1292 n_tty_receive_signal_char(tty, SIGTSTP, c); in n_tty_receive_char_special()
1302 if (c == '\r') { in n_tty_receive_char_special()
1306 c = '\n'; in n_tty_receive_char_special()
1307 } else if (c == '\n' && I_INLCR(tty)) in n_tty_receive_char_special()
1308 c = '\r'; in n_tty_receive_char_special()
1311 if (c == ERASE_CHAR(tty) || c == KILL_CHAR(tty) || in n_tty_receive_char_special()
1312 (c == WERASE_CHAR(tty) && L_IEXTEN(tty))) { in n_tty_receive_char_special()
1313 eraser(c, tty); in n_tty_receive_char_special()
1317 if (c == LNEXT_CHAR(tty) && L_IEXTEN(tty)) { in n_tty_receive_char_special()
1329 if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && L_IEXTEN(tty)) { in n_tty_receive_char_special()
1333 echo_char(c, tty); in n_tty_receive_char_special()
1342 if (c == '\n') { in n_tty_receive_char_special()
1349 if (c == EOF_CHAR(tty)) { in n_tty_receive_char_special()
1350 c = __DISABLED_CHAR; in n_tty_receive_char_special()
1353 if ((c == EOL_CHAR(tty)) || in n_tty_receive_char_special()
1354 (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) { in n_tty_receive_char_special()
1362 echo_char(c, tty); in n_tty_receive_char_special()
1369 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_special()
1370 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1374 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1384 if (c == '\n') in n_tty_receive_char_special()
1390 echo_char(c, tty); in n_tty_receive_char_special()
1396 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_special()
1397 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1399 put_tty_queue(c, ldata); in n_tty_receive_char_special()
1404 n_tty_receive_char_inline(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_inline() argument
1417 echo_char(c, tty); in n_tty_receive_char_inline()
1421 if (c == (unsigned char) '\377' && I_PARMRK(tty)) in n_tty_receive_char_inline()
1422 put_tty_queue(c, ldata); in n_tty_receive_char_inline()
1423 put_tty_queue(c, ldata); in n_tty_receive_char_inline()
1426 static void n_tty_receive_char(struct tty_struct *tty, unsigned char c) in n_tty_receive_char() argument
1428 n_tty_receive_char_inline(tty, c); in n_tty_receive_char()
1432 n_tty_receive_char_fast(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_fast() argument
1445 echo_char(c, tty); in n_tty_receive_char_fast()
1448 put_tty_queue(c, ldata); in n_tty_receive_char_fast()
1451 static void n_tty_receive_char_closing(struct tty_struct *tty, unsigned char c) in n_tty_receive_char_closing() argument
1454 c &= 0x7f; in n_tty_receive_char_closing()
1456 c = tolower(c); in n_tty_receive_char_closing()
1459 if (c == STOP_CHAR(tty)) in n_tty_receive_char_closing()
1461 else if (c == START_CHAR(tty) || in n_tty_receive_char_closing()
1463 c != INTR_CHAR(tty) && c != QUIT_CHAR(tty) && in n_tty_receive_char_closing()
1464 c != SUSP_CHAR(tty))) { in n_tty_receive_char_closing()
1472 n_tty_receive_char_flagged(struct tty_struct *tty, unsigned char c, char flag) in n_tty_receive_char_flagged() argument
1480 n_tty_receive_parity_error(tty, c); in n_tty_receive_char_flagged()
1493 n_tty_receive_char_lnext(struct tty_struct *tty, unsigned char c, char flag) in n_tty_receive_char_lnext() argument
1500 c &= 0x7f; in n_tty_receive_char_lnext()
1502 c = tolower(c); in n_tty_receive_char_lnext()
1503 n_tty_receive_char(tty, c); in n_tty_receive_char_lnext()
1505 n_tty_receive_char_flagged(tty, c, flag); in n_tty_receive_char_lnext()
1572 unsigned char c = *cp++; in n_tty_receive_buf_standard() local
1575 c &= 0x7f; in n_tty_receive_buf_standard()
1577 c = tolower(c); in n_tty_receive_buf_standard()
1579 put_tty_queue(c, ldata); in n_tty_receive_buf_standard()
1582 if (!test_bit(c, ldata->char_map)) in n_tty_receive_buf_standard()
1583 n_tty_receive_char_inline(tty, c); in n_tty_receive_buf_standard()
1584 else if (n_tty_receive_char_special(tty, c) && count) { in n_tty_receive_buf_standard()
1606 unsigned char c = *cp++; in n_tty_receive_buf_fast() local
1608 if (!test_bit(c, ldata->char_map)) in n_tty_receive_buf_fast()
1609 n_tty_receive_char_fast(tty, c); in n_tty_receive_buf_fast()
1610 else if (n_tty_receive_char_special(tty, c) && count) { in n_tty_receive_buf_fast()
2038 size_t n, size, more, c; in canon_copy_from_read_buf() local
2069 c = n + found; in canon_copy_from_read_buf()
2072 c = min(*nr, c); in canon_copy_from_read_buf()
2073 n = c; in canon_copy_from_read_buf()
2077 __func__, eol, found, n, c, size, more); in canon_copy_from_read_buf()
2094 smp_store_release(&ldata->read_tail, ldata->read_tail + c); in canon_copy_from_read_buf()
2162 int c; in n_tty_read() local
2169 c = job_control(tty, file); in n_tty_read()
2170 if (c < 0) in n_tty_read()
2171 return c; in n_tty_read()
2336 int c; in n_tty_write() local
2374 c = *b; in n_tty_write()
2375 if (process_output(c, tty) < 0) in n_tty_write()
2386 c = tty->ops->write(tty, b, nr); in n_tty_write()
2388 if (c < 0) { in n_tty_write()
2389 retval = c; in n_tty_write()
2392 if (!c) in n_tty_write()
2394 b += c; in n_tty_write()
2395 nr -= c; in n_tty_write()