X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=pd_readline.h;h=8be5d8f27f5789a75b05207e455355ed5a25f68b;hb=d56fdb0ce92c92e27ef45a8315ff26c272a1f23d;hp=67f844c3f26b6dd49b85e6ae577d508443265efd;hpb=2aac28bc15a87f5fde5daa83352f9f9b675fc635;p=pd_readline diff --git a/pd_readline.h b/pd_readline.h index 67f844c..8be5d8f 100644 --- a/pd_readline.h +++ b/pd_readline.h @@ -14,10 +14,31 @@ typedef struct { } buf; +/* History. */ +typedef struct { + int curindex; + char array[20][80]; +} hist; + + + -/* Cursor movement funcs. */ -buf up(int i); -buf down(int i); +/* Termios funcs. */ +void initTermios(int echo) ; +void resetTermios(void) ; +char getch_(int echo); +char getch(void); +char getche(void); + + +/* 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); @@ -27,12 +48,13 @@ int range(int rstart, int rend, int i); int type(int i); -/* Escape-key handling. */ -int spec(int i); +/* Special key handling. */ +void spec(hist h); + /* Other funcs. */ -void readhistory(char *fname); -void keyhandler(buf b); +hist readhistory(char *fname); +void keyhandler(buf b, hist h);