forked from lix-project/lix
f4ab297b31
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
25 lines
445 B
C++
25 lines
445 B
C++
#pragma once
|
|
///@file
|
|
|
|
#include <functional>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
namespace nix {
|
|
|
|
typedef std::function<void(int, char * *)> MainFunction;
|
|
|
|
struct RegisterLegacyCommand
|
|
{
|
|
typedef std::map<std::string, MainFunction> Commands;
|
|
static Commands * commands;
|
|
|
|
RegisterLegacyCommand(const std::string & name, MainFunction fun)
|
|
{
|
|
if (!commands) commands = new Commands;
|
|
(*commands)[name] = fun;
|
|
}
|
|
};
|
|
|
|
}
|