pline.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. } pexpr_t;
  13. // Possible types of completion source
  14. typedef enum {
  15. PCOMPL_NODE = 0,
  16. PCOMPL_TYPE = 1,
  17. } pcompl_type_e;
  18. // Plain COMPLetion
  19. typedef struct {
  20. struct lysc_node *node;
  21. char *xpath;
  22. } pcompl_t;
  23. // Plain LINE
  24. typedef struct pline_s {
  25. faux_list_t *exprs;
  26. faux_list_t *compls;
  27. } pline_t;
  28. C_DECL_BEGIN
  29. pline_t *pline_new(void);
  30. void pline_free(pline_t *pline);
  31. pline_t *pline_parse(const struct ly_ctx *ctx, faux_argv_t *argv, uint32_t flags);
  32. pexpr_t *pline_current_expr(pline_t *pline);
  33. //void pline_set_quotes(pline_t *fargv, const char *quotes);
  34. //ssize_t pline_len(const pline_t *fargv);
  35. //pline_node_t *pline_iter(const pline_t *fargv);
  36. //const char *pline_each(pline_node_t **iter);
  37. //const char *pline_current(pline_node_t *iter);
  38. //const char *pline_index(const pline_t *fargv, size_t index);
  39. //ssize_t pline_parse(pline_t *fargv, const char *str);
  40. //bool_t pline_add(pline_t *fargv, const char *arg);
  41. //bool_t pline_is_continuable(const pline_t *fargv);
  42. //void pline_set_continuable(pline_t *fargv, bool_t continuable);
  43. //bool_t pline_is_last(pline_node_t *iter);
  44. C_DECL_END
  45. #endif /* _pline_h */