Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Query Mbed TLS compile time configurations from config.h |
| 3 | * |
| 4 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 7ff7965 | 2023-11-03 12:04:52 +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 | |
| 11 | #if !defined(MBEDTLS_CONFIG_FILE) |
| 12 | #include "mbedtls/config.h" |
| 13 | #else |
| 14 | #include MBEDTLS_CONFIG_FILE |
| 15 | #endif |
| 16 | |
| 17 | /** Check whether a given configuration symbol is enabled. |
| 18 | * |
| 19 | * \param config The symbol to query (e.g. "MBEDTLS_RSA_C"). |
| 20 | * \return \c 0 if the symbol was defined at compile time |
| 21 | * (in MBEDTLS_CONFIG_FILE or config.h), |
| 22 | * \c 1 otherwise. |
| 23 | * |
| 24 | * \note This function is defined in `programs/test/query_config.c` |
| 25 | * which is automatically generated by |
| 26 | * `scripts/generate_query_config.pl`. |
| 27 | */ |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame] | 28 | int query_config(const char *config); |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 29 | |
Jerry Yu | 0abd677 | 2021-12-06 13:40:37 +0800 | [diff] [blame] | 30 | /** List all enabled configuration symbols |
| 31 | * |
| 32 | * \note This function is defined in `programs/test/query_config.c` |
| 33 | * which is automatically generated by |
| 34 | * `scripts/generate_query_config.pl`. |
| 35 | */ |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame] | 36 | void list_config(void); |
Jerry Yu | 0abd677 | 2021-12-06 13:40:37 +0800 | [diff] [blame] | 37 | |
Gilles Peskine | c772b18 | 2021-01-12 15:55:10 +0100 | [diff] [blame] | 38 | #endif /* MBEDTLS_PROGRAMS_TEST_QUERY_CONFIG_H */ |