summaryrefslogtreecommitdiffstats
path: root/crypto/ui/ui_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2001-06-05 19:05:52 +0000
committerRichard Levitte <levitte@openssl.org>2001-06-05 19:05:52 +0000
commit1e7e62f8cdda90328531b3a7c31fb68240b6245f (patch)
treeee6b034a8cd426d7cad492dd56756ae1913e2107 /crypto/ui/ui_lib.c
parent5352823fbf69cbfd3f8be15010068c3408b47750 (diff)
A good use of the UI interface is as a password callback replacement
(for new functions...). One might still want to be able to pass down a user-data pointer to be used by the UI. However, ex_data doesn't quite cut it, since that means the appropriate index to it might need to be shared between parts that aren't really related in that sense, and would require the currently hidden (static) index holders to be uncovered. Not a good thing. Therefore, add the possibility to add a user-data pointer to a UI.
Diffstat (limited to 'crypto/ui/ui_lib.c')
-rw-r--r--crypto/ui/ui_lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index c5d17042f9..f8881dee05 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -256,6 +256,18 @@ int UI_dup_error_string(UI *ui, const char *text)
NULL);
}
+void *UI_add_user_data(UI *ui, void *user_data)
+ {
+ void *old_data = ui->user_data;
+ ui->user_data = user_data;
+ return old_data;
+ }
+
+void *UI_get0_user_data(UI *ui)
+ {
+ return ui->user_data;
+ }
+
const char *UI_get0_result(UI *ui, int i)
{
if (i < 0)