shell_dump.c 1.2 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_list_node_t *iter;
  14. lub_bintree_iterator_t iterc;
  15. lub_dump_printf("shell(%p)\n", this);
  16. lub_dump_printf("OVERVIEW:\n%s\n", LUB_DUMP_STR(this->overview));
  17. lub_dump_indent();
  18. /* iterate the list of views */
  19. for(iter = lub_list__get_head(this->view_tree);
  20. iter; iter = lub_list_node__get_next(iter)) {
  21. v = (clish_view_t *)lub_list_node__get_data(iter);
  22. clish_view_dump(v);
  23. }
  24. /* iterate the list of types */
  25. for(iter = lub_list__get_head(this->ptype_tree);
  26. iter; iter = lub_list_node__get_next(iter)) {
  27. t = (clish_ptype_t *)lub_list_node__get_data(iter);
  28. clish_ptype_dump(t);
  29. }
  30. /* iterate the tree of vars */
  31. var = lub_bintree_findfirst(&this->var_tree);
  32. for (lub_bintree_iterator_init(&iterc, &this->var_tree, var);
  33. var; var = lub_bintree_iterator_next(&iterc)) {
  34. clish_var_dump(var);
  35. }
  36. lub_dump_undent();
  37. }
  38. /*--------------------------------------------------------- */
  39. #endif /* DEBUG */