From 28dbd5551ee75e843019e6f067ed069daaabba0b Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Fri, 10 Jan 2014 16:25:14 +0100 Subject: Update the event callback Instead of using two void* arguments for all events, we now send one pointer to an alpm_event_t struct. This contains the type of event that was triggered. With this information, the pointer can then be typecasted to the event-specific struct in order to get additional arguments. Signed-off-by: Olivier Brunel Signed-off-by: Allan McRae --- lib/libalpm/util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 1bc208c6..d9f741b3 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -572,10 +572,14 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[]) } else { while(!feof(pipe_file)) { char line[PATH_MAX]; + alpm_event_scriptlet_info_t event = { + .type = ALPM_EVENT_SCRIPTLET_INFO, + .line = line + }; if(fgets(line, PATH_MAX, pipe_file) == NULL) break; alpm_logaction(handle, "ALPM-SCRIPTLET", "%s", line); - EVENT(handle, ALPM_EVENT_SCRIPTLET_INFO, line, NULL); + EVENT(handle, &event); } fclose(pipe_file); } -- cgit v1.2.3-24-g4f1b