]> pd.if.org Git - pd_readline/blob - pd_readline.c
Starting cleanup of code.
[pd_readline] / pd_readline.c
1
2
3 /*  pd_readline.c                                      */  
4 /*  Some code to allow the editing of a command-line.  */ 
5 /*  You can also move around with the left and right   */ 
6 /*  arrow keys, and recall previous commands with the  */ 
7 /*  up-arrow key.                                      */ 
8 /*  This code is released to the public domain.        */ 
9 /*  "Share and enjoy...."  ;)                          */  
10 /*  See the UNLICENSE file for details.                */ 
11
12 /*  TO DO -                                            */ 
13 /*  a) Add support for Home and End (of line) keys.    */ 
14 /*  b) Add support for function keys.                  */ 
15 /*  c) Add support for Insert key so that text can be  */ 
16 /*     inserted.                                       */   
17 /*  d) Put much of the code into a header file.        */    
18 /*  e) Change so that pressing Enter adds the current  */  
19 /*     line of commands to the command-history.        */ 
20 /*     ( May look at using Ctrl-D to exit, as Python   */ 
21 /*     does with its command-line. )                   */           
22 /*  f) Add support for copying and pasting text via    */ 
23 /*     Ctrl-C and Ctrl-V.                              */  
24
25
26
27
28
29 int main(void) 
30
31   
32   /* Read in the command history file. */ 
33   readhistory();  
34   
35   
36   while(1) 
37   {  
38        
39     keyhandler();   
40         
41   }         
42                                       
43   return 0;
44         
45 }  
46
47
48
49
50
51