summary refs log tree commit diff
path: root/home/.local/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-01 00:53:05 -0500
committerJune McEnroe <june@causal.agency>2019-02-01 00:53:05 -0500
commit83bc80270bf126a28f3af26bc5fa8acdd526f8ca (patch)
tree5100907bcab75edd9a323da13bb49570b45f32a4 /home/.local/bin
parentAdd beef to README (diff)
downloadsrc-83bc80270bf126a28f3af26bc5fa8acdd526f8ca.tar.gz
src-83bc80270bf126a28f3af26bc5fa8acdd526f8ca.zip
Add def script
Diffstat (limited to 'home/.local/bin')
-rwxr-xr-xhome/.local/bin/def47
1 files changed, 47 insertions, 0 deletions
diff --git a/home/.local/bin/def b/home/.local/bin/def
new file mode 100755
index 00000000..ea8b9536
--- /dev/null
+++ b/home/.local/bin/def
@@ -0,0 +1,47 @@
+#!/bin/sh
+set -eu
+
+macro=$1
+headers='
+assert.h
+complex.h
+ctype.h
+errno.h
+fenv.h
+float.h
+inttypes.h
+iso646.h
+limits.h
+locale.h
+math.h
+setjmp.h
+signal.h
+stdalign.h
+stdarg.h
+stdatomic.h
+stdbool.h
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+stdnoreturn.h
+string.h
+tgmath.h
+threads.h
+time.h
+uchar.h
+wchar.h
+wctype.h
+'
+
+for header in $headers; do
+	defined=$(
+		echo "$macro" \
+		| cc -E -x c -include "$header" - \
+		2> /dev/null \
+		| tail -n 1
+	)
+	[ $? -ne 0 -o "$defined" = "$macro" ] && continue
+	echo "#include <$header>"
+	echo "$defined"
+done
June McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe Mixed bag like most collections of short stories. Some of them are pretty good. The author of the worst written story also has the worst written bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe