From 3afc5f1adb1c97579caa0cae112c2dba39692580 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 25 Feb 2019 21:24:34 -0500 Subject: better support multi-line typedefs --- mk.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mk.sh b/mk.sh index 16a5326d..b2c439a0 100644 --- a/mk.sh +++ b/mk.sh @@ -15,11 +15,11 @@ classify_source () { echo MACRO elif grep -q '^typedef .*(\*' $1; then echo FNTYPE - elif grep -q "^typedef .*${NAME}.*;" $1; then + elif grep -q "^typedef " $1; then echo TYPE elif grep -q "^struct .*;$" $1; then echo TYPE - elif grep -q "^typedef.*{$" $1; then + elif grep -q "^typedef .*{$" $1; then echo TYPE_LONG elif grep -q "^struct.*{" $1; then echo RECORD @@ -76,6 +76,8 @@ get_declaration () { sed -ne '/^#if/,/#endif/p' $1 elif grep -qE '^(typedef|struct|union) .*{' $1; then sed -ne '/{$/,/^}/p' $1 + elif grep -qE '^(typedef|struct|union) .*[^;]$' $1; then + grep -E '^(typedef|struct|union| )' $1 else grep -E '^(typedef|struct|union) ' $1 fi -- cgit v1.2.1