Closed
Description
From reading rust.md and tutorial-ffi.md, I did not see how to expose a global variable from a library. (E.g. I've been poking at hooking into pdcurses / ncurses, and ncurses in some platforms uses global variables to expose curscr/newscr/stdscr).
As far as I can tell, one can do this via the syntax you would expect, namely:
pub extern {
static curscr: *WINDOW;
....
unsafe fn addch (_:chtype) -> c_int;
...
}
But we should be more up front about whether this is the official syntax, or whether I am just getting lucky here in the short-term and that one should not expect linkage to non-functions to work in the long-term.