freebsd-dev/contrib/gcc/sort-protos
Peter Wemm a4cd5630b0 Import of unmodified (but trimmed) gcc-2.7.2. The bigger parts of the
non-i386, non-unix, and generatable files have been trimmed, but can easily
be added in later if needed.

gcc-2.7.2.1 will follow shortly, it's a very small delta to this and it's
handy to have both available for reference for such little cost.

The freebsd-specific changes will then be committed, and once the dust has
settled, the bmakefiles will be committed to use this code.
1996-09-18 05:35:50 +00:00

10 lines
293 B
Bash
Executable File

#!/bin/sh
# Sort the sys-protos.h file in its usual order.
# Invoke as `sort-protos sys-protos.h'.
input=$1
sed 's/\(.*[ \*]\)\([a-zA-Z0-9_][a-zA-Z0-9_]*\)[ ]*\(([^\*].*\)$/\2%\1%\3/' $input | sort -u | awk -F% '{printf "%-30.30s%s%s\n", $2, $1, $3}' > tmp.$input
mv -f tmp.$input $input