linenoise Terminal routines separated

Hi!
I like the idea to use linenoise in notposix evironments. I'm going to rework it not to use malloc (static allocation only), files, etc. 

I started with Terminal abstraction routines. Would it be usefull in porting to Windows? Multiline is temporary broken, can be fixed. I've implemented it through functions, can be replaced with inlines or macros.

Is it interesting?