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