X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=pd_readline.h;h=8be5d8f27f5789a75b05207e455355ed5a25f68b;hb=d56fdb0ce92c92e27ef45a8315ff26c272a1f23d;hp=a79e7a67bac07308ba0f13ca148acbf532af4d65;hpb=a2ded27fbbe1d152bcc1927e6decff86e2c940a7;p=pd_readline diff --git a/pd_readline.h b/pd_readline.h index a79e7a6..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; + + + + +/* 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); -/* Cursor movement funcs. */ -buf up(int i); -buf down(int i); +hist up(hist h); +hist down(hist h); buf left(buf b); buf right(buf b); buf delch(buf b); @@ -28,12 +49,12 @@ int type(int i); /* Special key handling. */ -void spec(void); +void spec(hist h); /* Other funcs. */ -void readhistory(char *fname); -void keyhandler(buf b); +hist readhistory(char *fname); +void keyhandler(buf b, hist h);