From 7daba199347fce96e47b7c59b9c008801f2668ec Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 31 May 2020 13:12:23 -0400 Subject: Add c script --- bin/.gitignore | 1 + bin/Makefile | 1 + bin/c.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/man1/c.1 | 40 ++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 bin/c.sh create mode 100644 bin/man1/c.1 diff --git a/bin/.gitignore b/bin/.gitignore index 540d14ec..96bd6068 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -4,6 +4,7 @@ aes beef bit bri +c config.mk dtch edit diff --git a/bin/Makefile b/bin/Makefile index c170d07b..d9cce459 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -21,6 +21,7 @@ LDLIBS.title = -lcurl BINS += aes BINS += beef BINS += bit +BINS += c BINS += dtch BINS += edit BINS += glitch diff --git a/bin/c.sh b/bin/c.sh new file mode 100644 index 00000000..f3e651ba --- /dev/null +++ b/bin/c.sh @@ -0,0 +1,83 @@ +#!/bin/sh +set -eu + +temp=$(mktemp -d) +trap 'rm -r "$temp"' EXIT + +exec 3>>"${temp}/run.c" + +cat >&3 < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +EOF + +while getopts 'e:i:' opt; do + case "$opt" in + (e) expr=$OPTARG;; + (i) echo "#include <${OPTARG}>" >&3;; + (?) exit 1;; + esac +done +shift $((OPTIND - 1)) + +cat >&3 <&3 <&3 +fi + +echo '}' >&3 + +cat >"${temp}/Makefile" <