Skip to content

Commit

Permalink
docs: make usage of LDPersistence clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Oct 21, 2024
1 parent 1babc17 commit dbb2c20
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dbb2c20

Please sign in to comment.