summaryrefslogtreecommitdiff
path: root/source/libfud.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/libfud.cpp')
-rw-r--r--source/libfud.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/libfud.cpp b/source/libfud.cpp
index e1dad1d..252eae0 100644
--- a/source/libfud.cpp
+++ b/source/libfud.cpp
@@ -17,10 +17,26 @@
#include "libfud.hpp"
+#include "fud_assert.hpp"
+#include "git_version.hpp"
+
#include <cstdlib>
namespace fud {
+FUD fud()
+{
+ FUD fudInfo{};
+ fudInfo.major = FudVersionMajor;
+ fudInfo.minor = FudVersionMinor;
+ fudInfo.patch = FudVersionPatch;
+ static_assert(sizeof(GitHash) >= sizeof(fudInfo.revision));
+ auto copyResult = copyMem(fudInfo.revision.data(), fudInfo.revision.size(), GitHash, fudInfo.revision.size() - 1);
+ fudAssert(copyResult == FudStatus::Success);
+ fudInfo.revision[fudInfo.revision.size() - 1] = '\0';
+ return fudInfo;
+}
+
Result<String, FudStatus> getEnv(const char* name)
{
using RetType = Result<String, FudStatus>;