compat.c: wrapper to access ncurses cur_term

This commit is contained in:
Johannes Altmanninger 2023-04-09 13:54:41 +02:00
parent 9d436ee5e9
commit a696f16aa1
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,6 @@
#include <stdlib.h>
#include <term.h>
size_t C_MB_CUR_MAX() { return MB_CUR_MAX; }
int has_cur_term() { return cur_term != NULL; }

View file

@ -3,6 +3,11 @@ pub fn MB_CUR_MAX() -> usize {
unsafe { C_MB_CUR_MAX() }
}
pub fn cur_term() -> bool {
unsafe { has_cur_term() }
}
extern "C" {
fn C_MB_CUR_MAX() -> usize;
fn has_cur_term() -> bool;
}