aboutsummaryrefslogtreecommitdiff
path: root/src/edbox.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-01 03:25:36 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-01 03:25:51 -0400
commit6616def8739f746ac247c65723452b8cf0b6d7a8 (patch)
treef77b6b9b4ff39492a1726aea231889adaa7a80b4 /src/edbox.c
parent007f596e3d75131086d0c165fc8848ad630aa82b (diff)
downloadfujinet-chat-6616def8739f746ac247c65723452b8cf0b6d7a8.tar.gz
Rewrite backspace() in asm. 5363 bytes free.
Diffstat (limited to 'src/edbox.c')
-rw-r--r--src/edbox.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/edbox.c b/src/edbox.c
index 39b142b..821955d 100644
--- a/src/edbox.c
+++ b/src/edbox.c
@@ -14,6 +14,7 @@ void show_cursor(void);
void storechr(char c);
void copy_to_old(void);
void restore_old(void);
+void backspace(void);
char old_edbox[EDBOX_SIZE];
char old_len;
@@ -87,7 +88,7 @@ void edbox_putc(char c) {
}
-static void del_char(void) {
+void del_char(void) {
if(!edbox_len) return;
memmove(edit_box + edbox_pos, edit_box + edbox_pos + 1, EDBOX_MAXPOS - edbox_pos);
edbox_len--;
@@ -98,15 +99,6 @@ static void del_to_end(void) {
del_char();
}
-static void backspace(void) {
- if(!edbox_pos) return;
- edbox_pos--;
- if(typeover)
- edit_box[edbox_pos] = ' ';
- else
- del_char();
-}
-
static void up(void) {
if(!edbox_len) {
restore_old();