1
0

view_dump.c 962 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifdef DEBUG
  2. /*
  3. * view_dump.c
  4. */
  5. #include "private.h"
  6. #include "lub/dump.h"
  7. /*--------------------------------------------------------- */
  8. void clish_view_dump(clish_view_t * this)
  9. {
  10. clish_command_t *c;
  11. lub_bintree_iterator_t iter;
  12. unsigned i;
  13. lub_dump_printf("view(%p)\n", this);
  14. lub_dump_indent();
  15. lub_dump_printf("name : %s\n", clish_view__get_name(this));
  16. lub_dump_printf("depth : %u\n", clish_view__get_depth(this));
  17. lub_dump_printf("access : %u\n", clish_view__get_access(this));
  18. /* Get each namespace to dump their details */
  19. for (i = 0; i < this->nspacec; i++) {
  20. clish_nspace_dump(clish_view__get_nspace(this, i));
  21. }
  22. /* iterate the tree of commands */
  23. c = lub_bintree_findfirst(&this->tree);
  24. for (lub_bintree_iterator_init(&iter, &this->tree, c);
  25. c; c = lub_bintree_iterator_next(&iter)) {
  26. clish_command_dump(c);
  27. }
  28. lub_dump_undent();
  29. }
  30. /*--------------------------------------------------------- */
  31. #endif /* DEBUG */