* 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() */
| 850 | * else deferred to the next update event or call of update_tty() |
| 851 | */ |
| 852 | short |
| 853 | add_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 |
no test coverage detected