plugin_dump.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifdef DEBUG
  2. /*
  3. * plugin_dump.c
  4. */
  5. #include "private.h"
  6. #include "lub/dump.h"
  7. #include "lub/list.h"
  8. #include "clish/plugin.h"
  9. /*--------------------------------------------------------- */
  10. void clish_sym_dump(const clish_sym_t *this)
  11. {
  12. char *type = NULL;
  13. lub_dump_printf("sym(%p)\n", this);
  14. lub_dump_indent();
  15. lub_dump_printf("name : %s\n", LUB_DUMP_STR(this->name));
  16. lub_dump_printf("func : %p\n", LUB_DUMP_STR(this->func));
  17. switch (this->type) {
  18. case CLISH_SYM_TYPE_NONE:
  19. type = "none";
  20. break;
  21. case CLISH_SYM_TYPE_ACTION:
  22. type = "action";
  23. break;
  24. case CLISH_SYM_TYPE_ACCESS:
  25. type = "access";
  26. break;
  27. case CLISH_SYM_TYPE_CONFIG:
  28. type = "config";
  29. break;
  30. case CLISH_SYM_TYPE_LOG:
  31. type = "log";
  32. break;
  33. default:
  34. type = "unknown";
  35. break;
  36. }
  37. lub_dump_printf("type : %s\n", type);
  38. lub_dump_printf("permanent : %s\n", LUB_DUMP_BOOL(this->permanent));
  39. lub_dump_printf("expand : %s\n", LUB_DUMP_TRI(this->expand));
  40. lub_dump_printf("plugin : %p\n", this->plugin);
  41. lub_dump_undent();
  42. }
  43. /*--------------------------------------------------------- */
  44. void clish_plugin_dump(const clish_plugin_t *this)
  45. {
  46. lub_list_node_t *iter;
  47. clish_sym_t *sym;
  48. lub_dump_printf("plugin(%p)\n", this);
  49. lub_dump_indent();
  50. lub_dump_printf("name : %s\n", LUB_DUMP_STR(this->name));
  51. lub_dump_printf("alias : %s\n", LUB_DUMP_STR(this->alias));
  52. lub_dump_printf("conf : %s\n", LUB_DUMP_STR(this->conf));
  53. lub_dump_printf("dlhan : %p\n", this->dlhan);
  54. lub_dump_printf("init : %p\n", this->init);
  55. lub_dump_printf("fini : %p\n", this->fini);
  56. lub_dump_printf("rtld_global : %s\n", LUB_DUMP_BOOL(this->rtld_global));
  57. lub_dump_indent();
  58. /* Iterate child elements */
  59. for(iter = lub_list__get_head(this->syms);
  60. iter; iter = lub_list_node__get_next(iter)) {
  61. sym = (clish_sym_t *)lub_list_node__get_data(iter);
  62. clish_sym_dump(sym);
  63. }
  64. lub_dump_undent();
  65. lub_dump_undent();
  66. }
  67. /*--------------------------------------------------------- */
  68. #endif /* DEBUG */