#define TERMINAL_MODE 0
#define PDAKB_MODE 1

#define BACKSPACE 0x08
#define TAB 0x09
#define ENTER 0x0a
#define ESCAPE 0x1b

#define KEY_DOWN 0x102
#define KEY_UP 0x103
#define KEY_LEFT 0x104
#define KEY_RIGHT 0x105
#define KEY_BACKSPACE BACKSPACE

#define REAL_SCREEN_W 28
#define REAL_SCREEN_H 18
#define SCREEN_W REAL_SCREEN_W
#define SCREEN_H REAL_SCREEN_H

int getch();
void move(int y, int x);
int getcurx();
int getcury();
void addch(int c);
void insch(int c);
void delch();
void addstr(char *string);
void insertln();
void deleteln();

int initscr();
void endwin();

int keyb_setmode(int mode);
void set_stdout_flag(int flag);
int get_stdout_flag();
/* 
 * getscr: 
 * if tscreen is already opened(by the parent process etc.),
 * don't init the screen, and set stdout flag.
 */ 
int getscr(); 
