The following commit has been merged in the master branch:
commit 58a93c17fc4246d8f0281b21cd36112562d2c4f4
Author: Guillem Jover <[email protected]>
Date:   Sat Mar 13 08:20:02 2010 +0100

    libdpkg: Move triglib declarations to a new triglib.h

diff --git a/lib/dpkg/Makefile.am b/lib/dpkg/Makefile.am
index 69c7e70..e55e060 100644
--- a/lib/dpkg/Makefile.am
+++ b/lib/dpkg/Makefile.am
@@ -81,4 +81,5 @@ pkginclude_HEADERS = \
        string.h \
        subproc.h \
        tarfn.h \
+       triglib.h \
        varbuf.h
diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c
index 7f288d8..aafb1b0 100644
--- a/lib/dpkg/dbmodify.c
+++ b/lib/dpkg/dbmodify.c
@@ -43,6 +43,7 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/file.h>
 #include <dpkg/dir.h>
+#include <dpkg/triglib.h>
 
 char *statusfile=NULL, *availablefile=NULL;
 
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 4a5ee0c..1dda088 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -245,76 +245,6 @@ void trigdef_update_printf(const char *format, ...) 
DPKG_ATTR_PRINTF(1);
 int trigdef_yylex(void);
 void trigdef_process_done(void);
 
-/*** hooks for more sophisticated processing in dpkg proper ***/
-
-/* We do things like this so we can get most of the trigger tracking
- * in dpkg-query, dselect, and so on, but avoid the transitional
- * processing and deferred trigproc queue management other than when
- * we're actually doing real package management work. */
-
-struct trigfileint {
-  struct pkginfo *pkg;
-  struct filenamenode *fnn;
-  struct trigfileint *samefile_next;
-  struct {
-    struct trigfileint *next, *back;
-  } inoverall;
-};
-
-struct trig_hooks {
- /* The first two are normally NULL.
-  * If non-NULL, we're dpkg proper and we might need to invent trigger
-  * activations as the first run of a triggers-supporting dpkg.
-  */
-  void (*enqueue_deferred)(struct pkginfo *pend);
-  void (*transitional_activate)(enum modstatdb_rw cstatus);
-
-  struct filenamenode *(*namenode_find)(const char *filename, int nonew);
-  struct trigfileint **(*namenode_interested)(struct filenamenode *fnn);
-
-  /* Returns a pointer from nfmalloc. */
-  const char *(*namenode_name)(struct filenamenode *fnn);
-};
-
-#define TRIGHOOKS_DEFINE_NAMENODE_ACCESSORS                             \
-  static struct trigfileint **th_nn_interested(struct filenamenode *fnn) \
-    { return &fnn->trig_interested; }                                   \
-  static const char *th_nn_name(struct filenamenode *fnn)               \
-    { return fnn->name; }
-
-void trig_override_hooks(const struct trig_hooks *hooks);
-
-/*** from triglib.c ***/
-
-char *trig_get_triggersdir(const char *admindir);
-
-void trig_file_activate_byname(const char *trig, struct pkginfo *aw);
-void trig_file_activate(struct filenamenode *trig, struct pkginfo *aw);
-
-int trig_note_pend_core(struct pkginfo *pend, const char *trig /*not 
copied!*/);
-int trig_note_pend(struct pkginfo *pend, const char *trig /*not copied!*/);
-int trig_note_aw(struct pkginfo *pend, struct pkginfo *aw);
-void trig_clear_awaiters(struct pkginfo *notpend);
-
-void trig_enqueue_awaited_pend(struct pkginfo *pend);
-void trig_fixup_awaiters(enum modstatdb_rw cstatus);
-
-void trig_file_interests_ensure(void);
-void trig_file_interests_save(void);
-
-void trig_cicb_interest_delete(const char *trig, void *user);
-void trig_cicb_interest_add(const char *trig, void *user);
-typedef void trig_parse_cicb(const char *trig, void *user);
-void trig_parse_ci(const char *file, trig_parse_cicb *interest,
-                   trig_parse_cicb *activate, void *user);
-
-/* Called by process_archive. */
-void trig_cicb_statuschange_activate(const char *trig, void *user);
-
-void trig_incorporate(enum modstatdb_rw cstatus, const char *admindir);
-
-const char *illegal_triggername(const char *p);
-
 /*** from database.c ***/
 
 struct pkginfo *findpackage(const char *name);
diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index c523785..f2b4635 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -31,6 +31,7 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/path.h>
 #include <dpkg/parsedump.h>
+#include <dpkg/triglib.h>
 
 static int
 convert_string(struct parsedb_state *ps, const char *what, int otherwise,
diff --git a/lib/dpkg/trigdeferred.l b/lib/dpkg/trigdeferred.l
index ee7d6d3..bcb44cd 100644
--- a/lib/dpkg/trigdeferred.l
+++ b/lib/dpkg/trigdeferred.l
@@ -45,6 +45,7 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/file.h>
 #include <dpkg/dir.h>
+#include <dpkg/triglib.h>
 
 #define YY_NO_INPUT
 
diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 5ce9a8d..5ad727b 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -36,6 +36,7 @@
 #include <dpkg/pkg-list.h>
 #include <dpkg/dlist.h>
 #include <dpkg/dir.h>
+#include <dpkg/triglib.h>
 
 const char *
 illegal_triggername(const char *p)
diff --git a/lib/dpkg/triglib.h b/lib/dpkg/triglib.h
new file mode 100644
index 0000000..3cc8229
--- /dev/null
+++ b/lib/dpkg/triglib.h
@@ -0,0 +1,99 @@
+/*
+ * libdpkg - Debian packaging suite library routines
+ * triglib.h - declarations for trigger handling
+ *
+ * Copyright © 2007 Canonical, Ltd.
+ *   written by Ian Jackson <[email protected]>
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBDPKG_TRIGLIB_H
+#define LIBDPKG_TRIGLIB_H
+
+#include <dpkg/macros.h>
+#include <dpkg/dpkg-db.h>
+
+DPKG_BEGIN_DECLS
+
+/*
+ * Hooks for more sophisticated processing in dpkg proper.
+ *
+ * We do things like this so we can get most of the trigger tracking
+ * in dpkg-query, dselect, and so on, but avoid the transitional
+ * processing and deferred trigproc queue management other than when
+ * we're actually doing real package management work.
+ */
+
+const char *illegal_triggername(const char *p);
+
+struct trigfileint {
+       struct pkginfo *pkg;
+       struct filenamenode *fnn;
+       struct trigfileint *samefile_next;
+       struct {
+               struct trigfileint *next, *back;
+       } inoverall;
+};
+
+/* The first two hooks are normally NULL.
+ * If non-NULL, we're dpkg proper and we might need to invent trigger
+ * activations as the first run of a triggers-supporting dpkg. */
+struct trig_hooks {
+       void (*enqueue_deferred)(struct pkginfo *pend);
+       void (*transitional_activate)(enum modstatdb_rw cstatus);
+
+       struct filenamenode *(*namenode_find)(const char *filename, int nonew);
+       struct trigfileint **(*namenode_interested)(struct filenamenode *fnn);
+
+       /* Returns a pointer from nfmalloc. */
+       const char *(*namenode_name)(struct filenamenode *fnn);
+};
+
+#define TRIGHOOKS_DEFINE_NAMENODE_ACCESSORS                             \
+  static struct trigfileint **th_nn_interested(struct filenamenode *fnn) \
+    { return &fnn->trig_interested; }                                   \
+  static const char *th_nn_name(struct filenamenode *fnn)               \
+    { return fnn->name; }
+
+void trig_override_hooks(const struct trig_hooks *hooks);
+
+char *trig_get_triggersdir(const char *admindir);
+
+void trig_file_activate_byname(const char *trig, struct pkginfo *aw);
+void trig_file_activate(struct filenamenode *trig, struct pkginfo *aw);
+
+int trig_note_pend_core(struct pkginfo *pend, const char *trig /*not 
copied!*/);
+int trig_note_pend(struct pkginfo *pend, const char *trig /*not copied!*/);
+int trig_note_aw(struct pkginfo *pend, struct pkginfo *aw);
+void trig_clear_awaiters(struct pkginfo *notpend);
+
+void trig_enqueue_awaited_pend(struct pkginfo *pend);
+void trig_fixup_awaiters(enum modstatdb_rw cstatus);
+
+void trig_file_interests_ensure(void);
+void trig_file_interests_save(void);
+
+typedef void trig_parse_cicb(const char *trig, void *user);
+void trig_cicb_interest_delete(const char *trig, void *user);
+void trig_cicb_interest_add(const char *trig, void *user);
+void trig_cicb_statuschange_activate(const char *trig, void *user);
+void trig_parse_ci(const char *file, trig_parse_cicb *interest,
+                   trig_parse_cicb *activate, void *user);
+
+void trig_incorporate(enum modstatdb_rw cstatus, const char *admindir);
+
+DPKG_END_DECLS
+
+#endif /* LIBDPKG_TRIGLIB_H */
diff --git a/src/archives.c b/src/archives.c
index ab10d19..1f3663f 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -48,6 +48,7 @@
 #include <dpkg/command.h>
 #include <dpkg/tarfn.h>
 #include <dpkg/myopt.h>
+#include <dpkg/triglib.h>
 
 #ifdef WITH_SELINUX
 #include <selinux/selinux.h>
diff --git a/src/configure.c b/src/configure.c
index 96080a5..0af95eb 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -45,6 +45,7 @@
 #include <dpkg/buffer.h>
 #include <dpkg/file.h>
 #include <dpkg/subproc.h>
+#include <dpkg/triglib.h>
 
 #include "filesdb.h"
 #include "main.h"
diff --git a/src/help.c b/src/help.c
index 2a13647..9d35b90 100644
--- a/src/help.c
+++ b/src/help.c
@@ -39,6 +39,7 @@
 #include <dpkg/path.h>
 #include <dpkg/subproc.h>
 #include <dpkg/command.h>
+#include <dpkg/triglib.h>
 
 #include "filesdb.h"
 #include "main.h"
diff --git a/src/processarc.c b/src/processarc.c
index 627bbd2..9a0fa15 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -46,6 +46,7 @@
 #include <dpkg/dir.h>
 #include <dpkg/tarfn.h>
 #include <dpkg/myopt.h>
+#include <dpkg/triglib.h>
 
 #include "filesdb.h"
 #include "main.h"
diff --git a/src/remove.c b/src/remove.c
index e68395f..6868db5 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -39,6 +39,7 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/dir.h>
 #include <dpkg/myopt.h>
+#include <dpkg/triglib.h>
 
 #include "filesdb.h"
 #include "main.h"
diff --git a/src/trigcmd.c b/src/trigcmd.c
index 7d7001e..15ee438 100644
--- a/src/trigcmd.c
+++ b/src/trigcmd.c
@@ -39,6 +39,7 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
 #include <dpkg/myopt.h>
+#include <dpkg/triglib.h>
 
 const char thisname[] = "dpkg-trigger";
 
diff --git a/src/trigproc.c b/src/trigproc.c
index 972fc9c..698e14b 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -32,6 +32,7 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/dpkg-db.h>
 #include <dpkg/pkg-queue.h>
+#include <dpkg/triglib.h>
 
 #include "main.h"
 #include "filesdb.h"

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to