diff --git a/common/include/villas/cpuset.hpp b/common/include/villas/cpuset.hpp index 9d0597170..db190b239 100644 --- a/common/include/villas/cpuset.hpp +++ b/common/include/villas/cpuset.hpp @@ -193,7 +193,7 @@ public: } }; -} // namespace utils -} // namespace villas +} /* namespace utils */ +} /* namespace villas */ #endif diff --git a/common/include/villas/dsp/exponential_window.hpp b/common/include/villas/dsp/exponential_window.hpp index 8fea57d4f..82f421457 100644 --- a/common/include/villas/dsp/exponential_window.hpp +++ b/common/include/villas/dsp/exponential_window.hpp @@ -49,5 +49,5 @@ public: } }; -} // namespace dsp -} // namespace villas +} /* namespace dsp */ +} /* namespace villas */ diff --git a/common/include/villas/dsp/moving_average_window.hpp b/common/include/villas/dsp/moving_average_window.hpp index 64f6e33ef..cc72559ea 100644 --- a/common/include/villas/dsp/moving_average_window.hpp +++ b/common/include/villas/dsp/moving_average_window.hpp @@ -52,5 +52,5 @@ public: } }; -} // namespace dsp -} // namespace villas +} /* namespace dsp */ +} /* namespace villas */ diff --git a/common/include/villas/dsp/pid.hpp b/common/include/villas/dsp/pid.hpp index 8adc3bf43..df9a89054 100644 --- a/common/include/villas/dsp/pid.hpp +++ b/common/include/villas/dsp/pid.hpp @@ -53,5 +53,5 @@ public: double calculate(double setpoint, double pv); }; -} // namespace dsp -} // namespace villas +} /* namespace dsp */ +} /* namespace villas */ diff --git a/common/include/villas/dsp/window.hpp b/common/include/villas/dsp/window.hpp index ed7669be2..4be9f9db3 100644 --- a/common/include/villas/dsp/window.hpp +++ b/common/include/villas/dsp/window.hpp @@ -77,5 +77,5 @@ public: } }; -} // namespace dsp -} // namespace villas +} /* namespace dsp */ +} /* namespace villas */ diff --git a/common/include/villas/exceptions.hpp b/common/include/villas/exceptions.hpp index ca3c0c929..4bdba92b0 100644 --- a/common/include/villas/exceptions.hpp +++ b/common/include/villas/exceptions.hpp @@ -144,4 +144,4 @@ public: } }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/graph/directed.hpp b/common/include/villas/graph/directed.hpp index b414c3be5..a4f63448b 100644 --- a/common/include/villas/graph/directed.hpp +++ b/common/include/villas/graph/directed.hpp @@ -294,4 +294,4 @@ protected: }; } // namespacae graph -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/graph/edge.hpp b/common/include/villas/graph/edge.hpp index 1856b72a2..18b5441e9 100644 --- a/common/include/villas/graph/edge.hpp +++ b/common/include/villas/graph/edge.hpp @@ -54,4 +54,4 @@ private: }; } // namespacae graph -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/graph/vertex.hpp b/common/include/villas/graph/vertex.hpp index bece20741..b4c7816ad 100644 --- a/common/include/villas/graph/vertex.hpp +++ b/common/include/villas/graph/vertex.hpp @@ -52,4 +52,4 @@ private: }; } // namespacae graph -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/json_buffer.hpp b/common/include/villas/json_buffer.hpp index 154a11acf..da109a17f 100644 --- a/common/include/villas/json_buffer.hpp +++ b/common/include/villas/json_buffer.hpp @@ -55,4 +55,4 @@ public: json_t * decode(); }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/kernel/kernel.hpp b/common/include/villas/kernel/kernel.hpp index 597a49100..da954d615 100644 --- a/common/include/villas/kernel/kernel.hpp +++ b/common/include/villas/kernel/kernel.hpp @@ -31,5 +31,5 @@ namespace kernel { /** Get the version of the kernel. */ utils::Version getVersion(); -} // namespace villas -} // namespace kernel +} /* namespace villas */ +} /* namespace kernel */ diff --git a/common/include/villas/kernel/rt.hpp b/common/include/villas/kernel/rt.hpp index 506d69573..8c68ece40 100644 --- a/common/include/villas/kernel/rt.hpp +++ b/common/include/villas/kernel/rt.hpp @@ -47,8 +47,8 @@ void setPriority(int priority); */ bool isPreemptible(); -} // namespace villas -} // namespace kernel -} // namespace rt +} /* namespace villas */ +} /* namespace kernel */ +} /* namespace rt */ /** @} */ diff --git a/common/include/villas/kernel/vfio.hpp b/common/include/villas/kernel/vfio.hpp index 0079ee8f3..dcd196292 100644 --- a/common/include/villas/kernel/vfio.hpp +++ b/common/include/villas/kernel/vfio.hpp @@ -162,4 +162,4 @@ private: /** @} */ -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/log.hpp b/common/include/villas/log.hpp index aca4b8e4d..6baa70ff6 100644 --- a/common/include/villas/log.hpp +++ b/common/include/villas/log.hpp @@ -81,4 +81,4 @@ public: std::string getLevelName() const; }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/log_opal_sink.hpp b/common/include/villas/log_opal_sink.hpp index 90c7c825c..5d5d73949 100644 --- a/common/include/villas/log_opal_sink.hpp +++ b/common/include/villas/log_opal_sink.hpp @@ -61,5 +61,5 @@ using OpalSink_mt = OpalSink; using OpalSink_st = OpalSink; -} // namespace node -} // namespace villas +} /* namespace node */ +} /* namespace villas */ diff --git a/common/include/villas/memory.hpp b/common/include/villas/memory.hpp index 410355eea..3c6f7ccc2 100644 --- a/common/include/villas/memory.hpp +++ b/common/include/villas/memory.hpp @@ -329,4 +329,4 @@ private: static std::map> allocators; }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/memory_manager.hpp b/common/include/villas/memory_manager.hpp index 987daf899..5dcc11186 100644 --- a/common/include/villas/memory_manager.hpp +++ b/common/include/villas/memory_manager.hpp @@ -271,4 +271,4 @@ private: static MemoryManager* instance; }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/plugin.hpp b/common/include/villas/plugin.hpp index 97d491f47..e57067a0b 100644 --- a/common/include/villas/plugin.hpp +++ b/common/include/villas/plugin.hpp @@ -135,5 +135,5 @@ protected: } }; -} // namespace plugin -} // namespace villas +} /* namespace plugin */ +} /* namespace villas */ diff --git a/common/include/villas/terminal.hpp b/common/include/villas/terminal.hpp index 546cccc77..ffb2b49c6 100644 --- a/common/include/villas/terminal.hpp +++ b/common/include/villas/terminal.hpp @@ -62,4 +62,4 @@ public: } }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/tool.hpp b/common/include/villas/tool.hpp index 266d7ba13..1f02a8534 100644 --- a/common/include/villas/tool.hpp +++ b/common/include/villas/tool.hpp @@ -68,4 +68,4 @@ public: int run(); }; -} // namespace villas +} /* namespace villas */ diff --git a/common/include/villas/utils.hpp b/common/include/villas/utils.hpp index 847116e94..cd7288f2e 100644 --- a/common/include/villas/utils.hpp +++ b/common/include/villas/utils.hpp @@ -28,14 +28,13 @@ #include #include - - #include #include #include #include #include -#include + +#include #include #include @@ -202,7 +201,23 @@ pid_t spawn(const char *name, char *const argv[]); /** Determines the string length as printed on the screen (ignores escable sequences). */ size_t strlenp(const char *str); -} // namespace utils -} // namespace villas +/** Calculate SHA1 hash of complete file \p f and place it into \p sha1. + * + * @param sha1[out] Must be SHA_DIGEST_LENGTH (20) in size. + * @retval 0 Everything was okay. + */ +int sha1sum(FILE *f, unsigned char *sha1); + +namespace base64 { + +std::string encode(const std::string &str); +std::string encode(const unsigned char *input, size_t len); + +std::string decode(const std::string &str); +std::string decode(unsigned char *input, size_t len); + +} /* namespace base64 */ +} /* namespace utils */ +} /* namespace villas */ using namespace villas::utils; diff --git a/common/include/villas/version.hpp b/common/include/villas/version.hpp index f65ce2bb0..0b14fb3be 100644 --- a/common/include/villas/version.hpp +++ b/common/include/villas/version.hpp @@ -49,5 +49,5 @@ public: inline bool operator>=(const Version& rhs) { return cmp(*this, rhs) >= 0; } }; -} // namespace villas -} // namespace utils +} /* namespace villas */ +} /* namespace utils */