pline.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /** @file pline.h
  2. * @brief Plain line.
  3. */
  4. #ifndef _pline_h
  5. #define _pline_h
  6. #include <sysrepo.h>
  7. #include <sysrepo/xpath.h>
  8. // Plain EXPRession
  9. typedef struct {
  10. char *xpath;
  11. char *value;
  12. bool_t active;
  13. } pexpr_t;
  14. // Possible types of completion source
  15. typedef enum {
  16. PCOMPL_NODE = 0,
  17. PCOMPL_TYPE = 1,
  18. } pcompl_type_e;
  19. // Plain COMPLetion
  20. typedef struct {
  21. pcompl_type_e type;
  22. const struct lysc_node *node;
  23. char *xpath;
  24. } pcompl_t;
  25. // Plain LINE
  26. typedef struct pline_s {
  27. faux_list_t *exprs;
  28. faux_list_t *compls;
  29. } pline_t;
  30. C_DECL_BEGIN
  31. pline_t *pline_new(void);
  32. void pline_free(pline_t *pline);
  33. pline_t *pline_parse(const struct ly_ctx *ctx, faux_argv_t *argv, uint32_t flags);
  34. pexpr_t *pline_current_expr(pline_t *pline);
  35. void pline_debug(pline_t *pline);
  36. void pline_print_completions(const pline_t *pline);
  37. //void pline_set_quotes(pline_t *fargv, const char *quotes);
  38. //ssize_t pline_len(const pline_t *fargv);
  39. //pline_node_t *pline_iter(const pline_t *fargv);
  40. //const char *pline_each(pline_node_t **iter);
  41. //const char *pline_current(pline_node_t *iter);
  42. //const char *pline_index(const pline_t *fargv, size_t index);
  43. //ssize_t pline_parse(pline_t *fargv, const char *str);
  44. //bool_t pline_add(pline_t *fargv, const char *arg);
  45. //bool_t pline_is_continuable(const pline_t *fargv);
  46. //void pline_set_continuable(pline_t *fargv, bool_t continuable);
  47. //bool_t pline_is_last(pline_node_t *iter);
  48. C_DECL_END
  49. #endif /* _pline_h */