From dbb2c200f6a6c4fb5f7cbf59830adcf20400ed2a Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 21 Oct 2024 16:06:35 -0700 Subject: [PATCH] docs: make usage of LDPersistence clearer --- .../client_side/bindings/c/config/builder.h | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h b/libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h index e4fd2c34a..81c5cb64c 100644 --- a/libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h +++ b/libs/client-sdk/include/launchdarkly/client_side/bindings/c/config/builder.h @@ -88,9 +88,25 @@ struct LDPersistence { }; /** - * Initializes a custom persistence implementation. Must be called before - * passing a custom implementation into configuration. - * @param backend Implementation to initialize. + * Initializes an instance of LDPersistence with default function pointers, + * additionally setting UserData to NULL. + * + * This must be called after declaring the struct, but before setting any + * custom function pointers. + * + * Example: + * @code + * struct LDPersistence customPersistence; + * LDPersistence_Init(&customPersistence); + * + * customPersistence.SetFn = my_set_function; + * customPersistence.RemoveFn = my_remove_function; + * customPersistence.ReadFn = my_read_function; + * customPersistence.FreeFn = my_free_read_function; + * customPersistence.UserData = my_user_data_ptr; + * @endcode + * + * @param LDPersistence to initialize. */ LD_EXPORT(void) LDPersistence_Init(struct LDPersistence* implementation);