wrapfile.awk
345 Bytes
BEGIN { string = FILENAME;
string = toupper(string);
gsub("\\\.","_",string);
print "#ifndef " string ;
print "#define " string ;
print "#ifdef __cplusplus" ;
print "extern \"C\" {" ;
print "#endif " ;
}
{
print $0
}
END {
print "#ifdef __cplusplus" ;
print "}" ;
print "#endif " ;
print "#endif /* " string " */";
}