UI (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
UI, UI_new, UI_new_method, UI_free, UI_add_input_string, UI_dup_input_string, UI_add_verify_string, UI_dup_verify_string, UI_add_input_boolean, UI_dup_input_boolean, UI_add_info_string, UI_dup_info_string, UI_add_error_string, UI_dup_error_string, UI_construct_prompt, UI_add_user_data, UI_get0_user_data, UI_get0_result, UI_process, UI_ctrl, UI_set_default_method, UI_get_default_method, UI_get_method, UI_set_method, UI_OpenSSL, UI_null - user interfaceSYNOPSIS
#include <openssl/ui.h> typedef struct ui_st UI; UI *UI_new(void); UI *UI_new_method(const UI_METHOD *method); void UI_free(UI *ui); int UI_add_input_string(UI *ui, const char *prompt, int flags, char *result_buf, int minsize, int maxsize); int UI_dup_input_string(UI *ui, const char *prompt, int flags, char *result_buf, int minsize, int maxsize); int UI_add_verify_string(UI *ui, const char *prompt, int flags, char *result_buf, int minsize, int maxsize, const char *test_buf); int UI_dup_verify_string(UI *ui, const char *prompt, int flags, char *result_buf, int minsize, int maxsize, const char *test_buf); int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, const char *ok_chars, const char *cancel_chars, int flags, char *result_buf); int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, const char *ok_chars, const char *cancel_chars, int flags, char *result_buf); int UI_add_info_string(UI *ui, const char *text); int UI_dup_info_string(UI *ui, const char *text); int UI_add_error_string(UI *ui, const char *text); int UI_dup_error_string(UI *ui, const char *text); char *UI_construct_prompt(UI *ui_method, const char *object_desc, const char *object_name); void *UI_add_user_data(UI *ui, void *user_data); void *UI_get0_user_data(UI *ui); const char *UI_get0_result(UI *ui, int i); int UI_process(UI *ui); int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)()); void UI_set_default_method(const UI_METHOD *meth); const UI_METHOD *UI_get_default_method(void); const UI_METHOD *UI_get_method(UI *ui); const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); UI_METHOD *UI_OpenSSL(void); const UI_METHOD *UI_null(void);
DESCRIPTION
All the functions work through a context of the type
The first thing to do is to create a
A
The functions are as follows:
UI_new() creates a new
UI_new_method() creates a new
UI_OpenSSL() returns the built-in
UI_null() returns a
UI_free() removes a
UI_add_input_string() and UI_add_verify_string() add a prompt to the
UI_add_input_boolean() adds a prompt to the
UI_add_info_string() and UI_add_error_string() add strings that are shown at the same time as the prompt for extra information or to show an error string. The difference between the two is only conceptual. With the builtin method, there's no technical difference between them. Other methods may make a difference between them, however.
The flags currently supported are
UI_dup_input_string(), UI_dup_verify_string(), UI_dup_input_boolean(), UI_dup_info_string() and UI_dup_error_string() are basically the same as their UI_add counterparts, except that they make their own copies of all strings.
UI_construct_prompt() is a helper function that can be used to create a prompt from two pieces of information: an description and a name. The default constructor (if there is none provided by the method used) creates a string "Enter description for name:``. With the description ''pass phrase`` and the file name ''foo.key``, that becomes ''Enter pass phrase for foo.key:". Other methods may create whatever string and may include encodings that will be processed by the other method functions.
UI_add_user_data() adds a piece of memory for the method to use at any time. The builtin
UI_get0_user_data() retrieves the data that has last been given to the
UI_get0_result() returns a pointer to the result buffer associated with the information indexed by i.
UI_process() goes through the information given so far, does all the printing and prompting and returns the final status, which is -2 on out-of-band events (Interrupt, Cancel, ...), -1 on error and 0 on success.
UI_ctrl() adds extra control for the application author. For now, it understands two commands:
UI_set_default_method() changes the default
UI_get_default_method() returns a pointer to the current default
UI_get_method() returns the
UI_set_method() changes the
NOTES
The resulting strings that the built in method UI_OpenSSL() generate are assumed to be encoded according to the current locale or (for Windows) code page. For applications having different demands, these strings need to be converted appropriately by the caller. For Windows, if theCOPYRIGHT
Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.Licensed under the OpenSSL license (the ``License''). You may not use this file except in compliance with the License. You can obtain a copy in the file