CC = gcc
-CFLAGS = -O2 -Wall -g $(DEFINES)
+CFLAGS = -O2 -Wall -g -c $(DEFINES)
# INCPATH = -I.
LDFLAGS = $(SYSLDFLAGS) $(MYLDFLAGS)
-LIBS = -l$(SYSLIBS) $(MYLIBS)
+# LIBS = -l$(SYSLIBS) $(MYLIBS)
RM = rm -f
pd_readline: $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS)
+keyhandler.o: $(HEADERS)
+funcs.o: $(HEADERS)
+history.o: $(HEADERS)
pd_readline.o: $(HEADERS)
-#keyhandler.o: $(HEADERS)
-#funcs.o: $(HEADERS)
-#history.o: $(HEADERS)
.PHONY: clean
clean:
- rm *.o pd_readline
+ rm *.o
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-
+#include "pd_readline.h"
/* Move up in history list. */
/* "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 */
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
+#include "pd_readline.h"
/* This implementation of getch() is from here - */
-int keyhandler(void)
+void keyhandler(void)
{
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(); */
}
}
/* Ctrl-C and Ctrl-V. */
-#include "pd_readline.h"
+#include "pd_readline.h"
int main(void)
/* Other funcs. */
void readhistory(char *fname);
-int keyhandler(void);
+void keyhandler(void);