From 70ed854dae44ca26b2d53b5063fd9d2677aa5301 Mon Sep 17 00:00:00 2001 From: ryt <0x747972@gmail.com> Date: Fri, 22 Mar 2019 14:51:24 +0000 Subject: [PATCH] add mutt_window_mvaddnstr() --- mutt_window.c | 15 +++++++++++++++ mutt_window.h | 1 + 2 files changed, 16 insertions(+) diff --git a/mutt_window.c b/mutt_window.c index f7539f5a0..ffadc12a0 100644 --- a/mutt_window.c +++ b/mutt_window.c @@ -192,6 +192,21 @@ int mutt_window_mvaddstr(struct MuttWindow *win, int row, int col, const char *s return mvaddstr(win->row_offset + row, win->col_offset + col, str); } +/** + * mutt_window_mvaddnstr - Move the cursor and write a fixed string to a Window with string length + * @param win Window to write to + * @param row Row to move to + * @param col Column to move to + * @param str String to write + * @param n Length of string + * @retval OK Success + * @retval ERR Error + */ +int mutt_window_mvaddnstr(struct MuttWindow *win, int row, int col, const char *str, int n) +{ + return mvaddnstr(win->row_offset + row, win->col_offset + col, str, n); +} + /** * mutt_window_mvprintw - Move the cursor and write a formatted string to a Window * @param win Window to write to diff --git a/mutt_window.h b/mutt_window.h index 31fd1c564..f8d04a855 100644 --- a/mutt_window.h +++ b/mutt_window.h @@ -53,6 +53,7 @@ void mutt_window_getxy(struct MuttWindow *win, int *x, int *y); void mutt_window_init(void); int mutt_window_move(struct MuttWindow *win, int row, int col); int mutt_window_mvaddch(struct MuttWindow *win, int row, int col, const chtype ch); +int mutt_window_mvaddnstr(struct MuttWindow *win, int row, int col, const char *str, int n); int mutt_window_mvaddstr(struct MuttWindow *win, int row, int col, const char *str); int mutt_window_mvprintw(struct MuttWindow *win, int row, int col, const char *fmt, ...); void mutt_window_reflow_message_rows(int mw_rows); -- 2.40.0