summaryrefslogtreecommitdiff
path: root/src/p18/commands.h
diff options
context:
space:
mode:
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