blob: 3fa66f1910de0f368d11acad5e7ee9bca16ff16e [file] [log] [blame]
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +01001#!/bin/sh
2
Manuel Pégourié-Gonnardd1ddd292015-04-09 10:15:10 +02003set -eu
4
5if [ -d include/mbedtls ]; then :; else
6 echo "$0: must be run from root" >&2
7 exit 1
8fi
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +01009
Nir Sonnenschein03091d12019-01-08 18:15:50 +020010HEADERS=$( ls include/mbedtls/*.h include/psa/*.h | egrep -v 'compat-1\.3\.h' )
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010011
Jaeden Amero7fcc7bc2019-02-26 11:53:36 +000012# White-list macros we want to be able to refer to that don't exist in the
13# crypto library, useful when referring to macros in Mbed TLS from comments.
14WHITELIST='MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS'
15
16# Generate a list of macros and combine it with the white-listed macros in
17# sorted order.
18{ sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS |
19 egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_';
20 printf '%s\n' $WHITELIST;
21} | sort -u > macros
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010022
23wc -l macros