query_dump.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifdef DEBUG
  2. #include "private.h"
  3. #include "lub/dump.h"
  4. /*-------------------------------------------------------- */
  5. void konf_query_dump(konf_query_t *this)
  6. {
  7. const char *op;
  8. lub_dump_printf("query(%p)\n", this);
  9. lub_dump_indent();
  10. switch (this->op) {
  11. case KONF_QUERY_OP_SET:
  12. op = "SET";
  13. break;
  14. case KONF_QUERY_OP_UNSET:
  15. op = "UNSET";
  16. break;
  17. case KONF_QUERY_OP_DUMP:
  18. op = "DUMP";
  19. break;
  20. case KONF_QUERY_OP_OK:
  21. op = "OK";
  22. break;
  23. case KONF_QUERY_OP_ERROR:
  24. op = "ERROR";
  25. break;
  26. case KONF_QUERY_OP_STREAM:
  27. op = "STREAM";
  28. break;
  29. default:
  30. op = "UNKNOWN";
  31. break;
  32. }
  33. lub_dump_printf("operation : %s\n", op);
  34. lub_dump_printf("pattern : %s\n", this->pattern);
  35. lub_dump_printf("priority : 0x%x\n", this->priority);
  36. lub_dump_printf("sequence : %u\n", this->seq ? "true" : "false");
  37. lub_dump_printf("seq_num : %u\n", this->seq_num);
  38. lub_dump_printf("line : %s\n", this->line);
  39. lub_dump_printf("path : %s\n", this->path);
  40. lub_dump_printf("pwdc : %u\n", this->pwdc);
  41. lub_dump_printf("splitter : %s\n", this->splitter ? "true" : "false");
  42. lub_dump_printf("unique : %s\n", this->unique ? "true" : "false");
  43. lub_dump_printf("depth : %d\n", this->depth);
  44. lub_dump_undent();
  45. }
  46. #endif /* DEBUG */