31 #define EC_EDITLINE_HISTORY_SIZE 128
331 #include "interact.h"
336 #define EC_EDITLINE_HELP_ATTR EC_DEPRECATED_MACRO("use EC_INTERACT_HELP_ATTR") EC_INTERACT_HELP_ATTR
337 #define EC_EDITLINE_CB_ATTR EC_DEPRECATED_MACRO("use EC_INTERACT_CB_ATTR") EC_INTERACT_CB_ATTR
338 #define EC_EDITLINE_DESC_ATTR EC_DEPRECATED_MACRO("use EC_INTERACT_DESC_ATTR") EC_INTERACT_DESC_ATTR
346 ec_editline_command_cb_t
EC_DEPRECATED(
"use ec_interact_command_cb_t");
352 #pragma GCC diagnostic push
353 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
356 ec_editline_get_completions(const struct
ec_comp *cmpl,
char ***matches_out);
359 void ec_editline_free_completions(
char **matches,
size_t n);
362 int ec_editline_print_cols(struct
ec_editline *editline,
char const *const *matches,
size_t n);
365 char *ec_editline_append_chars(const struct
ec_comp *cmpl);
370 struct ec_editline_help **helps_out
374 int ec_editline_print_helps(
376 const struct ec_editline_help *helps,
381 void ec_editline_free_helps(struct ec_editline_help *helps,
size_t n);
385 struct ec_editline_help **helps_out,
390 int ec_editline_print_error_helps(
392 const struct ec_editline_help *helps,
398 int ec_editline_set_help(struct
ec_node *node, const
char *help);
404 int ec_editline_set_desc(struct
ec_node *node, const
char *desc);
406 #pragma GCC diagnostic pop
struct ec_comp * ec_comp(void)
struct ec_pnode * ec_editline_parse(struct ec_editline *editline)
int ec_editline_set_prompt(struct ec_editline *editline, const char *prompt)
char * ec_editline_gets(struct ec_editline *editline)
int ec_editline_set_prompt_esc(struct ec_editline *editline, const char *prompt, char delim)
void ec_editline_free(struct ec_editline *editline)
int(* ec_editline_check_exit_cb_t)(void *opaque)
const struct ec_node * ec_editline_get_node(const struct ec_editline *editline)
struct ec_editline * ec_editline(const char *prog, FILE *f_in, FILE *f_out, FILE *f_err, enum ec_editline_init_flags flags)
int ec_editline_term_size(const struct ec_editline *editline, unsigned int *width, unsigned int *height)
struct editline * ec_editline_get_el(struct ec_editline *editline)
int ec_editline_complete(struct editline *el, int c)
int ec_editline_interact(struct ec_editline *editline, ec_editline_check_exit_cb_t check_exit_cb, void *opaque)
char * ec_editline_curline(const struct ec_editline *editline, bool trim_after_cursor)
int ec_editline_set_node(struct ec_editline *editline, const struct ec_node *node)
int ec_editline_set_history(struct ec_editline *editline, size_t hist_size, const char *hist_file)
@ EC_EDITLINE_DISABLE_COMPLETION
@ EC_EDITLINE_DISABLE_SIGNALS
@ EC_EDITLINE_DEFAULT_SIGHANDLER
@ EC_EDITLINE_DISABLE_HISTORY
ssize_t ec_interact_get_error_helps(const struct ec_node *node, const char *line, struct ec_interact_help **helps_out, size_t *char_idx)
int(* ec_interact_command_cb_t)(const struct ec_pnode *)
int ec_interact_print_error_helps(FILE *out, unsigned int width, const char *line, const struct ec_interact_help *helps, size_t n, size_t char_idx)
int ec_interact_set_help(struct ec_node *node, const char *help)
int ec_interact_print_helps(FILE *out, unsigned int width, const struct ec_interact_help *helps, size_t n)
int ec_interact_set_desc(struct ec_node *node, const char *desc)
ssize_t ec_interact_get_helps(const struct ec_node *node, const char *line, struct ec_interact_help **helps_out)
int ec_interact_set_callback(struct ec_node *node, ec_interact_command_cb_t cb)
int ec_interact_print_cols(FILE *out, unsigned int width, char const *const *matches, size_t n)
char * ec_interact_append_chars(const struct ec_comp *cmpl)
void ec_interact_free_helps(struct ec_interact_help *helps, size_t n)
void ec_interact_free_completions(char **matches, size_t n)
struct ec_node * ec_node(const char *typename, const char *id)
struct ec_pnode * ec_pnode(const struct ec_node *node)
#define EC_DEPRECATED(msg)