From 168da2a5c6bcffe6ab20191b999dae3ba635ccd9 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 12 Nov 2017 02:47:33 +0100 Subject: [PATCH] plugin: Update list of available events for I/O plugins Signed-off-by: Joachim Nilsson --- src/plugin.c | 8 ++++++-- src/plugin.h | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 7782eba4..761999b2 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,6 @@ /* Plugin based services architecture for finit * - * Copyright (c) 2012 Joachim Nilsson + * Copyright (c) 2012-2017 Joachim Nilsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -194,7 +194,11 @@ void plugin_run_hooks(hook_point_t no) plugin_run_hook(no, NULL); } -/* Generic libev I/O callback, looks up correct plugin and calls its callback */ +/* + * Generic libev I/O callback, looks up correct plugin and calls its + * callback. libuEv might return UEV_ERROR in events, it is up to the + * plugin callback to handle this. + */ static void generic_io_cb(uev_t *w, void *arg, int events) { plugin_t *p = (plugin_t *)arg; diff --git a/src/plugin.h b/src/plugin.h index 0ec1c870..9f86bb7e 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -1,6 +1,6 @@ /* Plugin based services architecture for finit * - * Copyright (c) 2012 Joachim Nilsson + * Copyright (c) 2012-2017 Joachim Nilsson * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,8 +34,16 @@ #endif #define PLUGIN_DEP_MAX 10 + +/* + * Event flags for I/O plugins + */ +#define PLUGIN_IO_ERROR UEV_ERROR #define PLUGIN_IO_READ UEV_READ #define PLUGIN_IO_WRITE UEV_WRITE +#define PLUGIN_IO_PRI UEV_PRI +#define PLUGIN_IO_HUP UEV_HUP +#define PLUGIN_IO_RDHUP UEV_RDHUP #define PLUGIN_INIT(x) static void __attribute__ ((constructor)) x(void) #define PLUGIN_EXIT(x) static void __attribute__ ((destructor)) x(void)