1
0

plugin_dump.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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", this->name);
  16. lub_dump_printf("func : %p\n", 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_INIT:
  25. type = "init";
  26. break;
  27. case CLISH_SYM_TYPE_FINI:
  28. type = "fini";
  29. break;
  30. case CLISH_SYM_TYPE_ACCESS:
  31. type = "access";
  32. break;
  33. case CLISH_SYM_TYPE_CONFIG:
  34. type = "config";
  35. break;
  36. case CLISH_SYM_TYPE_LOG:
  37. type = "log";
  38. break;
  39. default:
  40. type = "unknown";
  41. break;
  42. }
  43. lub_dump_printf("type : %s\n", type);
  44. lub_dump_printf("permanent : %s\n",
  45. this->permanent ? "true" : "false");
  46. lub_dump_printf("plugin : %p\n", this->plugin);
  47. lub_dump_undent();
  48. }
  49. /*--------------------------------------------------------- */
  50. void clish_plugin_dump(const clish_plugin_t *this)
  51. {
  52. lub_list_node_t *iter;
  53. clish_sym_t *sym;
  54. lub_dump_printf("plugin(%p)\n", this);
  55. lub_dump_indent();
  56. lub_dump_printf("name : %s\n", this->name);
  57. lub_dump_printf("alias : %s\n", this->alias);
  58. lub_dump_printf("conf : %s\n", this->conf);
  59. lub_dump_printf("file : %s\n", this->file);
  60. lub_dump_printf("dlhan : %p\n", this->dlhan);
  61. lub_dump_printf("init : %p\n", this->init);
  62. lub_dump_printf("fini : %p\n", this->fini);
  63. lub_dump_indent();
  64. /* Iterate child elements */
  65. for(iter = lub_list__get_head(this->syms);
  66. iter; iter = lub_list_node__get_next(iter)) {
  67. sym = (clish_sym_t *)lub_list_node__get_data(iter);
  68. clish_sym_dump(sym);
  69. }
  70. lub_dump_undent();
  71. lub_dump_undent();
  72. }
  73. /*--------------------------------------------------------- */
  74. #endif /* DEBUG */