dpkg 1.21.11
debug.h
Go to the documentation of this file.
1/*
2 * libdpkg - Debian packaging suite library routines
3 * debug.h - debugging support
4 *
5 * Copyright © 2011 Guillem Jover <guillem@debian.org>
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 <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef LIBDPKG_DEBUG_H
22#define LIBDPKG_DEBUG_H
23
24#include <dpkg/macros.h>
25
26#include <stdbool.h>
27#include <stdio.h>
28
30
37/*
38 * XXX: We do not use DPKG_BIT() here, because the octal values are part
39 * of the current output interface.
40 */
46 dbg_conff = 020,
52 dbg_triggers = 010000,
55};
56
57void dpkg_debug_init(void);
58void debug_set_output(FILE *output, const char *filename);
59void debug_set_mask(int mask);
60int debug_parse_mask(const char *str);
61bool debug_has_flag(int flag);
62void debug(int flag, const char *fmt, ...) DPKG_ATTR_PRINTF(2);
63
67
68#endif /* LIBDPKG_DEBUG_H */
bool debug_has_flag(int flag)
Check if a debugging flag is currently set on the debugging mask.
Definition: debug.c:91
void debug(int flag, const char *fmt,...) DPKG_ATTR_PRINTF(2)
Output a debugging message.
Definition: debug.c:103
void dpkg_debug_init(void)
Initialize the debugging support.
Definition: debug.c:121
void debug_set_mask(int mask)
Set the debugging mask.
Definition: debug.c:58
void debug_set_output(FILE *output, const char *filename)
Set the debugging output file.
Definition: debug.c:44
int debug_parse_mask(const char *str)
Parse the debugging mask.
Definition: debug.c:72
debugflags
Definition: debug.h:41
@ dbg_eachfiledetail
Definition: debug.h:45
@ dbg_depcondetail
Definition: debug.h:49
@ dbg_conff
Definition: debug.h:46
@ dbg_depcon
Definition: debug.h:48
@ dbg_scripts
Definition: debug.h:43
@ dbg_triggers
Definition: debug.h:52
@ dbg_stupidlyverbose
Definition: debug.h:51
@ dbg_triggersstupid
Definition: debug.h:54
@ dbg_eachfile
Definition: debug.h:44
@ dbg_triggersdetail
Definition: debug.h:53
@ dbg_veryverbose
Definition: debug.h:50
@ dbg_general
Definition: debug.h:42
@ dbg_conffdetail
Definition: debug.h:47
#define DPKG_BEGIN_DECLS
Definition: macros.h:86
#define DPKG_ATTR_PRINTF(n)
Definition: macros.h:56
#define DPKG_END_DECLS
Definition: macros.h:87