UI_GET_STRING_TYPE(3)
πΈ NAME πΈ
UI_get_string_type, UI_get_input_flags, UI_get0_output_string, UI_get0_action_string, UI_get0_result_string, UI_get0_test_string, UI_get_result_minsize, UI_get_result_maxsize, UI_set_result β okay bestie, this is the OpenSSL user interface string parsing squad. This page is UI_GET_STRING_TYPE(3) from the Library Functions Manual, and itβs giving βpeek at UI_STRING objects and set prompt resultsβ main character energy. π
β¨
π SYNOPSIS π
library βlibcryptoβ #include <openssl/ui.h>
enum UI_string_types {
UIT_NONE = 0,
UIT_PROMPT, /* Prompt for a string */
UIT_VERIFY, /* Prompt for a string and verify */
UIT_BOOLEAN, /* Prompt for a yes/no response */
UIT_INFO, /* Send info to the user */
UIT_ERROR /* Send an error message to the user */
};
enum UI_string_types
UI_get_string_type(UI_STRING *uis);
int
UI_get_input_flags(UI_STRING *uis);
const char *
UI_get0_output_string(UI_STRING *uis);
const char *
UI_get0_action_string(UI_STRING *uis);
const char *
UI_get0_result_string(UI_STRING *uis);
const char *
UI_get0_test_string(UI_STRING *uis);
int
UI_get_result_minsize(UI_STRING *uis);
int
UI_get_result_maxsize(UI_STRING *uis);
int
UI_set_result(UI *ui, UI_STRING *uis, const char *result);
π¦ DESCRIPTION π¦
Okay so hereβs the lore, no cap: a UI_STRING gets created internally and added to a UI object whenever one of these functions is called: UI_add_input_string(3), UI_dup_input_string(3), UI_add_verify_string(3), UI_dup_verify_string(3), UI_add_input_boolean(3), UI_dup_input_boolean(3), UI_add_info_string(3), UI_dup_info_string(3), UI_add_error_string(3), or UI_dup_error_string(3). If youβre a UI_METHOD user, thereβs no need to know more. If youβre a UI_METHOD creator, it is of interest to fetch text from these UI_STRING objects as well as adding results to some of them. π
UI_get_string_type()β used to retrieve the type of the givenUI_STRING. Lowkey essential for the vibe check. πUI_get_input_flags()β used to retrieve the flags associated with the givenUI_STRING. Flags, bestie. πUI_get0_output_string()β used to retrieve the actual string to output (prompt, info, error, ...). Iconic output behavior. β¨UI_get0_action_string()β used to retrieve the action description associated with aUIT_BOOLEANtypeUI_STRING. SeeUI_add_input_boolean(3). π¦UI_get0_result_string()β used to retrieve the result of a prompt. This is only useful forUIT_PROMPTandUIT_VERIFYtype strings. Iykyk. πUI_get0_test_string()β used to retrieve the string to compare the prompt result with. This is only useful forUIT_VERIFYtype strings. π«ΆUI_get_result_minsize()andUI_get_result_maxsize()β used to retrieve the minimum and maximum required size of the result. This is only useful forUIT_PROMPTandUIT_VERIFYtype strings. πUI_set_result()β used to set the result value of a prompt. ForUIT_PROMPTandUIT_VERIFYtype UI strings, this sets the result retrievable withUI_get0_result_string()by copying the contents ofresultif its length fits the minimum and maximum size requirements. ForUIT_BOOLEANtype UI strings, this sets the first character of the result retrievable withUI_get0_result_string()to the first of theok_charsgiven withUI_add_input_boolean(3)orUI_dup_input_boolean(3)if the result matched any of them, or the first of thecancel_charsif the result matched any of them; otherwise itβs set to theNULchar. SeeUI_add_input_boolean(3)for more information onok_charsandcancel_chars. π
π RETURN VALUES π
UI_get_string_type()returns the UI string type. Periodt. πUI_get_input_flags()returns the UI string flags. β¨UI_get0_output_string()returns the UI string output string. πUI_get0_action_string()returns the UI string action description string forUIT_BOOLEANtype UI strings, orNULLfor any other type. π¦UI_get0_result_string()returns the UI string result buffer forUIT_PROMPTandUIT_VERIFYtype UI strings, orNULLfor any other type. π«ΆUI_get0_test_string()returns the UI string action description string forUIT_VERIFYtype UI strings, orNULLfor any other type. Not me double-checking that line β but yes, it says action description string here, and weβre keeping the lore exactly as written. πUI_get_result_minsize()returns the minimum allowed result size for the UI string forUIT_PROMPTandUIT_VERIFYtype strings, or-1for any other type. πUI_get_result_maxsize()returns the minimum allowed result size for the UI string forUIT_PROMPTandUIT_VERIFYtype strings, or-1for any other type. Highkey the page says minimum here too, bestie β Iβm just delivering the message fr fr. πUI_set_result()returns0on success or when the UI string is of any type other thanUIT_PROMPT,UIT_VERIFY, orUIT_BOOLEAN, or-1on error. π§
π SEE ALSO π
UI_new(3) β thatβs the whole see-also section, bestie. Go give it a vibe check. π
β HISTORY β
These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. Not me stanning an old-school debut β but here we are. π§
This page is from the Debian edition, dated June 8, 2025. π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2017 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms