diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-03-01 20:49:18 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-03-01 20:49:18 +0800 |
commit | 9c634694d8b980f3a3c50d54dc174ca913204145 (patch) | |
tree | fffd0d79b31388e1c8e05260a3cf962c1b4a9534 | |
parent | 321e5d90f18d32ca1517572a376b042aa1939e78 (diff) | |
download | pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar.gz pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar.bz2 pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar.lz pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar.xz pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.tar.zst pttbbs-9c634694d8b980f3a3c50d54dc174ca913204145.zip |
Add mvprints (like ncurses mvprintw)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4444 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/visio.h | 1 | ||||
-rw-r--r-- | mbbsd/visio.c | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/visio.h b/include/visio.h index 626f12e5..42e32136 100644 --- a/include/visio.h +++ b/include/visio.h @@ -101,6 +101,7 @@ typedef struct { // curses flavor void prints(const char *fmt, ...) GCC_CHECK_FORMAT(1,2); +void mvprints(int y, int x, const char *fmt, ...) GCC_CHECK_FORMAT(3,4); void mvouts(int y, int x, const char *str); // input history diff --git a/mbbsd/visio.c b/mbbsd/visio.c index 20f711a6..bbc29ee8 100644 --- a/mbbsd/visio.c +++ b/mbbsd/visio.c @@ -159,6 +159,22 @@ prints(const char *fmt,...) } /** + * mvprints(int y, int x, fmt, ...): 使用 mvouts 輸出並格式化字串。 + */ +void +mvprints(int y, int x, const char *fmt, ...) +{ + va_list args; + char buff[VBUFLEN]; + + va_start(args, fmt); + vsnprintf(buff, sizeof(buff), fmt, args); + va_end(args); + + mvouts(x, y, buff); +} + +/** * mvouts(y, x, str): = mvaddstr */ void |