2011-07-24 12:12:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
grep -h '^void ' $f|sed 's/^void //;s/(.*//'|while read a ; do
|
|
|
|
echo "void $a(void);"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
grep -h '^void ' $f|sed 's/^void //;s/(.*//'|while read a ; do
|
|
|
|
echo "const struct MENU_DEF menu_$a = {\"$a\", &$a};"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "const struct MENU_DEF menu_nop = {\"---\", NULL};"
|
|
|
|
echo
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
t=${f#*/}
|
|
|
|
t=${t%.c}
|
|
|
|
echo "static menuentry mentry_$t[] = {"
|
|
|
|
grep -h '^void ' $f|sed 's/^void //;s/(.*//'|while read a ; do
|
|
|
|
echo "&menu_$a,"
|
|
|
|
done
|
|
|
|
echo "NULL"
|
|
|
|
echo "};"
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
t=${f#*/}
|
|
|
|
t=${t%.c}
|
|
|
|
echo "static const struct MENU m_$t = {\"$t\", mentry_$t};"
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
t=${f#*/}
|
|
|
|
t=${t%.c}
|
|
|
|
echo "void run_$t(void) {"
|
|
|
|
echo "handleMenu(&m_$t);"
|
|
|
|
echo "};"
|
|
|
|
done
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
t=${f#*/}
|
|
|
|
t=${t%.c}
|
|
|
|
echo "const struct MENU_DEF menu_$t = {\"$t\", &run_$t};"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "static menuentry mentry[] = {"
|
|
|
|
|
|
|
|
for f in $* ; do
|
|
|
|
t=${f#*/}
|
|
|
|
t=${t%.c}
|
|
|
|
echo "&menu_$t,"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "NULL"
|
|
|
|
echo "};"
|
|
|
|
|
2011-07-25 23:18:31 +00:00
|
|
|
echo "inline void generated_tick(void){"
|
|
|
|
for f in $* ; do
|
|
|
|
grep -h '^void tick_' $f|sed 's/^void //;s/(.*//'|while read a ; do
|
|
|
|
echo "$a();"
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "return;"
|
|
|
|
echo "};"
|
|
|
|
|
2011-07-24 12:12:30 +00:00
|
|
|
|