UI_get0_user_data (3)
Leading comments
Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) Standard preamble: ========================================================================
NAME
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, ERR_load_UI_strings - New User InterfaceSYNOPSIS
#include <openssl/ui.h> typedef struct ui_st UI; typedef struct ui_method_st UI_METHOD; 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); /* These are the possible flags. They can be or'ed together. */ #define UI_INPUT_FLAG_ECHO 0x01 #define UI_INPUT_FLAG_DEFAULT_PWD 0x02 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)()); #define UI_CTRL_PRINT_ERRORS 1 #define UI_CTRL_IS_REDOABLE 2 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);
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_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.
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