-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: hackvr action: commit revision: path_from: revision_from: fbcf2248e45c3369a963849aa4981cb283ebe755: path_to: revision_to:
commit fbcf2248e45c3369a963849aa4981cb283ebe755 Author: epoch <epoch@hacking.allowed.org> Date: Wed Feb 5 23:35:26 2020 -0600 renamed GNUmakefile back to Makefile and added a tool to help with tailing multiple files in a way that won't block if any run out of data diff --git a/src/GNUmakefile b/src/Makefile similarity index 91% rename from src/GNUmakefile rename to src/Makefile
--- 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 0000000000000000000000000000000000000000..8b99e64c102f7818e0877d13e5ae8b6141bee15c --- /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(); +}
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 18:24:03 2024