mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
ncplane_printf_stainable() and _vfprintf_stainable() #754
This commit is contained in:
parent
4a97c139e6
commit
5cf912feb6
@ -1519,6 +1519,8 @@ ncplane_vprintf(struct ncplane* n, const char* format, va_list ap){
|
||||
return ncplane_vprintf_yx(n, -1, -1, format, ap);
|
||||
}
|
||||
|
||||
API int ncplane_vprintf_stainable(struct ncplane* n, const char* format, va_list ap);
|
||||
|
||||
static inline int
|
||||
ncplane_printf(struct ncplane* n, const char* format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
@ -1559,6 +1561,19 @@ ncplane_printf_aligned(struct ncplane* n, int y, ncalign_e align, const char* fo
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int
|
||||
ncplane_printf_stainable(struct ncplane* n, const char* format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
static inline int
|
||||
ncplane_printf_stainable(struct ncplane* n, const char* format, ...){
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
int ret = ncplane_vprintf_stainable(n, format, va);
|
||||
va_end(va);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Write the specified text to the plane, breaking lines sensibly, beginning at
|
||||
// the specified line. Returns the number of columns written. When breaking a
|
||||
// line, the line will be cleared to the end of the plane (the last line will
|
||||
|
@ -1456,6 +1456,16 @@ int ncplane_vprintf_aligned(ncplane* n, int y, ncalign_e align,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ncplane_vprintf_stainable(struct ncplane* n, const char* format, va_list ap){
|
||||
char* r = ncplane_vprintf_prep(format, ap);
|
||||
if(r == NULL){
|
||||
return -1;
|
||||
}
|
||||
int ret = ncplane_putstr_stainable(n, r);
|
||||
free(r);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ncplane_hline_interp(ncplane* n, const cell* c, int len,
|
||||
uint64_t c1, uint64_t c2){
|
||||
unsigned ur, ug, ub;
|
||||
|
Loading…
x
Reference in New Issue
Block a user