mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 17:46:15 +02:00
23 lines
436 B
C++
23 lines
436 B
C++
#pragma once
|
|
|
|
#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;
|
|
}
|
|
};
|
|
|
|
}
|