1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/sh
rm -f commands.h
rm -f load_commands.h
ARGS="_command(const char *arg, struct session *ses) __attribute__((nonnull))"
while read FUNC
do
if [ -z "$FUNC" ]
then
continue
fi
case $FUNC in
\;*) ;;
\#*) echo "$FUNC" >>commands.h;echo "$FUNC">>load_commands.h
;;
\**) FUNC=`echo "$FUNC"|sed 's/^\*//'`
echo "extern struct session *$FUNC$ARGS;" >>commands.h
echo "add_c_command( \"$FUNC\", ${FUNC}_command);" >>load_commands.h
;;
*) echo "extern void $FUNC$ARGS;" >>commands.h
echo "add_command(\"$FUNC\", ${FUNC}_command);" >>load_commands.h
;;
esac
done
|