Browse Source

Implement bfg_mvwprintw to pass through bfg_snprintf

Luke Dashjr 12 years ago
parent
commit
bb19126fa4
1 changed files with 13 additions and 0 deletions
  1. 13 0
      miner.c

+ 13 - 0
miner.c

@@ -2856,6 +2856,19 @@ void bfg_waddstr(WINDOW *win, const char *s)
 	}
 }
 
+static
+void bfg_wprintw(WINDOW *win, const char *fmt, ...)
+{
+	va_list ap;
+	char buf[0x100];
+	
+	va_start(ap, fmt);
+	bfg_vsnprintf(buf, sizeof(buf), fmt, ap);
+	va_end(ap);
+	bfg_waddstr(win, buf);
+}
+#define bfg_mvwprintw(win, y, x, ...)  (wmove(win, y, x), bfg_wprintw(win, __VA_ARGS__))
+
 static inline
 void bfg_hline(WINDOW *win, int y)
 {