view_dump.c 895 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. /* Get each namespace to dump their details */
  18. for (i = 0; i < this->nspacec; i++) {
  19. clish_nspace_dump(clish_view__get_nspace(this, i));
  20. }
  21. /* iterate the tree of commands */
  22. c = lub_bintree_findfirst(&this->tree);
  23. for (lub_bintree_iterator_init(&iter, &this->tree, c);
  24. c; c = lub_bintree_iterator_next(&iter)) {
  25. clish_command_dump(c);
  26. }
  27. lub_dump_undent();
  28. }
  29. /*--------------------------------------------------------- */
  30. #endif /* DEBUG */