summaryrefslogtreecommitdiffstats
path: root/mbbsd/screen.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-14 19:50:05 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-14 19:50:05 +0800
commita298d6c46128c1b594e39578024933a696de741f (patch)
treee07278a6e7ddeefa6f308cf83b0085c45e3e42f5 /mbbsd/screen.c
parentd9e73c38f6bdb4e85ba58ccb2382f15eb9186335 (diff)
downloadpttbbs-a298d6c46128c1b594e39578024933a696de741f.tar
pttbbs-a298d6c46128c1b594e39578024933a696de741f.tar.gz
pttbbs-a298d6c46128c1b594e39578024933a696de741f.tar.bz2
pttbbs-a298d6c46128c1b594e39578024933a696de741f.tar.lz
pttbbs-a298d6c46128c1b594e39578024933a696de741f.tar.xz
pttbbs-a298d6c46128c1b594e39578024933a696de741f.tar.zst
pttbbs-a298d6c46128c1b594e39578024933a696de741f.zip
- bbs: add title for AID display
- xyz: prevent mmap crash for note_ans - pfterm/screen: add getyx_ansi - fav: add ASKBOARD to new account default favs - record: add setaidfile() git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3834 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r--mbbsd/screen.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/mbbsd/screen.c b/mbbsd/screen.c
index 25ec5c22..76a4f34f 100644
--- a/mbbsd/screen.c
+++ b/mbbsd/screen.c
@@ -96,6 +96,32 @@ getyx(int *y, int *x)
*x = cur_col;
}
+void
+getyx_ansi(int *py, int *px)
+{
+ // take ANSI length in consideration
+ register screenline_t *slp;
+ int y = cur_ln, x = cur_col;
+ char c = 0;
+
+ if (y < 0) y = 0;
+ if (y >= t_lines) y = t_lines -1;
+ if (x < 0) x = 0;
+ if (x >= ANSILINELEN) x = ANSILINELEN -1;
+
+ *py = y; *px = x;
+
+ if (y >= scr_lns || x < 1)
+ return;
+
+ slp = &big_picture[y];
+ if (slp->len < 1)
+ return;
+ c = slp->data[x];
+ *px += (strlen((char*)slp->data) - strlen_noansi((char*)slp->data));
+ slp->data[x] = c;
+}
+
static inline
screenline_t* GetCurrentLine(){
register int i = cur_ln + roll;