summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dpkg/triglib.c29
-rw-r--r--lib/dpkg/triglib.h13
-rw-r--r--src/trigproc.c10
3 files changed, 29 insertions, 23 deletions
diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c
index 2dacc81..658b1f5 100644
--- a/lib/dpkg/triglib.c
+++ b/lib/dpkg/triglib.c
@@ -577,22 +577,24 @@ trig_cicb_interest_change(const char *trig, struct pkginfo *pkg, int signum,
}
void
-trig_cicb_interest_delete(const char *trig, void *user, enum trig_options opts)
+trig_cicb_interest_delete(const char *trig, struct pkginfo *pkg,
+ enum trig_options opts)
{
- trig_cicb_interest_change(trig, user, -1, opts);
+ trig_cicb_interest_change(trig, pkg, -1, opts);
}
void
-trig_cicb_interest_add(const char *trig, void *user, enum trig_options opts)
+trig_cicb_interest_add(const char *trig, struct pkginfo *pkg,
+ enum trig_options opts)
{
- trig_cicb_interest_change(trig, user, +1, opts);
+ trig_cicb_interest_change(trig, pkg, +1, opts);
}
void
-trig_cicb_statuschange_activate(const char *trig, void *user,
+trig_cicb_statuschange_activate(const char *trig, struct pkginfo *pkg,
enum trig_options opts)
{
- struct pkginfo *aw = user;
+ struct pkginfo *aw = pkg;
trig_activate_start(trig);
dtki->activate_awaiter((opts == trig_noawait) ? NULL : aw);
@@ -601,7 +603,8 @@ trig_cicb_statuschange_activate(const char *trig, void *user,
static void
parse_ci_call(const char *file, const char *cmd, trig_parse_cicb *cb,
- const char *trig, void *user, enum trig_options opts)
+ const char *trig, struct pkginfo *pkg,
+ enum trig_options opts)
{
const char *emsg;
@@ -611,12 +614,12 @@ parse_ci_call(const char *file, const char *cmd, trig_parse_cicb *cb,
"syntax in trigger name `%.250s': %.250s"),
file, trig, emsg);
if (cb)
- cb(trig, user, opts);
+ cb(trig, pkg, opts);
}
void
trig_parse_ci(const char *file, trig_parse_cicb *interest,
- trig_parse_cicb *activate, void *user)
+ trig_parse_cicb *activate, struct pkginfo *pkg)
{
FILE *f;
char linebuf[MAXTRIGDIRECTIVE], *cmd, *spc, *eol;
@@ -646,13 +649,13 @@ trig_parse_ci(const char *file, trig_parse_cicb *interest,
while (cisspace(*spc))
spc++;
if (!strcmp(cmd, "interest")) {
- parse_ci_call(file, cmd, interest, spc, user, trig_await);
+ parse_ci_call(file, cmd, interest, spc, pkg, trig_await);
} else if (!strcmp(cmd, "interest-noawait")) {
- parse_ci_call(file, cmd, interest, spc, user, trig_noawait);
+ parse_ci_call(file, cmd, interest, spc, pkg, trig_noawait);
} else if (!strcmp(cmd, "activate")) {
- parse_ci_call(file, cmd, activate, spc, user, trig_await);
+ parse_ci_call(file, cmd, activate, spc, pkg, trig_await);
} else if (!strcmp(cmd, "activate-noawait")) {
- parse_ci_call(file, cmd, activate, spc, user, trig_noawait);
+ parse_ci_call(file, cmd, activate, spc, pkg, trig_noawait);
} else {
ohshit(_("triggers ci file contains unknown directive `%.250s'"),
cmd);
diff --git a/lib/dpkg/triglib.h b/lib/dpkg/triglib.h
index b870953..20399b2 100644
--- a/lib/dpkg/triglib.h
+++ b/lib/dpkg/triglib.h
@@ -94,13 +94,16 @@ 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, enum trig_options to);
-void trig_cicb_interest_delete(const char *trig, void *user, enum trig_options to);
-void trig_cicb_interest_add(const char *trig, void *user, enum trig_options to);
-void trig_cicb_statuschange_activate(const char *trig, void *user,
+typedef void trig_parse_cicb(const char *trig, struct pkginfo *pkg,
+ enum trig_options to);
+void trig_cicb_interest_delete(const char *trig, struct pkginfo *pkg,
+ enum trig_options to);
+void trig_cicb_interest_add(const char *trig, struct pkginfo *pkg,
+ enum trig_options to);
+void trig_cicb_statuschange_activate(const char *trig, struct pkginfo *pkg,
enum trig_options to);
void trig_parse_ci(const char *file, trig_parse_cicb *interest,
- trig_parse_cicb *activate, void *user);
+ trig_parse_cicb *activate, struct pkginfo *pkg);
void trig_incorporate(enum modstatdb_rw cstatus);
diff --git a/src/trigproc.c b/src/trigproc.c
index 42195ef..973cfb8 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -350,10 +350,10 @@ trigproc(struct pkginfo *pkg)
/*========== Transitional global activation. ==========*/
static void
-transitional_interest_callback_ro(const char *trig, void *user,
+transitional_interest_callback_ro(const char *trig, struct pkginfo *pkg,
enum trig_options opts)
{
- struct pkginfo *pend = user;
+ struct pkginfo *pend = pkg;
debug(dbg_triggersdetail,
"trig_transitional_interest_callback trig=%s pend=%s",
@@ -363,13 +363,13 @@ transitional_interest_callback_ro(const char *trig, void *user,
}
static void
-transitional_interest_callback(const char *trig, void *user,
+transitional_interest_callback(const char *trig, struct pkginfo *pkg,
enum trig_options opts)
{
- struct pkginfo *pend = user;
+ struct pkginfo *pend = pkg;
trig_cicb_interest_add(trig, pend, opts);
- transitional_interest_callback_ro(trig, user, opts);
+ transitional_interest_callback_ro(trig, pend, opts);
}
/*