blob: 9a89737df39e46e5aba90f385506bad823676a48 [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' )
Christoph M. Wintersteiger8a0f5bb2018-12-14 15:46:34 +000011HEADERS="$HEADERS 3rdparty/everest/include/everest/everest.h 3rdparty/everest/include/everest/x25519.h"
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010012
Jaeden Amero7fcc7bc2019-02-26 11:53:36 +000013# White-list macros we want to be able to refer to that don't exist in the
14# crypto library, useful when referring to macros in Mbed TLS from comments.
15WHITELIST='MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS'
16
17# Generate a list of macros and combine it with the white-listed macros in
18# sorted order.
19{ sed -n -e 's/.*#define \([a-zA-Z0-9_]*\).*/\1/p' $HEADERS |
20 egrep -v '^(asm|inline|EMIT|_CRT_SECURE_NO_DEPRECATE)$|^MULADDC_';
21 printf '%s\n' $WHITELIST;
22} | sort -u > macros
Manuel Pégourié-Gonnard3385cf42015-04-02 17:59:30 +010023
24wc -l macros