summaryrefslogtreecommitdiff
path: root/src/p18/commands.h
blob: 0b597e978b144d2c415c359db03eac03f0cd95c3 (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
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: BSD-3-Clause

#ifndef INVERTER_TOOLS_P18_COMMANDS_H
#define INVERTER_TOOLS_P18_COMMANDS_H

#include <map>
#include <string>
#include <vector>

#include "types.h"

namespace p18 {

#ifdef INVERTERCTL
struct CommandInput {
    int argc;
    char** argv;
};
#endif

#ifdef INVERTERD
struct CommandInput {
    std::vector<std::string>* argv;
};
#endif

extern const std::map<std::string, p18::CommandType> client_commands;

static void validate_date_args(const std::string* ys, const std::string* ms, const std::string* ds);
static void validate_time_args(const std::string* hs, const std::string* ms, const std::string* ss);
CommandType validate_input(std::string& command, std::vector<std::string>& arguments, void* input);

}

#endif //INVERTER_TOOLS_P18_COMMANDS_H