2 * libdpkg - Debian packaging suite library routines
3 * trigdeferred.h - parsing of triggers/Deferred
5 * Copyright © 2007 Canonical, Ltd.
6 * written by Ian Jackson <ijackson@chiark.greenend.org.uk>
7 * Copyright © 2008-2014 Guillem Jover <guillem@debian.org>
9 * This is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 #ifndef LIBDPKG_TRIGDEFERRED_H
24 #define LIBDPKG_TRIGDEFERRED_H
26 #include <dpkg/macros.h>
31 * @defgroup trigdeferred Trigger deferred file handling
32 * @ingroup dpkg-internal
36 enum trigdef_update_flags {
37 TDUF_NO_LOCK_OK = DPKG_BIT(0),
38 TDUF_WRITE = DPKG_BIT(1),
39 TDUF_NO_LOCK = TDUF_NO_LOCK_OK | TDUF_WRITE,
40 /** Should not be set unless TDUF_WRITE is. */
41 TDUF_WRITE_IF_EMPTY = DPKG_BIT(3),
42 TDUF_WRITE_IF_ENOENT = DPKG_BIT(4),
45 enum trigdef_update_status {
46 TDUS_ERROR_NO_DIR = -1,
47 TDUS_ERROR_EMPTY_DEFERRED = -2,
48 TDUS_ERROR_NO_DEFERRED = -3,
54 void (*trig_begin)(const char *trig);
55 void (*package)(const char *awname);
56 void (*trig_end)(void);
59 void trigdef_set_methods(const struct trigdefmeths *methods);
61 enum trigdef_update_status trigdef_update_start(enum trigdef_update_flags uf);
62 void trigdef_update_printf(const char *format, ...) DPKG_ATTR_PRINTF(1);
63 int trigdef_parse(void);
64 void trigdef_process_done(void);
70 #endif /* LIBDPKG_TRIGDEFERRED_H */