You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
614 B
26 lines
614 B
#!/bin/bash
|
|
|
|
|
|
INPUT=${1:-input}
|
|
INPUT_PROC=.input-proc-$(uuidgen)
|
|
|
|
WIDTH=$(head -n 1 "$INPUT" | wc -c)
|
|
|
|
./cmkinput $INPUT > $INPUT_PROC || exit 1
|
|
|
|
echo "#include <input.h>"
|
|
echo ""
|
|
echo "const rawinput_t RAW_INPUT[] = {"
|
|
while IFS= read -r line; do
|
|
printf '0b'
|
|
echo "$line" | sed 's/.\{8\}/&, \
|
|
0b/g' # XXX: FUCKING FIX THIS SHITE FUCK I HATE BASH AND C AND UNIX AND COMPUTERS FUCK THIS BULLSHIT FUCK IT I GIVE THE FUCK UP
|
|
#echo ","
|
|
done < $INPUT_PROC
|
|
unset line
|
|
echo "};"
|
|
|
|
echo "const size_t INPUT_WIDTH = $WIDTH;"
|
|
echo "const size_t RAW_INPUT_SIZE = sizeof(RAW_INPUT) / sizeof(rawinput_t);"
|
|
rm -f $INPUT_PROC
|