1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <filesystem>
6#include <map>
7#include <stddef.h>
8#include <vector>
9
10using namespace std::string_literals;
11
12void do_help(int argc, const char *argv[]);
13void do_version(int argc, const char *argv[]);
14void do_exit(int argc, const char *argv[]);
15void do_clear(int argc, const char *argv[]);
16
17typedef struct
18{
19 const char *command;
20 void (*action)(const std::vector<std::string> &argv);
21 const char *description;
22} command_t;
23
24extern const std::vector<command_t> builtin_commands;
25extern bool verbose;
26extern std::map<std::string, std::string> aliases;
27
28bool execute_line(const std::string &in);
29bool do_interpret_script(const std::filesystem::path &path);
30
31// jsonrpc.cpp
32int do_jsonrpc();
33
34// utils.cpp
35const std::vector<std::filesystem::path> &get_paths(bool force = false);
36std::string string_trim(const std::string &in);
37std::pair<int, int> wait_for_pid(pid_t pid, int flags = 0);
38