#!/usr/bin/perl

# Reads the hand-made text file with a list of all the variable
# names, constants (symbols in general) that should be prefixed
# with "sam_".  Creates a .sed file that makes these changes.

# To use:
# 	./setup_names_sed sam_sys_types.txt > types.sed
#	./update_types *.c *.h sys/*.h libkern/*.h
#
# where update_types =
#	for n in $*; do
#	    sed -f types.sed $n > temp1.txt
#	    cp temp1.txt $n
#	    done


while(<>) {
    @fields = split;
    if (scalar(@fields) && ($fields[0] !~ /#/)) {
	# line contains a symbol, so process it
	print "s/\\([][(){} 	*/><&+-]\\)\\(",$fields[0],
	      "\\)/\\1sam_",$fields[0],"/g\n";
    }
}

