aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-01 03:51:34 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-01 03:51:43 -0400
commit546e07e530e100a739a510efc2731e32d8679ec1 (patch)
treefd61202cbfec53d63e3c0384e8cfc5cde1665d47 /src
parent6616def8739f746ac247c65723452b8cf0b6d7a8 (diff)
downloadfujinet-chat-546e07e530e100a739a510efc2731e32d8679ec1.tar.gz
Rewrite inschr() in asm. 5372 bytes free.
Diffstat (limited to 'src')
-rw-r--r--src/edbox.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/edbox.c b/src/edbox.c
index 821955d..bbad5c1 100644
--- a/src/edbox.c
+++ b/src/edbox.c
@@ -15,6 +15,7 @@ void storechr(char c);
void copy_to_old(void);
void restore_old(void);
void backspace(void);
+void inschr(char c);
char old_edbox[EDBOX_SIZE];
char old_len;
@@ -52,18 +53,6 @@ void move_right(void) {
memmove(edit_box + edbox_pos + 1, edit_box + edbox_pos, EDBOX_MAXPOS - edbox_pos);
}
-void inschr(char c) {
- if(edbox_len == EDBOX_MAXPOS) {
- /* buffer full, can't insert */
- bell();
- return;
- }
- move_right();
- edbox_len++;
- storechr(c);
- edbox_pos++;
-}
-
/* note: c will never be an EOL.
idea: when the edbox is completely full (240 chars), go
ahead and pretend the user pressed Return (call edbox_callback,