#!/bin/sh # Most of the library files come in virtually unchanged. # Rather than maintain the few changes by hand, we keep a set # of ed scripts that we can run on the originals to produce # the versions we need. # # Note that the headers are in ../a autofiles=" /sys/src/libdraw/arith.c /sys/src/libdraw/bytesperline.c /sys/src/libdraw/chan.c /sys/src/libdraw/computil.c /sys/src/libdraw/defont.c /sys/src/libdraw/drawrepl.c /sys/src/libdraw/fmt.c /sys/src/libdraw/icossin.c /sys/src/libdraw/icossin2.c /sys/src/libdraw/rectclip.c /sys/src/libdraw/rgb.c " case "$#" in 0) ;; *) autofiles="$*" esac plan9=/home/rsc/plan9/4e for f in $autofiles do ed=`echo $f | sed 's;.*/;;; s;\.[ch]$;;; s;$;.ed;'` out=`echo $f | sed 's;.*/;;;'` echo $f '->' $out test -f $out && chmod +w $out ( echo ',s;"../port/;";g' echo ',s;#include.*<;#include ";g' echo ',s;#include.*>;&FIXINCLUDEME;g' echo ',s;>FIXINCLUDEME;";g' echo ',s;"libc.h";"lib.h";g' echo 'g/#pragma/d' test -f $ed && cat $ed echo w $out echo q ) | ed $plan9/$f 2>&1 | egrep -v '^[0-9?]+$' chmod -w $out done