mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
add ncdirect_flush() #926
This commit is contained in:
parent
d110facec1
commit
6bb8f447b5
2
NEWS.md
2
NEWS.md
@ -17,6 +17,8 @@ rearrangements of Notcurses.
|
||||
Rewrote `cell_set_fg_palindex()` and `cell_set_bg_palindex()` in terms
|
||||
of these two. This is possible because the palette index now overlaps the
|
||||
RGB in a channel (they were originally in the attrword).
|
||||
* Added `ncdirect_flush()`, mainly for the benefit of FFI that might not
|
||||
have a native interface to `fflush(3)`.
|
||||
|
||||
* 1.6.15 (2020-08-16)
|
||||
* Styles now work properly with `ncdirect`, which apparently has never
|
||||
|
@ -36,6 +36,9 @@ API unsigned ncdirect_palette_size(const struct ncdirect* nc);
|
||||
// necessarily be immediately visible.
|
||||
API int ncdirect_putstr(struct ncdirect* nc, uint64_t channels, const char* utf8);
|
||||
|
||||
// Force a flush. Returns 0 on success, -1 on failure.
|
||||
API int ncdirect_flush(struct ncdirect* nc);
|
||||
|
||||
static inline int
|
||||
ncdirect_bg_rgb(struct ncdirect* nc, unsigned r, unsigned g, unsigned b){
|
||||
if(r > 255 || g > 255 || b > 255){
|
||||
|
@ -796,3 +796,10 @@ bool ncdirect_canopen_images(const ncdirect* n){
|
||||
bool ncdirect_canutf8(const ncdirect* n){
|
||||
return n->utf8;
|
||||
}
|
||||
|
||||
int ncdirect_flush(const ncdirect* nc){
|
||||
if(fflush(nc->ttyfp) == EOF){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user