Wrap the source code at 80 characters. Extract typedefs
"plugin_init_function" and "filter_init_function".
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2172516
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
server/internal.h | 7 +++++--
server/filters.c | 2 +-
server/main.c | 6 ++++--
server/plugins.c | 2 +-
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index 4b6e29154e10..2aff4cfff91d 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -508,14 +508,17 @@ extern int backend_cache (struct context *c,
__attribute__ ((__nonnull__ (1, 5)));
/* plugins.c */
+typedef struct nbdkit_plugin *(*plugin_init_function) (void);
extern struct backend *plugin_register (size_t index, const char *filename,
- void *dl, struct nbdkit_plugin *(*plugin_init)
(void))
+ void *dl,
+ plugin_init_function plugin_init)
__attribute__ ((__nonnull__ (2, 3, 4)));
/* filters.c */
+typedef struct nbdkit_filter *(*filter_init_function) (void);
extern struct backend *filter_register (struct backend *next, size_t index,
const char *filename, void *dl,
- struct nbdkit_filter *(*filter_init) (void))
+ filter_init_function filter_init)
__attribute__ ((__nonnull__ (1, 3, 4, 5)));
/* locks.c */
diff --git a/server/filters.c b/server/filters.c
index f32a9b46f6f2..b667754b217d 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -660,7 +660,7 @@ static struct backend filter_functions = {
/* Register and load a filter. */
struct backend *
filter_register (struct backend *next, size_t index, const char *filename,
- void *dl, struct nbdkit_filter *(*filter_init) (void))
+ void *dl, filter_init_function filter_init)
{
struct backend_filter *f;
const struct nbdkit_filter *filter;
diff --git a/server/main.c b/server/main.c
index 631401b72712..c3b9bf3848ac 100644
--- a/server/main.c
+++ b/server/main.c
@@ -79,8 +79,10 @@
#endif
static char *make_random_fifo (void);
-static struct backend *open_plugin_so (size_t i, const char *filename, int short_name);
-static struct backend *open_filter_so (struct backend *next, size_t i, const char
*filename, int short_name);
+static struct backend *open_plugin_so (size_t i, const char *filename,
+ int short_name);
+static struct backend *open_filter_so (struct backend *next, size_t i,
+ const char *filename, int short_name);
static void start_serving (void);
static void write_pidfile (void);
static bool is_config_key (const char *key, size_t len);
diff --git a/server/plugins.c b/server/plugins.c
index 1faac348045e..85eac76c45e7 100644
--- a/server/plugins.c
+++ b/server/plugins.c
@@ -908,7 +908,7 @@ static struct backend plugin_functions = {
/* Register and load a plugin. */
struct backend *
plugin_register (size_t index, const char *filename,
- void *dl, struct nbdkit_plugin *(*plugin_init) (void))
+ void *dl, plugin_init_function plugin_init)
{
struct backend_plugin *p;
const struct nbdkit_plugin *plugin;