]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
move header include info from Makefile.in to *.cmd
authorAndre <maan@meins.(none)>
Sun, 21 Jan 2007 18:51:33 +0000 (19:51 +0100)
committerAndre <maan@meins.(none)>
Sun, 21 Jan 2007 18:51:33 +0000 (19:51 +0100)
Makefile.in
audiod.cmd
command_util.sh
mysql_selector.cmd
playlist_selector.cmd
random_selector.cmd
server.cmd

index 2a803f3bcd217f5cbac2780fc3ab1f8be4426b85..bb0488082d4d3a0d4b328aa7fb0d38c22f6ce8c3 100644 (file)
@@ -149,60 +149,28 @@ grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
                --set-version="$V"  < $<
 
 server_command_list.c: server.cmd server_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "server_command_list.h"' >> $@
-       echo 'struct server_command cmd_struct[] = {' >>$@
        ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
 server_command_list.h: server.cmd
-       echo 'extern struct server_command cmd_struct[];' > $@
        ./command_util.sh proto < $< >> $@
 
 mysql_selector_command_list.c: mysql_selector.cmd mysql_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "mysql_selector_command_list.h"' >> $@
-       echo 'struct server_command cmds[] = {' >>$@
        ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
 mysql_selector_command_list.h: mysql_selector.cmd
-       echo 'extern struct server_command cmds[];' > $@
        ./command_util.sh proto < $< >> $@
 
 random_selector_command_list.c: random_selector.cmd random_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "random_selector_command_list.h"' >> $@
-       echo 'struct server_command random_selector_cmds[] = {' >>$@
        ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
 random_selector_command_list.h: random_selector.cmd
-       echo 'extern struct server_command random_selector_cmds[];' > $@
        ./command_util.sh proto < $< >> $@
 
 playlist_selector_command_list.c: playlist_selector.cmd playlist_selector_command_list.h
-       echo '#include "server.h"' > $@
-       echo '#include "user_list.h"' >> $@
-       echo '#include "playlist_selector_command_list.h"' >> $@
-       echo 'struct server_command playlist_selector_cmds[] = {' >>$@
        ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
 playlist_selector_command_list.h: playlist_selector.cmd
-       echo 'extern struct server_command playlist_selector_cmds[];' > $@
        ./command_util.sh proto < $< >> $@
 
 audiod_command_list.c: audiod.cmd audiod_command_list.h
-       echo '#include "list.h"' > $@
-       echo '#include "para.h"' >> $@
-       echo '#include "sched.h"' >> $@
-       echo '#include "audiod.h"' >> $@
-       echo '#include "audiod_command_list.h"' >> $@
-       echo 'struct audiod_command cmds[] = {' >>$@
        ./command_util.sh array < $< >>$@
-       echo '{.name = NULL}};' >> $@
 audiod_command_list.h: audiod.cmd
-       echo 'extern struct audiod_command cmds[];' > $@
        ./command_util.sh proto < $< >> $@
 
 ortp_recv.o: ortp_recv.c
index a5f9efdb335640e0daae2c059654f979fb98980e..4b03b91c086e76fb0ba03a564fd3e065e930db19 100644 (file)
@@ -1,3 +1,10 @@
+FN: audiod_command_list
+HC: prototypes for the audiod command handlers
+CC: array of audiod commands
+AT: audiod_command
+AN: cmds
+IN: list para sched audiod
+---
 N: cycle
 D: switch to next mode
 S: cycle
index ea952e5b1283589d16bff19717ba39b20964648c..b757b2e0d29741097e649aeca38bd889b7541e70 100755 (executable)
@@ -20,6 +20,46 @@ dump_array_member()
        echo '},'
 }
 
+read_header()
+{
+       local key value i
+
+       while read key value; do
+               case "$key" in
+               ---)
+                       break
+                       ;;
+               HC:)
+                       header_comment="$value"
+                       ;;
+               CC:)
+                       c_file_comment="$value"
+                       ;;
+               FN:)
+                       file_name="$value"
+                       ;;
+               AT:)
+                       array_type="$value"
+                       ;;
+               AN:)
+                       array_name="$value"
+                       ;;
+               IN:)
+                       for i in $value; do
+                               includes="$includes
+#include \"$i.h\""
+                       done
+                       includes="$includes
+#include \"$file_name.h\""
+                       ;;
+               esac
+       done
+       if test -z "$header_comment" -o -z "$c_file_comment" \
+                       -o -z "$file_name"; then
+               echo "header error" 1&>2
+               exit 1
+       fi
+}
 
 read_one_command()
 {
@@ -140,6 +180,9 @@ com_man()
 
 com_array()
 {
+       echo "/** \file $file_name.c $c_file_comment */"
+       echo "$includes"
+       echo "struct $array_type $array_name[] = {"
        while : ; do
                read_one_command
                if test $ret -lt 0; then
@@ -150,19 +193,39 @@ com_array()
                fi
                dump_array_member
        done
+       echo '{.name = NULL}};'
 }
 
 dump_proto()
 {
+       echo '/**'
+       echo " * $desc_txt"
+       echo ' *'
+       echo ' * \param fd the file descriptor to send output to'
+       if test $line_handler -eq 0; then
+               echo ' * \param argc the number of arguments'
+               echo ' * \param argv the argument vector'
+       else
+               echo ' * \param cmdline the full command line'
+       fi
+       echo ' * '
+       echo " * synopsis: $syn_txt"
+       echo ' * '
+       echo "$help_txt" | sed -e 's/^/ * /g'
+       echo ' */'
        if test $line_handler -eq 0; then
-               echo "int com_$name_txt(int, int, char **);"
+               echo "int com_$name_txt(int fd, int argc, char **argv);"
        else
-               echo "int com_$name_txt(int, char *);"
+               echo "int com_$name_txt(int fd, char *cmdline);"
        fi
+       echo
 }
 
 com_proto()
 {
+       echo "/** \file $file_name.h $header_comment */"
+       echo
+       echo "extern struct $array_type $array_name[];"
        while : ; do
                read_one_command
                if test $ret -lt 0; then
@@ -175,6 +238,7 @@ com_proto()
        done
 }
 
+read_header
 arg="$1"
 shift
 case "$arg" in
index 84297d5482ceb7d935db5324f770d8f1c75955ab..9cee6b5dbeabfa27e7ad10e20d9cb8e85cd7a90f 100644 (file)
@@ -1,3 +1,10 @@
+FN: mysql_selector_command_list
+HC: prototypes for the commands of the mysql audio file selector
+CC: array of commands for the mysql audio file selector
+AT: server_command
+AN: cmds
+IN: server user_list
+---
 N: cam
 P: DB_READ | DB_WRITE
 D: copy all metadata
index 9f073a514cc58afe7369524db85c581210dbf61e..f7253810e902dfd924ee4d7f090709c7dca11945 100644 (file)
@@ -1,3 +1,10 @@
+FN: playlist_selector_command_list
+HC: prototypes for the commands of the playlist audio file selector
+CC: array of commands for the playlist audio file selector
+AT: server_command
+AN: playlist_selector_cmds
+IN: server user_list
+---
 N: ppl
 P: DB_READ
 D: print playlist
index 929c7eea153b9e0bbb687d00cf6f7c42811f6e1d..21dc14383230d24d3db2485f24fa29f965229ddf 100644 (file)
@@ -1,3 +1,10 @@
+FN: random_selector_command_list
+HC: prototypes for the commands of the random audio file selector
+CC: array of commands for the random audio file selector
+AT: server_command
+AN: random_selector_cmds
+IN: server user_list
+---
 N: random_info
 P: 0
 D: about the random audio file selector
index a7a1fb598617ae03e39cc8e77d41cdefe99fe718..3812088e5923d275d4b08b3d5522954d87e7f14c 100644 (file)
@@ -1,3 +1,10 @@
+FN: server_command_list
+HC: prototypes for the server command handlers
+CC: array of server commands
+AT: server_command
+AN: cmd_struct
+IN: server user_list
+---
 N: chs
 P: DB_READ | DB_WRITE
 D: change the current audio file selector