awesome/build-utils/widgetgen.sh
Julien Danjou f188c10fa4 util: precompute funcname in name_func_link
This will improve search a bit.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-12 16:51:41 +01:00

18 lines
486 B
Bash
Executable file

#!/bin/sh
top_srcdir="${1-.}"
echo "/* This file is autogenerated by" `basename $0` "*/"
echo
echo "const name_func_link_t WidgetList[] ="
echo "{"
for file in ${top_srcdir}/widget.h
do
echo " /* $file */"
grep '^widget_constructor_t ' "$file" | cut -d' ' -f2 | cut -d\; -f1 | while read widget
do
shortname=`echo $widget | cut -d_ -f2`
echo " {\"$shortname\", sizeof(\"$shortname\") - 1, $widget},"
done
done
echo " {NULL, 0, NULL}"
echo "};"