diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-25 21:24:34 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-25 21:24:34 -0500 |
| commit | 3afc5f1adb1c97579caa0cae112c2dba39692580 (patch) | |
| tree | 697c220af7d5df1c633cb2a2edf6c135256c1e33 /mk.sh | |
| parent | f26bf1396557e4bc739d6a7703099f75bfe2fb99 (diff) | |
better support multi-line typedefs
Diffstat (limited to 'mk.sh')
| -rw-r--r-- | mk.sh | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |
