MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ttydisc_rint

Function ttydisc_rint

components/lwp/terminal/freebsd/tty_ttydisc.c:991–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991int ttydisc_rint(struct lwp_tty *tp, char c, int flags)
992{
993 int signal, quote = 0;
994 char ob[3] = {0xff, 0x00};
995 size_t ol;
996
997 tty_assert_locked(tp);
998
999 rt_atomic_add(&tty_nin, 1);
1000
1001#ifdef USING_BSD_HOOK
1002 if (ttyhook_hashook(tp, rint))
1003 return ttyhook_rint(tp, c, flags);
1004#endif
1005
1006 if (tp->t_flags & TF_BYPASS)
1007 goto processed;
1008
1009 if (flags)
1010 {
1011 if (flags & TRE_BREAK)
1012 {
1013 if (CMP_FLAG(i, IGNBRK))
1014 {
1015 /* Ignore break characters. */
1016 return 0;
1017 }
1018 else if (CMP_FLAG(i, BRKINT))
1019 {
1020 /* Generate SIGINT on break. */
1021 tty_flush(tp, FREAD | FWRITE);
1022 lwp_tty_signal_pgrp(tp, SIGINT);
1023 return 0;
1024 }
1025 else
1026 {
1027 /* Just print it. */
1028 goto parmrk;
1029 }
1030 }
1031 else if (flags & TRE_FRAMING ||
1032 (flags & TRE_PARITY && CMP_FLAG(i, INPCK)))
1033 {
1034 if (CMP_FLAG(i, IGNPAR))
1035 {
1036 /* Ignore bad characters. */
1037 return 0;
1038 }
1039 else
1040 {
1041 /* Just print it. */
1042 goto parmrk;
1043 }
1044 }
1045 }
1046
1047 /* Allow any character to perform a wakeup. */
1048 if (CMP_FLAG(i, IXANY))

Callers 3

ttydisc_rint_simpleFunction · 0.85
tty_generic_ioctlFunction · 0.85
_serial_ty_bypassFunction · 0.85

Calls 11

tty_flushFunction · 0.85
lwp_tty_signal_pgrpFunction · 0.85
ttyoutq_write_nofragFunction · 0.85
ttydisc_echoFunction · 0.85
ttydisc_reprintFunction · 0.85
ttydisc_rubcharFunction · 0.85
ttydisc_rubwordFunction · 0.85
ttyinq_write_nofragFunction · 0.85
tty_hiwat_in_blockFunction · 0.85
ttyinq_canonicalizeFunction · 0.85

Tested by

no test coverage detected