X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=pd_readline.h;h=8be5d8f27f5789a75b05207e455355ed5a25f68b;hb=d56fdb0ce92c92e27ef45a8315ff26c272a1f23d;hp=f05ec8efeea01af504064f9f6c25c8f76cfc9a10;hpb=3345932d0ab453d9ca85814fde1fe618bb36570f;p=pd_readline diff --git a/pd_readline.h b/pd_readline.h index f05ec8e..8be5d8f 100644 --- a/pd_readline.h +++ b/pd_readline.h @@ -14,21 +14,47 @@ typedef struct { } buf; +/* History. */ +typedef struct { + int curindex; + char array[20][80]; +} hist; + + + + +/* Termios funcs. */ +void initTermios(int echo) ; +void resetTermios(void) ; +char getch_(int echo); +char getch(void); +char getche(void); -/* Cursor movement funcs. */ -int up(int i); -int down(int i); + +/* Buffer funcs. */ +void error(void); +void show(buf b); +buf set(buf b, int i); +buf get(hist h); + +hist up(hist h); +hist down(hist h); buf left(buf b); buf right(buf b); buf delch(buf b); buf insch(buf b); +void enter(void); +int range(int rstart, int rend, int i); +int type(int i); + + +/* Special key handling. */ +void spec(hist h); -/* Escape-key handling. */ -int esc(int i); /* Other funcs. */ -void readhistory(char *fname); -void keyhandler(void); +hist readhistory(char *fname); +void keyhandler(buf b, hist h);