123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #include "clish/shell.h"
- #include "clish/pargv.h"
- #include "clish/variable.h"
- #include "lub/bintree.h"
- #include "tinyrl/tinyrl.h"
- typedef struct {
- const char *last_cmd;
- clish_nspace_visibility_t field;
- } clish_shell_iterator_t;
- typedef struct clish_shell_file_s clish_shell_file_t;
- struct clish_shell_file_s {
- clish_shell_file_t *next;
- FILE *file;
- bool_t stop_on_error;
- };
- typedef struct {
- char *line;
- clish_view_t *view;
- char *viewid;
- } clish_shell_pwd_t;
- struct clish_context_s {
- clish_pargv_t *completion_pargv;
- unsigned completion_index;
- unsigned completion_pindex;
- clish_shell_iterator_t iter;
- };
- struct clish_shell_s {
- lub_bintree_t view_tree;
- lub_bintree_t ptype_tree;
- const clish_shell_hooks_t *client_hooks;
- void *client_cookie;
- clish_view_t *global;
- clish_view_t *view;
- clish_command_t *startup;
- clish_shell_state_t state;
- char *overview;
- char *viewid;
- tinyrl_t *tinyrl;
- clish_shell_file_t *current_file;
- clish_shell_pwd_t **cfg_pwdv;
- unsigned cfg_pwdc;
- konf_client_t *client;
- clish_param_t *param_depth;
- clish_param_t *param_pwd;
- char * lockfile;
- pthread_t pthread;
- clish_context_t context;
- };
- void
- clish_shell_iterator_init(clish_shell_iterator_t * iter,
- clish_nspace_visibility_t field);
- const clish_command_t *clish_shell_find_next_completion(const clish_shell_t *
- instance, const char *line, clish_shell_iterator_t * iter);
- bool_t clish_shell_pop_file(clish_shell_t * instance);
- clish_view_t *clish_shell_find_view(clish_shell_t * instance, const char *name);
- void clish_shell_insert_view(clish_shell_t * instance, clish_view_t * view);
- clish_pargv_status_t
- clish_shell_parse(const clish_shell_t * instance,
- const char *line,
- const clish_command_t ** cmd, clish_pargv_t ** pargv);
- char *clish_shell_word_generator(clish_shell_t * instance,
- const char *line,
- unsigned offset, unsigned state);
- const clish_command_t *clish_shell_resolve_command(const clish_shell_t *
- instance, const char *line);
- const clish_command_t *clish_shell_resolve_prefix(const clish_shell_t *
- instance, const char *line);
- const clish_command_t *clish_shell_getfirst_command(clish_shell_t * instance,
- const char *line,
- clish_nspace_visibility_t
- field);
- const clish_command_t *clish_shell_getnext_command(clish_shell_t * instance,
- const char *line);
- void clish_shell_insert_ptype(clish_shell_t * instance, clish_ptype_t * ptype);
- void clish_shell_tinyrl_history(clish_shell_t * instance, unsigned int *limit);
- tinyrl_t *clish_shell_tinyrl_new(FILE * instream,
- FILE * outstream, unsigned stifle);
- void clish_shell_tinyrl_delete(tinyrl_t * instance);
|