list-macros.sh 352 B

12345678910111213141516
  1. #!/bin/sh
  2. set -eu
  3. if [ -d include/mbedtls ]; then :; else
  4. echo "$0: must be run from root" >&2
  5. exit 1
  6. fi
  7. HEADERS=$( ls include/mbedtls/*.h | egrep -v 'compat-1\.3\.h' )
  8. sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS \
  9. | egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_' \
  10. | sort -u > macros
  11. wc -l macros