[#OSSL_PARAM_allocate_from_text]
= OSSL&lowbar;PARAM&lowbar;allocate&lowbar;from&lowbar;text
:mrdocs:

Allocate and fill an OSSL&lowbar;PARAM from a textual key&sol;value using a param definition list&period;

== Synopsis

Declared in `&lt;openssl&sol;params&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;PARAM&lowbar;allocate&lowbar;from&lowbar;text(
    xref:OSSL_PARAM.adoc[OSSL&lowbar;PARAM]* to,
    xref:OSSL_PARAM.adoc[OSSL&lowbar;PARAM] const* paramdefs,
    char const* key,
    char const* value,
    size&lowbar;t value&lowbar;n,
    int* found);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *to*
| Destination parameter&semi; on success owns freshly allocated `data` that the caller must free&period;
| *paramdefs*
| Array of parameter definitions describing allowed keys and types&period;
| *key*
| Parameter name to look up in `paramdefs&period;`
| *value*
| Textual representation of the value (encoding depends on the matched type)&period;
| *value&lowbar;n*
| Length of `value` in bytes (not necessarily NUL&hyphen;terminated)&period;
| *found*
| Optional&semi; set to 1 if `key` was found in `paramdefs,` else 0&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
