1
0

plugin_dump.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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("plugin : %p\n", this->plugin);
  40. lub_dump_undent();
  41. }
  42. /*--------------------------------------------------------- */
  43. void clish_plugin_dump(const clish_plugin_t *this)
  44. {
  45. lub_list_node_t *iter;
  46. clish_sym_t *sym;
  47. lub_dump_printf("plugin(%p)\n", this);
  48. lub_dump_indent();
  49. lub_dump_printf("name : %s\n", LUB_DUMP_STR(this->name));
  50. lub_dump_printf("alias : %s\n", LUB_DUMP_STR(this->alias));
  51. lub_dump_printf("conf : %s\n", LUB_DUMP_STR(this->conf));
  52. lub_dump_printf("dlhan : %p\n", this->dlhan);
  53. lub_dump_printf("init : %p\n", this->init);
  54. lub_dump_printf("fini : %p\n", this->fini);
  55. lub_dump_printf("rtld_global : %s\n", LUB_DUMP_BOOL(this->rtld_global));
  56. lub_dump_indent();
  57. /* Iterate child elements */
  58. for(iter = lub_list__get_head(this->syms);
  59. iter; iter = lub_list_node__get_next(iter)) {
  60. sym = (clish_sym_t *)lub_list_node__get_data(iter);
  61. clish_sym_dump(sym);
  62. }
  63. lub_dump_undent();
  64. lub_dump_undent();
  65. }
  66. /*--------------------------------------------------------- */
  67. #endif /* DEBUG */