# use cdiff.o to compute and display the syntactic differences between two # C programs # # cdiff.o returns values as follows: # 0 -- the two files are syntactically identical # 1 -- something is wrong (e.g. parsing errors, files cannot be # opened, etc.) # 2 -- the two files are syntactically different # # if the value 2 is returned, open two new windows and use "less" to display # the differences if ($#argv < 2) then echo "usage: cdiff " exit endif cdiff.o $1 $2 set s = $status switch ($s) case '0': echo "no differences" breaksw case '2': echo "programs are different" xterm -geom 60x69+10+0 -T $1 -font 8x13 -e less -f -r out12 & xterm -geom 60x69+510+0 -T $2 -font 8x13 -e less -f -r out21 & breaksw endsw