2017-06-13 01:22:57 +00:00
|
|
|
// Prototypes for executing builtin_bind function.
|
2017-06-13 00:19:13 +00:00
|
|
|
#ifndef FISH_BUILTIN_BIND_H
|
|
|
|
#define FISH_BUILTIN_BIND_H
|
|
|
|
|
2017-10-03 08:29:48 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
2017-06-13 00:19:13 +00:00
|
|
|
class parser_t;
|
|
|
|
struct io_streams_t;
|
2017-10-03 08:29:48 +00:00
|
|
|
struct bind_cmd_opts_t;
|
|
|
|
|
|
|
|
class builtin_bind_t {
|
2019-05-05 10:09:25 +00:00
|
|
|
public:
|
|
|
|
int builtin_bind(parser_t &parser, io_streams_t &streams, wchar_t **argv);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bind_cmd_opts_t *opts;
|
|
|
|
|
|
|
|
void list(const wchar_t *bind_mode, bool user, io_streams_t &streams);
|
|
|
|
void key_names(bool all, io_streams_t &streams);
|
|
|
|
void function_names(io_streams_t &streams);
|
|
|
|
bool add(const wchar_t *seq, const wchar_t *const *cmds, size_t cmds_len, const wchar_t *mode,
|
|
|
|
const wchar_t *sets_mode, bool terminfo, bool user, io_streams_t &streams);
|
|
|
|
bool erase(wchar_t **seq, bool all, const wchar_t *mode, bool use_terminfo, bool user,
|
|
|
|
io_streams_t &streams);
|
|
|
|
bool get_terminfo_sequence(const wchar_t *seq, wcstring *out_seq, io_streams_t &streams);
|
|
|
|
bool insert(int optind, int argc, wchar_t **argv, io_streams_t &streams);
|
|
|
|
void list_modes(io_streams_t &streams);
|
|
|
|
bool list_one(const wcstring &seq, const wcstring &bind_mode, bool user, io_streams_t &streams);
|
|
|
|
bool list_one(const wcstring &seq, const wcstring &bind_mode, bool user, bool preset,
|
|
|
|
io_streams_t &streams);
|
2017-10-03 08:29:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
inline int builtin_bind(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
2019-05-05 10:09:25 +00:00
|
|
|
builtin_bind_t bind;
|
|
|
|
return bind.builtin_bind(parser, streams, argv);
|
2017-10-03 08:29:48 +00:00
|
|
|
}
|
2017-06-13 00:19:13 +00:00
|
|
|
|
|
|
|
#endif
|