summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk.sh2
-rwxr-xr-xmkh.sh20
2 files changed, 22 insertions, 0 deletions
diff --git a/mk.sh b/mk.sh
index 5b0d71de..9f71b941 100644
--- a/mk.sh
+++ b/mk.sh
@@ -9,6 +9,8 @@ classify_source () {
echo MACRO
elif grep -q "#undef ${NAME}" $1; then
echo MACRO
+ elif grep -q '^typedef .*(\*' $1; then
+ echo FNTYPE
elif grep -q "^typedef .*${NAME}.*;" $1; then
echo TYPE
elif grep -q "^struct .*;$" $1; then
diff --git a/mkh.sh b/mkh.sh
index 6ba2840b..eae4d01d 100755
--- a/mkh.sh
+++ b/mkh.sh
@@ -168,6 +168,26 @@ if [ -d $HEADER.RECORD ]; then
rm -rf $HEADER.RECORD
fi
+if [ -d $HEADER.FNTYPE ]; then
+ for v in $HEADER.FNTYPE/*; do
+ version=$(version_guard $(head -n1 $v))
+ if [ -n "$version" ]; then
+ printf '%s\n' "$version"
+ fi
+
+ for i in $(sort -u $v 2>/dev/null); do
+ grep '^typedef ' $i
+ done
+
+ if [ -n "$version" ]; then
+ printf '#endif\n'
+ fi
+
+ printf '\n'
+ done
+ rm -rf $HEADER.FNTYPE
+fi
+
if [ -d $HEADER.EXTERN ]; then
for v in $HEADER.EXTERN/*; do
version=$(version_guard $(head -n1 $v))