From: Andre Noll <maan@systemlinux.org>
Date: Tue, 16 Jul 2013 05:38:33 +0000 (+0200)
Subject: Move com_select_callback() closer to com_select().
X-Git-Tag: v0.4.13~7
X-Git-Url: https://git.tue.mpg.de/?a=commitdiff_plain;h=d2a4829af865fb5ad698dfda5796e74c2e4e9f76;p=paraslash.git

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.
---

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;