MCPcopy Create free account
hub / github.com/NetHack/NetHack / add_tty_char

Function add_tty_char

outdated/sys/mac/mactty.c:852–876  ·  view source on GitHub ↗

* Add a single character. It is drawn directly if the correct flag is set, * else deferred to the next update event or call of update_tty() */

Source from the content-addressed store, hash-verified

850 * else deferred to the next update event or call of update_tty()
851 */
852short
853add_tty_char(WindowPtr window, short character)
854{
855 register char is_control;
856 char ch;
857 RECORD_EXISTS(record);
858
859 if (!(record->attribute[TTY_ATTRIB_FLAGS] & TA_WRAP_AROUND)
860 && record->x_curs >= record->x_size)
861 return noErr; /* Optimize away drawing across border without wrap */
862
863 if (record->curs_state != 0)
864 curs_pos(record, record->x_curs, record->y_curs, 0);
865
866 ch = character;
867 is_control = (ch < sizeof(long) * 8) && ((s_control & (1 << ch)) != 0L);
868 if (is_control)
869 do_control(record, ch);
870 else {
871 do_add_string(record, (char *) &ch, 1);
872 do_add_cursor(record, record->x_curs + 1);
873 }
874
875 return noErr;
876}
877
878/*
879 * Add a null-terminated string of characters

Callers 1

term_putcFunction · 0.85

Calls 4

curs_posFunction · 0.85
do_controlFunction · 0.85
do_add_stringFunction · 0.85
do_add_cursorFunction · 0.85

Tested by

no test coverage detected