5 UI_STRING, UI_string_types,
9 #include <openssl/ui.h>
11 typedef struct ui_string_st UI_STRING;
13 enum UI_string_types {
15 UIT_PROMPT, /* Prompt for a string */
16 UIT_VERIFY, /* Prompt for a string and verify */
17 UIT_BOOLEAN, /* Prompt for a yes/no response */
18 UIT_INFO, /* Send info to the user */
19 UIT_ERROR /* Send an error message to the user */
22 enum UI_string_types UI_get_string_type(UI_STRING *uis);
23 int UI_get_input_flags(UI_STRING *uis);
24 const char *UI_get0_output_string(UI_STRING *uis);
25 const char *UI_get0_action_string(UI_STRING *uis);
26 const char *UI_get0_result_string(UI_STRING *uis);
27 const char *UI_get0_test_string(UI_STRING *uis);
28 int UI_get_result_minsize(UI_STRING *uis);
29 int UI_get_result_maxsize(UI_STRING *uis);
30 int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
34 The B<UI_STRING> gets created internally and added to a B<UI> whenever
35 one of the functions UI_add_input_string(), UI_dup_input_string(),
36 UI_add_verify_string(), UI_dup_verify_string(),
37 UI_add_input_boolean(), UI_dup_input_boolean(), UI_add_info_string(),
38 UI_dup_info_string(), UI_add_error_string() or UI_dup_error_string()
40 For a B<UI_METHOD> user, there's no need to know more.
41 For a B<UI_METHOD> creator, it is of interest to fetch text from these
42 B<UI_STRING> objects as well as adding results to some of them.
44 UI_get_string_type() is used to retrieve the type of the given
47 UI_get_input_flags() is used to retrieve the flags associated with the
50 UI_get0_output_string() is used to retrieve the actual string to
51 output (prompt, info, error, ...).
53 UI_get0_action_string() is used to retrieve the action description
54 associated with a B<UIT_BOOLEAN> type B<UI_STRING>.
55 For all other B<UI_STRING> types, NULL is returned.
56 See L<UI_Add_input_boolean(3)>.
58 UI_get0_result_string() is used to retrieve the result of a prompt.
59 This is only useful for B<UIT_PROMPT> and B<UIT_VERIFY> type strings.
60 For all other B<UI_STRING> types, NULL is returned.
62 UI_get0_test_string() is used to retrieve the string to compare the
64 This is only useful for B<UIT_VERIFY> type strings.
65 For all other B<UI_STRING> types, NULL is returned.
67 UI_get_result_minsize() and UI_get_result_maxsize() are used to
68 retrieve the minimum and maximum required size of the result.
69 This is only useful for B<UIT_PROMPT> and B<UIT_VERIFY> type strings.
70 For all other B<UI_STRING> types, -1 is returned.
72 UI_set_result() is used to set the result value of a prompt.
73 For B<UIT_PROMPT> and B<UIT_VERIFY> type UI strings, this sets the
74 result retrievable with UI_get0_result_string() by copying the
75 contents of B<result> if its length fits the minimum and maximum size
77 For B<UIT_BOOLEAN> type UI strings, this sets the first character of
78 the result retrievable with UI_get0_result_string() to the first
79 B<ok_char> given with UI_add_input_boolean() or UI_dup_input_boolean()
80 if the B<result> matched any of them, or the first of the
81 B<cancel_chars> if the B<result> matched any of them, otherwise it's
82 set to the NUL char C<\0>.
83 See L<UI_add_input_boolean(3)> for more information on B<ok_chars> and
88 UI_get_string_type() returns the UI string type.
90 UI_get_input_flags() returns the UI string flags.
92 UI_get0_output_string() returns the UI string output string.
94 UI_get0_action_string() returns the UI string action description
95 string for B<UIT_BOOLEAN> type UI strings, NULL for any other type.
97 UI_get0_result_string() returns the UI string action description
98 string for B<UIT_PROMPT> and B<UIT_VERIFY> type UI strings, NULL for
101 UI_get0_test_string() returns the UI string action description
102 string for B<UIT_VERIFY> type UI strings, NULL for any other type.
104 UI_get_result_minsize() returns the minimum allowed result size for
105 the UI string for for B<UIT_PROMPT> and B<UIT_VERIFY> type strings,
106 -1 for any other type.
108 UI_get_result_maxsize() returns the minimum allowed result size for
109 the UI string for for B<UIT_PROMPT> and B<UIT_VERIFY> type strings,
110 -1 for any other type.
112 UI_set_result() returns 0 on success or when the UI string is of any
113 type other than B<UIT_PROMPT>, B<UIT_VERIFY> or B<UIT_BOOLEAN>, -1 on
122 Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
124 Licensed under the OpenSSL license (the "License"). You may not use
125 this file except in compliance with the License. You can obtain a copy
126 in the file LICENSE in the source distribution or at
127 L<https://www.openssl.org/source/license.html>.