1
0

shell_dump.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifdef DEBUG
  2. /*
  3. * shell_dump.c
  4. */
  5. #include "private.h"
  6. #include "lub/dump.h"
  7. /*--------------------------------------------------------- */
  8. void clish_shell_dump(clish_shell_t * this)
  9. {
  10. clish_view_t *v;
  11. clish_ptype_t *t;
  12. clish_var_t *var;
  13. lub_bintree_iterator_t iter;
  14. lub_dump_printf("shell(%p)\n", this);
  15. lub_dump_printf("OVERVIEW:\n%s", this->overview);
  16. lub_dump_indent();
  17. v = lub_bintree_findfirst(&this->view_tree);
  18. /* iterate the tree of views */
  19. for (lub_bintree_iterator_init(&iter, &this->view_tree, v);
  20. v; v = lub_bintree_iterator_next(&iter)) {
  21. clish_view_dump(v);
  22. }
  23. /* iterate the tree of types */
  24. t = lub_bintree_findfirst(&this->ptype_tree);
  25. for (lub_bintree_iterator_init(&iter, &this->ptype_tree, t);
  26. t; t = lub_bintree_iterator_next(&iter)) {
  27. clish_ptype_dump(t);
  28. }
  29. /* iterate the tree of vars */
  30. var = lub_bintree_findfirst(&this->var_tree);
  31. for (lub_bintree_iterator_init(&iter, &this->var_tree, var);
  32. var; var = lub_bintree_iterator_next(&iter)) {
  33. clish_var_dump(var);
  34. }
  35. lub_dump_undent();
  36. }
  37. /*--------------------------------------------------------- */
  38. #endif /* DEBUG */