1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
use libc;
use types;
extern "C" {
pub fn vt100_screen_new(
rows: libc::c_int,
cols: libc::c_int
) -> *mut types::ScreenImpl;
pub fn vt100_screen_delete(screen: *mut types::ScreenImpl);
pub fn vt100_screen_process_string(
screen: *mut types::ScreenImpl,
buf: *const libc::c_char,
len: libc::size_t,
) -> libc::c_int;
pub fn vt100_screen_get_string_plaintext(
screen: *mut types::ScreenImpl,
start: *const types::Loc,
end: *const types::Loc,
outp: *mut *mut libc::c_char,
outlen: *mut libc::size_t,
);
pub fn vt100_screen_set_window_size(
screen: *mut types::ScreenImpl,
rows: libc::c_int,
cols: libc::c_int,
);
pub fn vt100_screen_set_scrollback_length(
screen: *mut types::ScreenImpl,
rows: libc::c_int,
);
pub fn vt100_screen_cell_at(
screen: *mut types::ScreenImpl,
row: libc::c_int,
col: libc::c_int,
) -> *mut types::CellImpl;
pub fn vt100_wrapper_screen_hide_cursor(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_application_keypad(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_application_cursor(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_mouse_reporting_press(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_mouse_reporting_press_release(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_mouse_reporting_button_motion(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_mouse_reporting_sgr_mode(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_screen_bracketed_paste(screen: *mut types::ScreenImpl) -> libc::c_int;
pub fn vt100_wrapper_cell_is_wide(cell: *mut types::CellImpl) -> libc::c_int;
pub fn vt100_wrapper_cell_attrs_bold(cell: *mut types::CellAttrs) -> libc::c_int;
pub fn vt100_wrapper_cell_attrs_italic(cell: *mut types::CellAttrs) -> libc::c_int;
pub fn vt100_wrapper_cell_attrs_underline(cell: *mut types::CellAttrs) -> libc::c_int;
pub fn vt100_wrapper_cell_attrs_inverse(cell: *mut types::CellAttrs) -> libc::c_int;
}
#[cfg(test)]
mod tests {
#[test]
fn ffi() {
let ptr = unsafe { super::vt100_screen_new(24, 80) };
assert!(!ptr.is_null());
unsafe { super::vt100_screen_delete(ptr) };
}
}
|