From d2a4829af865fb5ad698dfda5796e74c2e4e9f76 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 16 Jul 2013 07:38:33 +0200 Subject: [PATCH] Move com_select_callback() closer to com_select(). It's considered good style to have the command handler and it's callback next to each other. No actual changes. --- afs.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/afs.c b/afs.c index 2f521291..c87fdf78 100644 --- a/afs.c +++ b/afs.c @@ -546,6 +546,31 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible) return 1; } +/** + * Result handler for sending data to the para_client process. + * + * \param result The data to be sent. + * \param band The band designator. + * \param private Pointer to the command context. + * + * \return The return value of the underlying call to \ref command.c::send_sb. + * + * \sa \ref callback_result_handler, \ref command.c::send_sb. + */ +int afs_cb_result_handler(struct osl_object *result, uint8_t band, + void *private) +{ + struct command_context *cc = private; + + assert(cc); + if (!result->size) + return 1; + if (cc->use_sideband) + return send_sb(&cc->scc, result->data, result->size, band, + true); + return sc_send_bin_buffer(&cc->scc, result->data, result->size); +} + static void com_select_callback(int fd, const struct osl_object *query) { struct para_buffer pb = { @@ -588,31 +613,6 @@ out: free(pb.buf); } -/** - * Result handler for sending data to the para_client process. - * - * \param result The data to be sent. - * \param band The band designator. - * \param private Pointer to the command context. - * - * \return The return value of the underlying call to \ref command.c::send_sb. - * - * \sa \ref callback_result_handler, \ref command.c::send_sb. - */ -int afs_cb_result_handler(struct osl_object *result, uint8_t band, - void *private) -{ - struct command_context *cc = private; - - assert(cc); - if (!result->size) - return 1; - if (cc->use_sideband) - return send_sb(&cc->scc, result->data, result->size, band, - true); - return sc_send_bin_buffer(&cc->scc, result->data, result->size); -} - int com_select(struct command_context *cc) { struct osl_object query; -- 2.39.5