diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-02 10:14:05 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-02 10:14:05 -0500 |
| commit | a7422b68db4d1c2d5d11545131223825e13cdc42 (patch) | |
| tree | 4b7398521615c54dcb0ba24c500e806d078ceb07 | |
| parent | b01e4f9de7ab1a9adfb86395276f244361d0a953 (diff) | |
sort function pointer typedefs after record types
| -rw-r--r-- | mk.sh | 2 | ||||
| -rwxr-xr-x | mkh.sh | 20 |
2 files changed, 22 insertions, 0 deletions
@@ -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 @@ -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)) |
