1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-05 19:35:48 +03:00

Merge pull request #5303 from yuhaoth/pr/add_list_config_function

Add list config function
This commit is contained in:
paul-elliott-arm
2021-12-10 18:30:06 +00:00
committed by GitHub
5 changed files with 37 additions and 9 deletions

View File

@@ -29,13 +29,14 @@
#endif
#define USAGE \
"usage: %s <MBEDTLS_CONFIG>\n\n" \
"usage: %s [ <MBEDTLS_CONFIG> | -l ]\n\n" \
"This program takes one command line argument which corresponds to\n" \
"the string representation of a Mbed TLS compile time configuration.\n" \
"The value 0 will be returned if this configuration is defined in the\n" \
"Mbed TLS build and the macro expansion of that configuration will be\n" \
"printed (if any). Otherwise, 1 will be returned.\n"
"printed (if any). Otherwise, 1 will be returned.\n" \
"-l\tPrint all available configuration.\n"
#include <string.h>
#include "query_config.h"
int main( int argc, char *argv[] )
@@ -46,5 +47,11 @@ int main( int argc, char *argv[] )
return( MBEDTLS_EXIT_FAILURE );
}
if( strcmp( argv[1], "-l" ) == 0 )
{
list_config();
return( 0 );
}
return( query_config( argv[1] ) );
}

View File

@@ -35,4 +35,12 @@
*/
int query_config( const char *config );
/** List all enabled configuration symbols
*
* \note This function is defined in `programs/test/query_config.c`
* which is automatically generated by
* `scripts/generate_query_config.pl`.
*/
void list_config( void );
#endif /* MBEDTLS_PROGRAMS_TEST_QUERY_CONFIG_H */