ncurses-rs 0.0.3

a rustacean version of the ncurses api
Documentation
use std::collections::HashMap;
use ::window::Window;

/// A context that ncurses stores data about itself in
pub struct Context {
    /// A list of windows in the current ncurses context
    pub win: HashMap<String, Window>

}

impl Drop for Context {
    fn drop(&mut self){
        unsafe { 
            echo();
            curs_set(1);
            nocbreak();
            endwin();
        }
    }
}

#[link(name="ncurses")]
extern {
    fn initscr();
    fn endwin();
    fn refresh();

    fn cbreak();
    fn nocbreak();

    fn curs_set(on: u64);

    fn echo();
    fn noecho();
}

/// Create a ncurses root window and return a context
pub fn init() -> Context {
    unsafe {
        initscr(); 
        refresh(); 
        cbreak();
        noecho();
        curs_set(0);
    }
    Context { win: HashMap::new() }
}