Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 1 | /* |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 2 | * Query Mbed TLS compile time configurations from mbedtls_config.h |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 3 | * |
| 4 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 5 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef MBEDTLS_PROGRAMS_TEST_QUERY_CONFIG_H |
| 9 | #define MBEDTLS_PROGRAMS_TEST_QUERY_CONFIG_H |
| 10 | |
Bence Szépkúti | c662b36 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 11 | #include "mbedtls/build_info.h" |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 12 | |
| 13 | /** Check whether a given configuration symbol is enabled. |
| 14 | * |
| 15 | * \param config The symbol to query (e.g. "MBEDTLS_RSA_C"). |
| 16 | * \return \c 0 if the symbol was defined at compile time |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 17 | * (in MBEDTLS_CONFIG_FILE or mbedtls_config.h), |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 18 | * \c 1 otherwise. |
| 19 | * |
| 20 | * \note This function is defined in `programs/test/query_config.c` |
| 21 | * which is automatically generated by |
| 22 | * `scripts/generate_query_config.pl`. |
| 23 | */ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 24 | int query_config(const char *config); |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 25 | |
Jerry Yu | 84e63a7 | 2021-12-06 13:40:37 +0800 | [diff] [blame] | 26 | /** List all enabled configuration symbols |
| 27 | * |
| 28 | * \note This function is defined in `programs/test/query_config.c` |
| 29 | * which is automatically generated by |
| 30 | * `scripts/generate_query_config.pl`. |
| 31 | */ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 32 | void list_config(void); |
Jerry Yu | 84e63a7 | 2021-12-06 13:40:37 +0800 | [diff] [blame] | 33 | |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 34 | #endif /* MBEDTLS_PROGRAMS_TEST_QUERY_CONFIG_H */ |