]> pd.if.org Git - pd_readline/blob - pd_readline.h
8be5d8f27f5789a75b05207e455355ed5a25f68b
[pd_readline] / pd_readline.h
1
2
3 /*  pd_readline.h                                      */  
4 /*  Header file for pd_readline.                       */ 
5 /*  This code is released to the public domain.        */ 
6 /*  "Share and enjoy...."  ;)                          */  
7 /*  See the UNLICENSE file for details.                */ 
8
9
10 /*  Buffer typedef.  */ 
11 typedef struct { 
12         int index; 
13         char array[80] ; 
14 } buf;  
15
16
17 /*  History. */ 
18 typedef struct { 
19         int curindex; 
20         char array[20][80]; 
21 } hist;    
22
23
24
25
26 /*  Termios funcs.  */ 
27 void initTermios(int echo) ;
28 void resetTermios(void) ;
29 char getch_(int echo);
30 char getch(void);
31 char getche(void);
32
33
34 /*  Buffer funcs. */ 
35 void error(void); 
36 void show(buf b);
37 buf set(buf b, int i);
38 buf get(hist h); 
39
40 hist up(hist h); 
41 hist down(hist h); 
42 buf left(buf b); 
43 buf right(buf b); 
44 buf delch(buf b); 
45 buf insch(buf b); 
46 void enter(void);  
47 int range(int rstart, int rend, int i);
48 int type(int i); 
49
50
51 /*  Special key handling.  */ 
52 void spec(hist h); 
53
54
55 /*  Other funcs.  */  
56 hist readhistory(char *fname); 
57 void keyhandler(buf b, hist h);  
58
59
60
61
62
63
64
65
66