From cadd3d860ee5fba1e380200d2866f75843fc3579 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 7 Jun 2021 20:15:55 +0200 Subject: [PATCH] Give examples of PLATFORM_XXX_ALT Signed-off-by: Gilles Peskine --- docs/architecture/alternative-implementations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/architecture/alternative-implementations.md b/docs/architecture/alternative-implementations.md index eadb61b4c..7fe6332b4 100644 --- a/docs/architecture/alternative-implementations.md +++ b/docs/architecture/alternative-implementations.md @@ -84,6 +84,8 @@ Several platform functions can be reconfigured dynamically by following the proc * Define the symbol `MBEDTLS_PLATFORM_XXX_ALT` at compile time. * During the initialization of your application, set the global variable `mbedtls_xxx` to an alternative implementation of `xxx()`. +For example, to provide a custom `printf` function at run time, enable `MBEDTLS_PLATFORM_PRINTF_ALT` at compile time and assign to `mbedtls_printf` during the initialization of your application. + Merely enabling `MBEDTLS_PLATFORM_XXX_ALT` does not change the behavior: by default, `mbedtls_xxx` points to the standard function `xxx`. -Note that there are variations on the naming pattern. Consult the documentation of individual configuration options and of the platform module for details. +Note that there are variations on the naming pattern. For example, some configurable functions are activated in pairs, such as `mbedtls_calloc` and `mbedtls_free` via `MBEDTLS_PLATFORM_MEMORY`. Consult the documentation of individual configuration options and of the platform module for details.