1
0

plugin_dump.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_indent();
  56. /* Iterate child elements */
  57. for(iter = lub_list__get_head(this->syms);
  58. iter; iter = lub_list_node__get_next(iter)) {
  59. sym = (clish_sym_t *)lub_list_node__get_data(iter);
  60. clish_sym_dump(sym);
  61. }
  62. lub_dump_undent();
  63. lub_dump_undent();
  64. }
  65. /*--------------------------------------------------------- */
  66. #endif /* DEBUG */