pline.h 881 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. sr_session_ctx_t *sess;
  28. faux_list_t *exprs;
  29. faux_list_t *compls;
  30. } pline_t;
  31. C_DECL_BEGIN
  32. pline_t *pline_new(sr_session_ctx_t *sess);
  33. pline_t *pline_parse(sr_session_ctx_t *sess, faux_argv_t *argv, uint32_t flags);
  34. void pline_free(pline_t *pline);
  35. void pline_debug(pline_t *pline);
  36. void pline_print_completions(const pline_t *pline, bool_t help);
  37. C_DECL_END
  38. #endif /* _pline_h */