1
0

kpath.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** @file kpath.h
  2. *
  3. * @brief Klish path stack
  4. */
  5. #ifndef _klish_kpath_h
  6. #define _klish_kpath_h
  7. #include <faux/list.h>
  8. #include <klish/kentry.h>
  9. typedef struct kpath_s kpath_t;
  10. typedef struct klevel_s klevel_t;
  11. typedef faux_list_node_t kpath_levels_node_t;
  12. C_DECL_BEGIN
  13. // Level
  14. klevel_t *klevel_new(const kentry_t *entry);
  15. void klevel_free(klevel_t *level);
  16. const kentry_t *klevel_entry(const klevel_t *level);
  17. klevel_t *klevel_clone(const klevel_t *level);
  18. bool_t klevel_is_equal(const klevel_t *f, const klevel_t *s);
  19. // Path
  20. kpath_t *kpath_new(void);
  21. void kpath_free(kpath_t *path);
  22. size_t kpath_len(const kpath_t *path);
  23. size_t kpath_is_empty(const kpath_t *path);
  24. bool_t kpath_push(kpath_t *path, klevel_t *level);
  25. bool_t kpath_pop(kpath_t *path);
  26. klevel_t *kpath_current(const kpath_t *path);
  27. kpath_levels_node_t *kpath_iterr(const kpath_t *path);
  28. klevel_t *kpath_eachr(kpath_levels_node_t **iterr);
  29. kpath_levels_node_t *kpath_iter(const kpath_t *path);
  30. klevel_t *kpath_each(kpath_levels_node_t **iter);
  31. kpath_t *kpath_clone(const kpath_t *path);
  32. bool_t kpath_is_equal(const kpath_t *f, const kpath_t *s);
  33. C_DECL_END
  34. #endif // _klish_kpath_h