about summary refs log tree commit diff
path: root/src/libexpr/primops.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-13T09·15+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-14T10·50+0200
commit12b257f045fcaf8f5c42fe6d153419242c11a6d6 (patch)
treec3349ac973a1965d0a280c2cbebc0b049a24075b /src/libexpr/primops.hh
parent96515b0c0d8c515fff60ef3b72cd7cc9837142c3 (diff)
Make primop registration pluggable
This way we don't have to put all primops in one giant file.
Diffstat (limited to 'src/libexpr/primops.hh')
-rw-r--r--src/libexpr/primops.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libexpr/primops.hh b/src/libexpr/primops.hh
new file mode 100644
index 000000000000..39d23b04a5ce
--- /dev/null
+++ b/src/libexpr/primops.hh
@@ -0,0 +1,15 @@
+#include "eval.hh"
+
+#include <tuple>
+#include <vector>
+
+namespace nix {
+
+struct RegisterPrimOp
+{
+    typedef std::vector<std::tuple<std::string, size_t, PrimOpFun>> PrimOps;
+    static PrimOps * primOps;
+    RegisterPrimOp(std::string name, size_t arity, PrimOpFun fun);
+};
+
+}