mirror of
https://github.com/sheumann/hush.git
synced 2024-08-17 00:29:03 +00:00
That says use 900k chunks when compressing, which needs about 4 megs of data structures to undo the Burrows-Wheeler transform. Switching it down to bzip -1 (100k chunks) should have no impact on the compression (since it still all fits in one chunk) but should reduce runtime decompression memory requirements to something like 500k. Still larger than gunzip, but not egregiously so.
14 lines
332 B
Bash
14 lines
332 B
Bash
#!/bin/sh
|
|
|
|
loc="$1"
|
|
|
|
test "$loc" || loc=.
|
|
test -x "$loc/usage" || exit 1
|
|
|
|
echo 'static const char packed_usage[] = '
|
|
"$loc"/usage | bzip2 -1 | od -v -t x1 \
|
|
| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1
|
|
echo ';'
|
|
sz=`"$loc"/usage | wc -c` || exit 1
|
|
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`
|