]> pd.if.org Git - pd_readline/blobdiff - pd_readline.h
More work
[pd_readline] / pd_readline.h
index 67f844c3f26b6dd49b85e6ae577d508443265efd..8be5d8f27f5789a75b05207e455355ed5a25f68b 100644 (file)
@@ -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);