From: Dr. David von Oheimb Date: Mon, 14 Apr 2025 19:08:28 +0000 (+0200) Subject: UI_new.pod: fix doc of UI_add_user_data() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e05e8d6a3fa53ab18d30cdea18cfe93c7a366ec;p=thirdparty%2Fopenssl.git UI_new.pod: fix doc of UI_add_user_data() Reviewed-by: Dmitry Belyavskiy Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/28475) --- diff --git a/doc/man3/UI_new.pod b/doc/man3/UI_new.pod index eb80f453d5c..fb474adc845 100644 --- a/doc/man3/UI_new.pod +++ b/doc/man3/UI_new.pod @@ -159,17 +159,20 @@ With the description "pass phrase" and the filename "foo.key", that becomes string and may include encodings that will be processed by the other method functions. -UI_add_user_data() adds a user data pointer for the method to use at any +UI_add_user_data() sets the user data pointer for the method to use at any time. The built-in UI method doesn't care about this info. Note that several -calls to this function doesn't add data, it replaces the previous blob +calls to this function doesn't add data, it replaces the previous pointer with the one given as argument. +The return value is the previously set user data pointer if it was set +using UI_add_user_data() and thus the caller owns it, otherwise NULL. UI_dup_user_data() duplicates the user data and works as an alternative to UI_add_user_data() when the user data needs to be preserved for a longer duration, perhaps even the lifetime of the application. The UI object takes ownership of this duplicate and will free it whenever it gets replaced or the UI is destroyed. UI_dup_user_data() returns 0 on success, or -1 on memory -allocation failure or if the method doesn't have a duplicator function. +allocation failure or if the method doesn't have a duplicator and a destructor +function. UI_get0_user_data() retrieves the data that has last been given to the UI with UI_add_user_data() or UI_dup_user_data. @@ -224,6 +227,9 @@ is less than or equal to 0 otherwise. UI_construct_prompt() returns a string or NULL if an error occurred. +UI_add_user_data() returns +the user data pointer previously set using this function, otherwise NULL. + UI_dup_user_data() returns 0 on success or -1 on error. UI_get0_result() returns a string or NULL on error.