Scripting and control environment for stage lighting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
645 B

#!/bin/sh
INFILE=$1
if [ "X${INFILE}" = "X" ]
then
echo "Usage: $0 abispec"
exit 1
fi
ABI=abi.c
HEADER=abi.lh
FNCOUNT=0
do_function()
{
echo " vm_intfn_${ARG1}," >>${ABI}
echo "fndefint ${ARG1} ${FNCOUNT};" >>${HEADER}
FNCOUNT=$((${FNCOUNT}+1))
}
cat <<EOF >${ABI}
/* abi.c */
/* autogenerated - do not edit */
#include "abi.h"
vm_intfn vm_intfn_table[] = {
EOF
cat <<EOF >${HEADER}
/* abi.lh */
/* autogenerated - do not edit */
EOF
while read TYPE ARG1 ARG2
do
case "$TYPE" in
function) do_function
;;
esac
done <${INFILE}
cat <<EOF >>${ABI}
};
const int vm_intfn_size = sizeof(vm_intfn_table) / sizeof(vm_intfn);
EOF