summaryrefslogtreecommitdiff
path: root/src/p18/commands.h
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
commit7e743b73433475df086fcec81be7b10c1d695a42 (patch)
tree1737c5f9bdad2a40f740e9a655e510641331b9e2 /src/p18/commands.h
initial
Diffstat (limited to 'src/p18/commands.h')
-rw-r--r--src/p18/commands.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/p18/commands.h b/src/p18/commands.h
new file mode 100644
index 0000000..0b597e9
--- /dev/null
+++ b/src/p18/commands.h
@@ -0,0 +1,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