#ifndef _JMVWGETNSTR_H
#define _JMVWGETNSTR_H

#define E_INVALID_WINDOW		(-1)
#define E_NOT_ENOUGH_MEM		(-2)
#define E_INVALID_POS			(-3)
#define E_INVALID_LEN			(-4)
#define E_INVALID_STR			(-5)
#define E_INVALID_BUF			(-6)
#define E_CANT_INSERT			(-7)
#define E_CANT_DELETE			(-8)
#define E_INVALID_ARG			(-9)
#define E_CANT_HAPPEN			(-128)

#define KEY_ESC					(0x1B)
#define KEY_TAB					(0x09)
#define KEY_DELETE				(0x7f)
#define KEY_RETURN				(0x0a)

extern int jmvwgetnstr(WINDOW *win, int y, int x, unsigned char *str, int n, int wmode, int cmode);
#define jmvgetnstr(y,x,str,n)	jmvgetnstr(stdscr, (y), (x), (str), (n))
#define	jgetnstr(str,n)			(int x=(stdscr)?stdscr->_cury:ERR, int x=(stdscr)?stdscr->_curx:ERR, \
										jmvwgetnstr(stdscr,y,x,(str),(n)))
#define jwgetnstr(win,str,n)	(int x=(win)?(win)->_cury:ERR, int x=(win)?(win)->_curx:ERR, jmvwgetnstr((win),y,x,(str),(n)))

#endif
