]> pd.if.org Git - pd_readline/commitdiff
More work.
authorandy <andy@obsidian.(none)>
Mon, 22 Oct 2012 03:24:30 +0000 (16:24 +1300)
committerandy <andy@obsidian.(none)>
Mon, 22 Oct 2012 03:24:30 +0000 (16:24 +1300)
Makefile
funcs.c
history.c
keyhandler.c
pd_readline.c
pd_readline.h

index 514bca2a56080eb7d15fc4a0c47421ce3d6c846c..1e008fd900d61b278beb6acea43e4bdc694f28f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 
 CC = gcc
 
 
 CC = gcc
 
-CFLAGS = -O2 -Wall -g $(DEFINES)
+CFLAGS = -O2 -Wall -g -c $(DEFINES)
 
 
 # INCPATH = -I.
 
 
 # INCPATH = -I.
@@ -13,7 +13,7 @@ INCPATH = .
 
 LDFLAGS = $(SYSLDFLAGS) $(MYLDFLAGS)
 
 
 LDFLAGS = $(SYSLDFLAGS) $(MYLDFLAGS)
 
-LIBS = -l$(SYSLIBS) $(MYLIBS)
+LIBS = -l$(SYSLIBS) $(MYLIBS)
 
 RM = rm -f 
 
 
 RM = rm -f 
 
@@ -27,15 +27,15 @@ OBJECTS =  keyhandler.o  funcs.o  history.o pd_readline.o
 pd_readline: $(OBJECTS)
        $(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
 
 pd_readline: $(OBJECTS)
        $(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
 
+keyhandler.o: $(HEADERS)
+funcs.o: $(HEADERS)
+history.o: $(HEADERS)
 pd_readline.o: $(HEADERS)
 pd_readline.o: $(HEADERS)
-#keyhandler.o: $(HEADERS)
-#funcs.o: $(HEADERS)
-#history.o: $(HEADERS)
 
 
 .PHONY: clean
 clean:
 
 
 .PHONY: clean
 clean:
-       rm *.o pd_readline
+       rm *.o 
 
 
 
 
 
 
diff --git a/funcs.c b/funcs.c
index 7444e66b7a713889e90102d7ba3b074b2228a9bf..e259f16c68c6265e0ed5cc27a6519ae0aeb02030 100644 (file)
--- a/funcs.c
+++ b/funcs.c
@@ -11,7 +11,7 @@
 #include <string.h>   
 #include <stdio.h> 
 #include <stdlib.h> 
 #include <string.h>   
 #include <stdio.h> 
 #include <stdlib.h> 
-
+#include "pd_readline.h"  
 
 
 /* Move up in history list. */ 
 
 
 /* Move up in history list. */ 
index f8a0d256d81c6b29b3a0ac7d4eb99c7508734088..f84ec24bda425a41a49ebe8277fa45c919ea49f8 100644 (file)
--- a/history.c
+++ b/history.c
@@ -6,6 +6,9 @@
 /*  "Share and enjoy...."  ;)                          */  
 /*  See the UNLICENSE file for details.                */ 
 
 /*  "Share and enjoy...."  ;)                          */  
 /*  See the UNLICENSE file for details.                */ 
 
+#include <string.h>   
+#include <stdio.h> 
+#include <stdlib.h> 
 
 
 /*  Helper function, to let us see if a file */ 
 
 
 /*  Helper function, to let us see if a file */ 
index 6cbe358627f6efbc61642848bc0f103da2feea8f..80ad5e5461f310dabafdc539c1d0a517fa638533 100644 (file)
@@ -12,6 +12,7 @@
 #include <stdio.h> 
 #include <stdlib.h> 
 #include <termios.h>  
 #include <stdio.h> 
 #include <stdlib.h> 
 #include <termios.h>  
+#include "pd_readline.h"  
 
 
 /* This implementation of getch() is from here - */ 
 
 
 /* This implementation of getch() is from here - */ 
@@ -58,16 +59,16 @@ char getche(void) {
 
 
 
 
 
 
-int keyhandler(void) 
+void keyhandler(void) 
 { 
   int i = getch(); 
   
   switch(i)
   { 
 { 
   int i = getch(); 
   
   switch(i)
   { 
-    case (27):  escape() ; 
-    case (33):  dosomething();  
-    case (42):  something();
-    default:    stuff();
+    case (27):  puts("1");    /*  escape() ;       */ 
+    case (33):  puts("2");    /*  dosomething();   */ 
+    case (42):  puts("3");    /*  something();     */ 
+    default:    puts("4");    /*  stuff();         */ 
   }   
   
 } 
   }   
   
 } 
index 033dfc1b96b2f4f05a493ebc3871a9bee503bee0..756e5ddd5c6f022c13f466a8ec6c946633f22b81 100644 (file)
@@ -23,7 +23,7 @@
 /*     Ctrl-C and Ctrl-V.                              */  
 
 
 /*     Ctrl-C and Ctrl-V.                              */  
 
 
-#include "pd_readline.h"   
+#include "pd_readline.h"    
 
 
 int main(void) 
 
 
 int main(void) 
index 021933e57ed568ce4572c99a5e856ca47f6d18a9..f05ec8efeea01af504064f9f6c25c8f76cfc9a10 100644 (file)
@@ -28,7 +28,7 @@ int esc(int i);
 
 /*  Other funcs.  */  
 void readhistory(char *fname); 
 
 /*  Other funcs.  */  
 void readhistory(char *fname); 
-int keyhandler(void);  
+void keyhandler(void);