summaryrefslogtreecommitdiff
path: root/mk.sh
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-02-25 21:24:34 -0500
committerJakob Kaivo <jkk@ung.org>2019-02-25 21:24:34 -0500
commit3afc5f1adb1c97579caa0cae112c2dba39692580 (patch)
tree697c220af7d5df1c633cb2a2edf6c135256c1e33 /mk.sh
parentf26bf1396557e4bc739d6a7703099f75bfe2fb99 (diff)
better support multi-line typedefs
Diffstat (limited to 'mk.sh')
-rw-r--r--mk.sh6
1 files 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