1*1b8adde7SWilliam Kucharski#! /bin/sh 2*1b8adde7SWilliam Kucharski# 3*1b8adde7SWilliam Kucharski# Convert a source file to a TeXinfo file. Stolen from glibc. 4*1b8adde7SWilliam Kucharski# 5*1b8adde7SWilliam Kucharski# Usage: src2texi SRCDIR SRC TEXI 6*1b8adde7SWilliam Kucharski 7*1b8adde7SWilliam Kucharskidir=$1 8*1b8adde7SWilliam Kucharskisrc=`basename $2` 9*1b8adde7SWilliam Kucharskitexi=`basename $3` 10*1b8adde7SWilliam Kucharski 11*1b8adde7SWilliam Kucharskised -e 's,[{}],@&,g' \ 12*1b8adde7SWilliam Kucharski -e 's,/\*\(@.*\)\*/,\1,g' \ 13*1b8adde7SWilliam Kucharski -e 's,/\* *,/* @r{,g' -e 's, *\*/,} */,' \ 14*1b8adde7SWilliam Kucharski -e 's/\(@[a-z][a-z]*\)@{\([^}]*\)@}/\1{\2}/g' \ 15*1b8adde7SWilliam Kucharski ${dir}/${src} | expand > ${texi}.new 16*1b8adde7SWilliam Kucharskimv -f ${texi}.new ${dir}/${texi} 17