--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
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()
{
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
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
done
}
+read_header
arg="$1"
shift
case "$arg" in