debug.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * libdpkg - Debian packaging suite library routines
  3. * debug.h - debugging support
  4. *
  5. * Copyright © 2011 Guillem Jover <guillem@debian.orgian>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef LIBDPKG_DEBUG_H
  21. #define LIBDPKG_DEBUG_H
  22. #include <dpkg/macros.h>
  23. #include <stdbool.h>
  24. #include <stdio.h>
  25. DPKG_BEGIN_DECLS
  26. enum debugflags {
  27. dbg_general = 01,
  28. dbg_scripts = 02,
  29. dbg_eachfile = 010,
  30. dbg_eachfiledetail = 0100,
  31. dbg_conff = 020,
  32. dbg_conffdetail = 0200,
  33. dbg_depcon = 040,
  34. dbg_depcondetail = 0400,
  35. dbg_veryverbose = 01000,
  36. dbg_stupidlyverbose = 02000,
  37. dbg_triggers = 010000,
  38. dbg_triggersdetail = 020000,
  39. dbg_triggersstupid = 040000,
  40. };
  41. void debug_set_output(FILE *output);
  42. void debug_set_mask(int mask);
  43. bool debug_has_flag(int flag);
  44. void debug(int flag, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
  45. DPKG_END_DECLS
  46. #endif /* LIBDPKG_DEBUG_H */