X-Git-Url: https://pd.if.org/git/?p=pd_readline;a=blobdiff_plain;f=pd_readline.h;fp=pd_readline.h;h=8be5d8f27f5789a75b05207e455355ed5a25f68b;hp=ea5efbe4354f724e496b9535810a2c31e02308cb;hb=d56fdb0ce92c92e27ef45a8315ff26c272a1f23d;hpb=851ac869ee55686234ae246ab9b5d938aec0f225 diff --git a/pd_readline.h b/pd_readline.h index ea5efbe..8be5d8f 100644 --- a/pd_readline.h +++ b/pd_readline.h @@ -14,12 +14,31 @@ 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); + /* Buffer funcs. */ -buf set(buf b, int i); +void error(void); void show(buf b); -buf up(buf b); -buf down(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); @@ -30,12 +49,12 @@ int type(int i); /* Special key handling. */ -void spec(void); +void spec(hist h); /* Other funcs. */ -buf readhistory(char *fname); -void keyhandler(buf b); +hist readhistory(char *fname); +void keyhandler(buf b, hist h);