[#BIO_parse_hostserv]
= BIO&lowbar;parse&lowbar;hostserv
:mrdocs:

Split a host&colon;service string into separately allocated host and service names&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BIO&lowbar;parse&lowbar;hostserv(
    char const* hostserv,
    char** host,
    char** service,
    xref:BIO_hostserv_priorities.adoc[BIO&lowbar;hostserv&lowbar;priorities] hostserv&lowbar;prio);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hostserv*
| Combined host and&sol;or service string (IPv6 hosts must be bracketed)&period;
| *host*
| Receives a malloc&apos;d hostname string, or is left unchanged &sol; set to NULL per the parse rules&semi; free with OPENSSL&lowbar;free()&period;
| *service*
| Receives a malloc&apos;d service&sol;port string, or is left unchanged &sol; set to NULL per the parse rules&semi; free with OPENSSL&lowbar;free()&period;
| *hostserv&lowbar;prio*
| BIO&lowbar;PARSE&lowbar;PRIO&lowbar;HOST or BIO&lowbar;PARSE&lowbar;PRIO&lowbar;SERV when `hostserv` has no colon&period;
|===


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