aboutsummaryrefslogtreecommitdiff
path: root/bbot/agent/agent.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-13 22:50:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-14 19:10:22 +0300
commitc8ace1ee0a6cab5fd4ea2f084ea436cfa513637d (patch)
treea8db884a665fbf14797393a3b2ff95438c338bb9 /bbot/agent/agent.hxx
parent8e8d599b129d35f638f2c1957c869b054a38b021 (diff)
Make use of wildcards in buildfiles
Diffstat (limited to 'bbot/agent/agent.hxx')
-rw-r--r--bbot/agent/agent.hxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/bbot/agent/agent.hxx b/bbot/agent/agent.hxx
new file mode 100644
index 0000000..96876bc
--- /dev/null
+++ b/bbot/agent/agent.hxx
@@ -0,0 +1,45 @@
+// file : bbot/agent/agent.hxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : TBC; see accompanying LICENSE file
+
+#ifndef BBOT_AGENT_AGENT_HXX
+#define BBOT_AGENT_AGENT_HXX
+
+#include <sys/types.h> // uid_t
+
+#include <bbot/types.hxx>
+#include <bbot/utility.hxx>
+
+#include <bbot/agent/agent-options.hxx>
+
+namespace bbot
+{
+ extern agent_options ops;
+
+ extern const string bs_prot; // Bootstrap protocol version.
+
+ extern string tc_name; // Toolchain name.
+ extern uint16_t tc_num; // Toolchain number.
+ extern standard_version tc_ver; // Toolchain version.
+ extern string tc_id; // Toolchain id.
+
+ extern string hname; // Our host name.
+ extern uid_t uid; // Our effective user id.
+ extern string uname; // Our effective user name.
+
+ // Random number generator (currently not MT-safe and limited to RAND_MAX).
+ //
+ size_t
+ genrand ();
+
+ template <typename T>
+ inline T
+ genrand () {return static_cast<T> (genrand ());}
+
+ // Return the IPv4 address of an interface.
+ //
+ string
+ iface_addr (const string&);
+}
+
+#endif // BBOT_AGENT_AGENT_HXX