Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
legacy.hh
Go to the documentation of this file.
1#pragma once
3
5#include <functional>
6#include <list>
7#include <map>
8#include <string>
9
10namespace nix {
11
12typedef std::function<void(AsyncIoRoot &, std::string, std::list<std::string>)> MainFunction;
13
15{
16 using LegacyCommandMap = std::map<std::string, MainFunction>;
17 static LegacyCommandMap * commands;
18
19 static void add(const std::string & name, MainFunction fun)
20 {
21 if (!commands) commands = new LegacyCommandMap;
22 (*commands)[name] = fun;
23 }
24};
25
26}
Definition async.hh:39
Definition legacy.hh:15