1
0

view_dump.c 1.1 KB

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