summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/apps_posix.c
diff options
context:
space:
mode:
authorbcook <>2015-09-13 12:41:01 +0000
committerbcook <>2015-09-13 12:41:01 +0000
commite2751f37728059d10cda50d45e3365a1110f26ff (patch)
treea928062f329b4a2f81c6d2b9910fde8181243c7a /src/usr.bin/openssl/apps_posix.c
parent2555ca7b86c3ba095a21111d3f7d00e279de8e4d (diff)
downloadopenbsd-e2751f37728059d10cda50d45e3365a1110f26ff.tar.gz
openbsd-e2751f37728059d10cda50d45e3365a1110f26ff.tar.bz2
openbsd-e2751f37728059d10cda50d45e3365a1110f26ff.zip
Factor out setup_up / destroy_ui functions.
This pulls out and renames setup_ui/destroy_ui so we have something that can be replaced as-needed, moving the the console setup code for Windows to app_win.c in -portable, instead of needing a local patch to enable binary console mode ui_read/write are also simplified.
Diffstat (limited to 'src/usr.bin/openssl/apps_posix.c')
-rw-r--r--src/usr.bin/openssl/apps_posix.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/usr.bin/openssl/apps_posix.c b/src/usr.bin/openssl/apps_posix.c
index c49a23a653..67cd465088 100644
--- a/src/usr.bin/openssl/apps_posix.c
+++ b/src/usr.bin/openssl/apps_posix.c
@@ -142,3 +142,23 @@ app_tminterval(int stop, int usertime)
142 142
143 return (ret); 143 return (ret);
144} 144}
145
146int
147setup_ui(void)
148{
149 ui_method = UI_create_method("OpenSSL application user interface");
150 UI_method_set_opener(ui_method, ui_open);
151 UI_method_set_reader(ui_method, ui_read);
152 UI_method_set_writer(ui_method, ui_write);
153 UI_method_set_closer(ui_method, ui_close);
154 return 0;
155}
156
157void
158destroy_ui(void)
159{
160 if (ui_method) {
161 UI_destroy_method(ui_method);
162 ui_method = NULL;
163 }
164}