The following commit has been merged in the master branch:
commit f5824f65b2e837fe65657b79c5695d8ab6b206a2
Author: Guillem Jover <[email protected]>
Date:   Mon Oct 12 21:25:22 2009 +0200

    libdpkg: Expand TKI_DEFINE macro for each user
    
    It makes it obvious what's going on, browser and search the source
    code.

diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 7e2d916..88e8c93 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -226,14 +226,6 @@ struct trigkindinfo {
        void (*interest_change)(const char *name, struct pkginfo *pkg, int 
signum);
 };
 
-#define TKI_DEFINE(kindname)                           \
-  static const struct trigkindinfo tki_##kindname= {   \
-    .activate_start = trk_##kindname##_activate_start,         \
-    .activate_awaiter = trk_##kindname##_activate_awaiter,     \
-    .activate_done = trk_##kindname##_activate_done,           \
-    .interest_change = trk_##kindname##_interest_change,       \
-  };
-
 static const struct trigkindinfo *dtki;
 
 /* As passed into activate_start. */
@@ -301,7 +293,12 @@ trk_unknown_interest_change(const char *trig, struct 
pkginfo *pkg, int signum)
               trig, pkg->name);
 }
 
-TKI_DEFINE(unknown);
+static const struct trigkindinfo tki_unknown = {
+       .activate_start = trk_unknown_activate_start,
+       .activate_awaiter = trk_unknown_activate_awaiter,
+       .activate_done = trk_unknown_activate_done,
+       .interest_change = trk_unknown_interest_change,
+};
 
 /*---------- explicit triggers ----------*/
 
@@ -412,7 +409,12 @@ trk_explicit_interest_change(const char *trig,  struct 
pkginfo *pkg, int signum)
                        trk_explicit_fn.buf);
 }
 
-TKI_DEFINE(explicit);
+static const struct trigkindinfo tki_explicit = {
+       .activate_start = trk_explicit_activate_start,
+       .activate_awaiter = trk_explicit_activate_awaiter,
+       .activate_done = trk_explicit_activate_done,
+       .interest_change = trk_explicit_interest_change,
+};
 
 /*---------- file triggers ----------*/
 
@@ -589,7 +591,12 @@ trk_file_activate_done(void)
 {
 }
 
-TKI_DEFINE(file);
+static const struct trigkindinfo tki_file = {
+       .activate_start = trk_file_activate_start,
+       .activate_awaiter = trk_file_activate_awaiter,
+       .activate_done = trk_file_activate_done,
+       .interest_change = trk_file_interest_change,
+};
 
 /*---------- trigger control info file ----------*/
 

-- 
dpkg's main repository


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

Reply via email to