blob: a8b204d8871802885b5fe8539fc6ce020a835a77 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
source="$1"
target="$2"
rm -f $target-t $target && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo; \
echo '#include <stdlib.h>'; \
echo '#include "p11-kit/p11-kit.h"'; \
cat $source; \
echo "void *${target}_funcs[] = {" | sed 's/[^][ *a-z0-9_={]/_/g'; \
sed -n -e '/^typedef/d' -e 's/.* \(p11_kit_[^ ]*\) *(.*/ \1,/p' $source; \
echo '};'; \
} > $target-t && \
mv -f $target-t $target
|