Copyright © 2020 Pivotal Software, Inc.
Authors: The RabbitMQ team.
This module provides functions to get and manipulate uniform host triples.
The main goal is to be able to be able to locate native libraries under thepriv
directory. Indeed, the return lib directories are
not dependent to the host triple which set at Erlang/OTP compile
time.
parsed_triple() = #{arch := binary(), vendor := binary(), os := binary(), env => binary()}
A map representing a parsed host triple.
wordsize() = 4 | 8
The host word size as returned by erlang:system_info/1
.
format/1 | Formats the given parsed host triple as a string. |
native_lib_dirs/1 | Computes a list of native lib directories for a given application, based on the host triple of the running Erlang VM instance. |
native_lib_dirs/2 | Computes a list of native lib directories for a given application, based on the given host triple. |
normalize/1 | Normalizes a host triple. |
normalize/2 | Normalizes a host triple. |
parse/1 | Parses a string reprensenting a host triple. |
this_host/0 | Returns the normalized host triple for the host running this Erlang VM instance. |
format(X1::parsed_triple()) -> string()
returns: the host triple formatted as a string.
Formats the given parsed host triple as a string.
native_lib_dirs(Application::atom()) -> [file:filename_all()] | {error, bad_name}
Application: an Erlang application name.
returns: the list of computed native lib directories.
Computes a list of native lib directories for a given application, based on the host triple of the running Erlang VM instance.
native_lib_dirs(Application::atom(), Triple::iolist() | parsed_triple()) -> [file:filename_all()] | {error, bad_name}
Application: an Erlang application name.
Triple: a host triple.
returns: the list of computed native lib directories.
Computes a list of native lib directories for a given application, based on the given host triple.
normalize(Triple) -> string() | {error, {unrecognized_host_triple, Triple}}
Triple: a host triple (string or map).
returns: the normalized host triple in the same form as the given argument, or an tuple if the given host triple was not recognized.
Normalizes a host triple.
The given host triple can be a string or a parsed host triple.normalize(Triple, Wordsize::wordsize() | undefined) -> string() | {error, {unrecognized_host_triple, Triple}}
Triple: a host triple (string or map).
returns: the normalized host triple in the same form as the given argument, or an tuple if the given host triple was not recognized.
Normalizes a host triple.
The given host triple can be a string or a parsed host triple.
Wordsize
is used when the given host triple does not convey that
information. This is the case of the host triple returned by erlang:system_info/1
on Microsoft Windows.
parse(Triple) -> parsed_triple() | {error, {not_a_host_triple, Triple}}
Triple: a host triple (string).
returns: the parsed host triple, or an tuple if the given host triple was not recognized.
Parses a string reprensenting a host triple.
this_host() -> string()
returns: the normalized host triple (string).
Returns the normalized host triple for the host running this Erlang VM instance.
Generated by EDoc