From 1be27c35ea17fccd83c54e2acc66eb8c44d1a8fe Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 17 Oct 2016 09:50:30 +0300 Subject: [PATCH] lib-program-client: Whitespace fixes --- src/lib-program-client/program-client-local.c | 15 +++++--- .../program-client-private.h | 9 +++-- .../program-client-remote.c | 5 ++- src/lib-program-client/program-client.c | 34 +++++++++++++------ src/lib-program-client/program-client.h | 7 ++-- 5 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/lib-program-client/program-client-local.c b/src/lib-program-client/program-client-local.c index c5037139d9..253fe9a82a 100644 --- a/src/lib-program-client/program-client-local.c +++ b/src/lib-program-client/program-client-local.c @@ -38,14 +38,16 @@ struct program_client_local { }; static -void program_client_local_waitchild(const struct child_wait_status *, struct program_client_local *); +void program_client_local_waitchild(const struct child_wait_status *, + struct program_client_local *); static void program_client_local_disconnect(struct program_client *pclient, bool force); static void program_client_local_exited(struct program_client_local *slclient); static -void exec_child(const char *bin_path, const char *const *args, const char *const *envs, +void exec_child(const char *bin_path, const char *const *args, + const char *const *envs, int in_fd, int out_fd, int *extra_fds, bool drop_stderr) { ARRAY_TYPE(const_string) exec_args; @@ -155,7 +157,8 @@ void program_client_local_waitchild(const struct child_wait_status *status, static int program_client_local_connect(struct program_client *pclient) { - struct program_client_local *slclient = (struct program_client_local *) pclient; + struct program_client_local *slclient = + (struct program_client_local *)pclient; int fd_in[2] = { -1, -1 }, fd_out[2] = {-1, -1}; struct program_client_extra_fd *efds = NULL; int *parent_extra_fds = NULL, *child_extra_fds = NULL; @@ -280,8 +283,10 @@ int program_client_local_connect(struct program_client *pclient) program_client_init_streams(pclient); - slclient->child_wait = child_wait_new_with_pid(slclient->pid, program_client_local_waitchild, - slclient); + slclient->child_wait = + child_wait_new_with_pid(slclient->pid, + program_client_local_waitchild, + slclient); return program_client_connected(pclient); } diff --git a/src/lib-program-client/program-client-private.h b/src/lib-program-client/program-client-private.h index 8b4aad6ba0..dbf28f1151 100644 --- a/src/lib-program-client/program-client-private.h +++ b/src/lib-program-client/program-client-private.h @@ -65,14 +65,17 @@ struct program_client { bool output_dot_created:1; }; -void program_client_init(struct program_client *pclient, pool_t pool, const char *path, - const char *const *args, const struct program_client_settings *set); +void program_client_init(struct program_client *pclient, pool_t pool, + const char *path, + const char *const *args, + const struct program_client_settings *set); void program_client_init_streams(struct program_client *pclient); int program_client_connected(struct program_client *pclient); -void program_client_fail(struct program_client *pclient, enum program_client_error error); +void program_client_fail(struct program_client *pclient, + enum program_client_error error); void program_client_program_input(struct program_client *pclient); diff --git a/src/lib-program-client/program-client-remote.c b/src/lib-program-client/program-client-remote.c index 38dacc1175..54973cc170 100644 --- a/src/lib-program-client/program-client-remote.c +++ b/src/lib-program-client/program-client-remote.c @@ -23,8 +23,6 @@ PROGRAM_CLIENT_VERSION_MAJOR "\t" \ PROGRAM_CLIENT_VERSION_MINOR "\n" - - static void program_client_net_connect_again(struct program_client *pclient); @@ -224,7 +222,8 @@ void program_client_remote_connected(struct program_client *pclient) if (!slclient->noreply) { struct istream *is = pclient->program_input; pclient->program_input = - program_client_istream_create(pclient, pclient->program_input); + program_client_istream_create(pclient, + pclient->program_input); i_stream_unref(&is); } diff --git a/src/lib-program-client/program-client.c b/src/lib-program-client/program-client.c index 5afc30e2aa..4faf733f40 100644 --- a/src/lib-program-client/program-client.c +++ b/src/lib-program-client/program-client.c @@ -21,7 +21,8 @@ #define MAX_OUTPUT_MEMORY_BUFFER (1024*128) static -void program_client_callback(struct program_client *pclient, int result, void *context) +void program_client_callback(struct program_client *pclient, int result, void + *context) { program_client_callback_t *callback = pclient->callback; i_assert(pclient->callback != NULL); @@ -179,7 +180,8 @@ void program_client_disconnect(struct program_client *pclient, bool force) pclient->disconnect(pclient, force); } -void program_client_fail(struct program_client *pclient, enum program_client_error error) +void program_client_fail(struct program_client *pclient, + enum program_client_error error) { if (pclient->error != PROGRAM_CLIENT_ERROR_NONE) return; @@ -443,8 +445,10 @@ int program_client_connected(struct program_client *pclient) return ret; } -void program_client_init(struct program_client *pclient, pool_t pool, const char *path, - const char *const *args, const struct program_client_settings *set) +void program_client_init(struct program_client *pclient, pool_t pool, + const char *path, + const char *const *args, + const struct program_client_settings *set) { pclient->pool = pool; pclient->path = p_strdup(pool, path); @@ -456,7 +460,8 @@ void program_client_init(struct program_client *pclient, pool_t pool, const char pclient->fd_out = -1; } -void program_client_set_input(struct program_client *pclient, struct istream *input) +void program_client_set_input(struct program_client *pclient, + struct istream *input) { if (pclient->input != NULL) i_stream_unref(&pclient->input); @@ -465,7 +470,8 @@ void program_client_set_input(struct program_client *pclient, struct istream *in pclient->input = input; } -void program_client_set_output(struct program_client *pclient, struct ostream *output) +void program_client_set_output(struct program_client *pclient, + struct ostream *output) { if (pclient->output != NULL) o_stream_unref(&pclient->output); @@ -476,7 +482,8 @@ void program_client_set_output(struct program_client *pclient, struct ostream *o i_free(pclient->temp_prefix); } -void program_client_set_output_seekable(struct program_client *pclient, const char *temp_prefix) +void program_client_set_output_seekable(struct program_client *pclient, + const char *temp_prefix) { if (pclient->output != NULL) o_stream_unref(&pclient->output); @@ -496,7 +503,8 @@ struct istream *program_client_get_output_seekable(struct program_client *pclien #undef program_client_set_extra_fd void program_client_set_extra_fd(struct program_client *pclient, int fd, - program_client_fd_callback_t *callback, void *context) + program_client_fd_callback_t *callback, + void *context) { struct program_client_extra_fd *efds; struct program_client_extra_fd *efd = NULL; @@ -524,7 +532,8 @@ void program_client_set_extra_fd(struct program_client *pclient, int fd, efd->context = context; } -void program_client_set_env(struct program_client *pclient, const char *name, const char *value) +void program_client_set_env(struct program_client *pclient, const char *name, + const char *value) { const char *env; @@ -566,7 +575,8 @@ void program_client_init_streams(struct program_client *pclient) t_strdup_printf("program output fd=%d", efds[i].child_fd)); efds[i].io = io_add(efds[i].parent_fd, IO_READ, - program_client_extra_fd_input, &efds[i]); + program_client_extra_fd_input, + &efds[i]); } } } @@ -687,7 +697,9 @@ int program_client_run(struct program_client *pclient) } #undef program_client_run_async -void program_client_run_async(struct program_client *pclient, program_client_callback_t *callback, void *context) +void program_client_run_async(struct program_client *pclient, + program_client_callback_t *callback, + void *context) { int ret; diff --git a/src/lib-program-client/program-client.h b/src/lib-program-client/program-client.h index 40e42cbd0c..953d27281b 100644 --- a/src/lib-program-client/program-client.h +++ b/src/lib-program-client/program-client.h @@ -75,10 +75,11 @@ void program_client_set_env(struct program_client *pclient, /* Since script service cannot return system exit code, the exit value shall be -1, 0, or 1. -1 is internal error, 0 is failure and 1 is success */ int program_client_run(struct program_client *pclient); -void program_client_run_async(struct program_client *pclient, program_client_callback_t *, void*); +void program_client_run_async(struct program_client *pclient, + program_client_callback_t *, void*); #define program_client_run_async(pclient, callback, context) \ - program_client_run_async(pclient, (program_client_callback_t*)callback, (char*)context + \ - CALLBACK_TYPECHECK(callback, \ + program_client_run_async(pclient, (program_client_callback_t*)callback, \ + (char*)context + CALLBACK_TYPECHECK(callback, \ void (*)(int, typeof(context)))) #endif