]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Move com_select_callback() closer to com_select().
authorAndre Noll <maan@systemlinux.org>
Tue, 16 Jul 2013 05:38:33 +0000 (07:38 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 21 Jul 2013 13:20:22 +0000 (15:20 +0200)
It's considered good style to have the command handler and it's
callback next to each other. No actual changes.

afs.c

diff --git a/afs.c b/afs.c
index 2f521291096eeb3703c9f091ebb739060e68bb6e..c87fdf78fb9bf60d413503f557cac34573b50edf 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -546,6 +546,31 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible)
        return 1;
 }
 
        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 = {
 static void com_select_callback(int fd, const struct osl_object *query)
 {
        struct para_buffer pb = {
@@ -588,31 +613,6 @@ out:
        free(pb.buf);
 }
 
        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;
 int com_select(struct command_context *cc)
 {
        struct osl_object query;