mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
a0c4d58549
The remaining constructor RegisterPrimOp::RegisterPrimOp(Info && info)
allows specifying the documentation in .args and .doc members of the
Info structure.
Commit 8ec1ba0210
removed all uses of the removed constructor in the
nix binary. Here, we remove the constructor completely as well as its
use in a plugin test. According to #8515, we didn't promis to maintain
compatibility with external plugins.
Fixes #8515
28 lines
569 B
C++
28 lines
569 B
C++
#include "config.hh"
|
|
#include "primops.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct MySettings : Config
|
|
{
|
|
Setting<bool> settingSet{this, false, "setting-set",
|
|
"Whether the plugin-defined setting was set"};
|
|
};
|
|
|
|
MySettings mySettings;
|
|
|
|
static GlobalConfig::Register rs(&mySettings);
|
|
|
|
static void prim_anotherNull (EvalState & state, const PosIdx pos, Value ** args, Value & v)
|
|
{
|
|
if (mySettings.settingSet)
|
|
v.mkNull();
|
|
else
|
|
v.mkBool(false);
|
|
}
|
|
|
|
static RegisterPrimOp rp({
|
|
.name = "anotherNull",
|
|
.arity = 0,
|
|
.fun = prim_anotherNull,
|
|
});
|