view_dump.c 861 B

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