Yuto Takano | ac72fac | 2021-08-10 15:09:16 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Create a file named identifiers containing identifiers from internal header |
| 4 | # files, based on the --internal flag. |
| 5 | # Outputs the line count of the file to stdout. |
| 6 | # A very thin wrapper around list_internal_identifiers.py for backwards |
| 7 | # compatibility. |
| 8 | # Must be run from Mbed TLS root. |
| 9 | # |
| 10 | # Usage: list-identifiers.sh [ -i | --internal ] |
| 11 | # |
| 12 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 13 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Yuto Takano | ac72fac | 2021-08-10 15:09:16 +0100 | [diff] [blame] | 14 | |
| 15 | set -eu |
| 16 | |
| 17 | if [ -d include/mbedtls ]; then :; else |
| 18 | echo "$0: Must be run from Mbed TLS root" >&2 |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | INTERNAL="" |
| 23 | |
| 24 | until [ -z "${1-}" ] |
| 25 | do |
| 26 | case "$1" in |
| 27 | -i|--internal) |
| 28 | INTERNAL="1" |
| 29 | ;; |
| 30 | *) |
| 31 | # print error |
| 32 | echo "Unknown argument: '$1'" |
| 33 | exit 1 |
| 34 | ;; |
| 35 | esac |
| 36 | shift |
| 37 | done |
| 38 | |
| 39 | if [ $INTERNAL ] |
| 40 | then |
| 41 | tests/scripts/list_internal_identifiers.py |
| 42 | wc -l identifiers |
| 43 | else |
| 44 | cat <<EOF |
| 45 | Sorry, this script has to be called with --internal. |
| 46 | |
Yuto Takano | 8246eb8 | 2021-08-16 10:37:24 +0100 | [diff] [blame] | 47 | This script exists solely for backwards compatibility with the previous |
| 48 | iteration of list-identifiers.sh, of which only the --internal option remains in |
| 49 | use. It is a thin wrapper around list_internal_identifiers.py. |
Yuto Takano | ac72fac | 2021-08-10 15:09:16 +0100 | [diff] [blame] | 50 | |
| 51 | check-names.sh, which used to depend on this script, has been replaced with |
Valerio Setti | 87f9885 | 2024-12-13 17:26:16 +0100 | [diff] [blame] | 52 | framework/scripts/check_names.py and is now self-complete. |
Yuto Takano | ac72fac | 2021-08-10 15:09:16 +0100 | [diff] [blame] | 53 | EOF |
Yuto Takano | d73cec1 | 2021-08-10 15:45:28 +0100 | [diff] [blame] | 54 | fi |