summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile (renamed from src/GNUmakefile)10
-rw-r--r--src/nonblocktail.c21
2 files changed, 28 insertions, 3 deletions
diff --git a/src/GNUmakefile b/src/Makefile
index 3a2c697..c02198f 100644
--- a/src/GNUmakefile
+++ b/src/Makefile
@@ -6,9 +6,12 @@ CFLAGS=-Wall -pedantic -std=c99 -DGRAPHICAL -ffast-math -I$(PREFIX)/include
LDFLAGS=-L$(PREFIX)/lib
#all: hackvr_headless hackvr_x11 hackvr_opengl slowcat ### when hackvr_opengl gets useful at all I'll start including it in default build.
-all: hackvr_headless hackvr_x11
+all: hackvr_headless hackvr_x11 slowcat nonblocktail
# hackvr_fb hackvr_freeglut slowcat
+nonblocktail: LDLIBS=-lidc
+nonblocktail: nonblocktail.c
+
hackvr_headless: LDLIBS=-lm -lidc
hackvr_headless: hackvr_headless.o math.o physics.o
@@ -64,9 +67,10 @@ install: all
install hackvr $(PREFIX)/bin/hackvr
install hackvr_headless $(PREFIX)/bin/hackvr_headless
install hackvr_x11 $(PREFIX)/bin/hackvr_x11
- install hackvr_fb $(PREFIX)/bin/hackvr_fb
- install hackvr_freeglut $(PREFIX)/bin/hackvr_freeglut
install slowcat $(PREFIX)/bin/slowcat
+ install nonblocktail $(PREFIX)/bin/nonblocktail
+# install hackvr_fb $(PREFIX)/bin/hackvr_fb
+# install hackvr_freeglut $(PREFIX)/bin/hackvr_freeglut
uninstall:
rm $(PREFIX)/bin/hackvr
diff --git a/src/nonblocktail.c b/src/nonblocktail.c
new file mode 100644
index 0000000..8b99e64
--- /dev/null
+++ b/src/nonblocktail.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <idc.h>
+#include <fcntl.h>
+
+extern struct idc_global idc;
+
+void handler(struct shit *me,char *line) {
+ if(!line) return;
+ if(line) printf("%s\n",line);
+}
+
+int main(int argc,char *argv[]) {
+ int i;
+ for(i=0;i<100;i++) {
+ idc.fds[i].fd=-1;
+ }
+ for(argv++,argc--;argc;argc--,argv++) {
+ idc.fds[add_fd(open(*argv,O_RDONLY),handler)].keep_open=1;
+ }
+ select_on_everything();
+}