conio.h: Convert printheader() to static inline function

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-07-07 12:51:25 +02:00
parent 018e607290
commit 1323a88e94
+7 -3
View File
@@ -75,9 +75,13 @@
#define textcolor(color) __set_gm(RESETATTR, color, 30)
#define textbackground(color) __set_gm(RESETATTR, color, 40)
#define printheader(fp, line, nl) \
fprintf(fp ?: stderr, "%s\033[7m%s%*s\033[0m\n", nl ? "\n" : "",\
line, SCREEN_WIDTH - (int)strlen(line), "")
static inline void printheader(FILE *fp, const char *line, int nl)
{
fprintf(fp ?: stderr,
"%s\033[7m%s%*s\033[0m\n",
nl ? "\n" : "",
line, SCREEN_WIDTH - (int)strlen(line), "");
}
#endif /* CONIO_H_ */