From: Andre Noll <maan@tuebingen.mpg.de>
Date: Tue, 13 Jan 2015 23:49:52 +0000 (+0100)
Subject: audiod: Reduce scope of struct audiod_command.
X-Git-Tag: v0.5.5~21
X-Git-Url: https://git.tue.mpg.de/?a=commitdiff_plain;h=0806c6f0f2dc341deea1520034420ceadb116082;p=paraslash.git

audiod: Reduce scope of struct audiod_command.

This structure is only used in audiod_command.c, so move the
declaration from audiod.h to audiod_command.c.
---

diff --git a/audiod.h b/audiod.h
index 3b4b9bd0..b9cfb25e 100644
--- a/audiod.h
+++ b/audiod.h
@@ -22,26 +22,12 @@ extern const char *audio_formats[];
  */
 enum audiod_status_info {AUDIOD_OFF, AUDIOD_ON, AUDIOD_STANDBY};
 
-/** defines one command of para_audiod */
-struct audiod_command {
-	/** the name of the command */
-	const char *name;
-	/** pointer to the function that handles the command */
-	int (*handler)(int, int, char**);
-	/** one-line description of the command */
-	const char *description;
-	/** summary of the command line options */
-	const char *usage;
-	/** the long help text */
-	const char *help;
-};
-
-__malloc char *audiod_get_decoder_flags(void);
 extern struct audiod_args_info conf;
 extern int audiod_status;
 
 int handle_connect(int accept_fd, fd_set *rfds, uid_t *uid_whitelist);
 void audiod_status_dump(bool force);
+__malloc char *audiod_get_decoder_flags(void);
 char *get_time_string(void);
 struct btr_node *audiod_get_btr_root(void);
 
diff --git a/audiod_command.c b/audiod_command.c
index 98dba3b3..0fe2e5f0 100644
--- a/audiod_command.c
+++ b/audiod_command.c
@@ -16,6 +16,7 @@
 
 #include "para.h"
 #include "audiod.cmdline.h"
+#include "audiod.command_list.h"
 #include "list.h"
 #include "sched.h"
 #include "ggo.h"
@@ -30,11 +31,22 @@
 #include "write.h"
 #include "fd.h"
 #include "version.h"
-#include "audiod.command_list.h"
 
 extern struct sched sched;
 extern char *stat_item_values[NUM_STAT_ITEMS];
 
+/* Defines one command of para_audiod. */
+struct audiod_command {
+	const char *name;
+	/* Pointer to the function that handles the command. */
+	int (*handler)(int, int, char **);
+	/* One-line description. */
+	const char *description;
+	/* Summary of the command line options. */
+	const char *usage;
+	/* The long help text. */
+	const char *help;
+};
 
 static struct audiod_command audiod_cmds[] = {DEFINE_AUDIOD_CMD_ARRAY};
 
@@ -278,6 +290,7 @@ static int com_tasks(int fd, __a_unused int argc, __a_unused char **argv)
 {
 	char *tl = get_task_list(&sched);
 	int ret = 1;
+
 	if (tl)
 		ret = client_write(fd, tl);
 	free(tl);