]> pd.if.org Git - pd_readline/commitdiff
More work.
authorandy <andy@obsidian.(none)>
Mon, 22 Oct 2012 02:39:49 +0000 (15:39 +1300)
committerandy <andy@obsidian.(none)>
Mon, 22 Oct 2012 02:39:49 +0000 (15:39 +1300)
Makefile
keyhandler.c
pd_readline.c
pd_readline.h [new file with mode: 0644]

index be2e21aee184fd346a3b9ccdca091bf5dc5230e5..514bca2a56080eb7d15fc4a0c47421ce3d6c846c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,9 @@ LIBS = -l$(SYSLIBS) $(MYLIBS)
 
 RM = rm -f 
 
-#HEADERS= foo.h  bar.h  baz.h  
+HEADERS= pd_readline.h 
 
-OBJECTS = pd_readline.o  keyhandler.o  funcs.o  history.o
+OBJECTS =  keyhandler.o  funcs.o  history.o pd_readline.o
 
 %.o: %.c
        $(CC) $(CFLAGS) $< -o $@
@@ -27,7 +27,7 @@ OBJECTS = pd_readline.o  keyhandler.o  funcs.o  history.o
 pd_readline: $(OBJECTS)
        $(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
 
-#pd_readline.o: $(HEADERS)
+pd_readline.o: $(HEADERS)
 #keyhandler.o: $(HEADERS)
 #funcs.o: $(HEADERS)
 #history.o: $(HEADERS)
index 0130e9bf5829e9b3ef81db2b3bd4b1ad898912d0..6cbe358627f6efbc61642848bc0f103da2feea8f 100644 (file)
@@ -62,12 +62,12 @@ int keyhandler(void)
 { 
   int i = getch(); 
   
-  switch(i)
+  switch(i)
   { 
     case (27):  escape() ; 
     case (33):  dosomething();  
     case (42):  something();
-    default:    stuff()
+    default:    stuff();
   }   
   
 } 
index 5f000bdab589e4ae81f25b9843ad60965388b9c0..033dfc1b96b2f4f05a493ebc3871a9bee503bee0 100644 (file)
 /*     Ctrl-C and Ctrl-V.                              */  
 
 
-
+#include "pd_readline.h"   
 
 
 int main(void) 
 { 
   
   /* Read in the command history file. */ 
-  readhistory();  
+  readhistory("test.txt");  
   
   
   while(1) 
diff --git a/pd_readline.h b/pd_readline.h
new file mode 100644 (file)
index 0000000..021933e
--- /dev/null
@@ -0,0 +1,40 @@
+
+
+/*  pd_readline.h                                      */  
+/*  Header file for pd_readline.                       */ 
+/*  This code is released to the public domain.        */ 
+/*  "Share and enjoy...."  ;)                          */  
+/*  See the UNLICENSE file for details.                */ 
+
+
+/*  Buffer typedef.  */ 
+typedef struct { 
+       int index; 
+       char array[80] ; 
+} buf;  
+
+
+
+/*  Cursor movement funcs. */ 
+int up(int i); 
+int down(int i); 
+buf left(buf b); 
+buf right(buf b); 
+buf delch(buf b); 
+buf insch(buf b); 
+
+/*  Escape-key handling.  */ 
+int esc(int i); 
+
+/*  Other funcs.  */  
+void readhistory(char *fname); 
+int keyhandler(void);  
+
+
+
+
+
+
+
+
+