summaryrefslogtreecommitdiff
path: root/common/src/internal.cpp
blob: de1e7b02af69caa1198e7c3275d6a6d0e644313e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "hwd/internal.h"

#include <cstdlib>


namespace hwd
{
namespace internal
{

int port()
{
	if (const char * from_env = std::getenv(port_variable))
		if (int port_number = std::atoi(from_env))
			return port_number;
	return default_port;
}

const char * host()
{
	if (const char * from_env = std::getenv(host_variable))
		return from_env;
	return default_host;
}

}  // namespace internal
}  // namespace hwd