---
name: "libressl-UI_get_string_type"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-UI_get_string_type"
---

# libressl-UI\_get\_string\_type(3)

OpenSSL user interface string parsing

## 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** – OpenSSL user interface string parsing

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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

A *UI\_STRING* gets created internally and added to a *UI* object whenever one of the functions 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) is called. For a *UI\_METHOD* user, there's no need to know more. For 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**() is used to retrieve the type of the given *UI\_STRING*.

**UI\_get\_input\_flags**() is used to retrieve the flags associated with the given *UI\_STRING*.

**UI\_get0\_output\_string**() is used to retrieve the actual string to output (prompt, info, error, ...).

**UI\_get0\_action\_string**() is used to retrieve the action description associated with a UIT\_BOOLEAN type *UI\_STRING*. See UI\_add\_input\_boolean(3).

**UI\_get0\_result\_string**() is used to retrieve the result of a prompt. This is only useful for UIT\_PROMPT and UIT\_VERIFY type strings.

**UI\_get0\_test\_string**() is used to retrieve the string to compare the prompt result with. This is only useful for UIT\_VERIFY type strings.

**UI\_get\_result\_minsize**() and **UI\_get\_result\_maxsize**() are used to retrieve the minimum and maximum required size of the result. This is only useful for UIT\_PROMPT and UIT\_VERIFY type strings.

**UI\_set\_result**() is used to set the result value of a prompt. For **UIT\_PROMPT** and **UIT\_VERIFY** type UI strings, this sets the result retrievable with **UI\_get0\_result\_string**() by copying the contents of *result* if its length fits the minimum and maximum size requirements. For UIT\_BOOLEAN type UI strings, this sets the first character of the result retrievable with **UI\_get0\_result\_string**() to the first of the *ok\_chars* given with UI\_add\_input\_boolean(3) or UI\_dup\_input\_boolean(3) if the *result* matched any of them, or the first of the *cancel\_chars* if the *result* matched any of them, otherwise it's set to the NUL char. See UI\_add\_input\_boolean(3) for more information on *ok\_chars* and *cancel\_chars*.

## RETURN VALUES

**UI\_get\_string\_type**() returns the UI string type.

**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 for UIT\_BOOLEAN type UI strings, or NULL for any other type.

**UI\_get0\_result\_string**() returns the UI string result buffer for UIT\_PROMPT and UIT\_VERIFY type UI strings, or NULL for any other type.

**UI\_get0\_test\_string**() returns the UI string action description string for UIT\_VERIFY type UI strings, or NULL for any other type.

**UI\_get\_result\_minsize**() returns the minimum allowed result size for the UI string for UIT\_PROMPT and UIT\_VERIFY type strings, or -1 for any other type.

**UI\_get\_result\_maxsize**() returns the minimum allowed result size for the UI string for UIT\_PROMPT and UIT\_VERIFY type strings, or -1 for any other type.

**UI\_set\_result**() returns 0 on success or when the UI string is of any type other than UIT\_PROMPT, UIT\_VERIFY, or UIT\_BOOLEAN, or -1 on error.

## SEE ALSO

UI\_new(3)

## HISTORY

These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.
