blob: 45a23198332052f0d1ada583c1d51ba27197748f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#pragma once
///@file
#include <functional>
#include <map>
#include <string>
namespace nix {
typedef std::function<void(int, char * *)> MainFunction;
struct LegacyCommands
{
typedef std::map<std::string, MainFunction> Commands;
static Commands * commands;
static void add(const std::string & name, MainFunction fun)
{
if (!commands) commands = new Commands;
(*commands)[name] = fun;
}
};
}
|