binutils-gdb/gprof/gen-c-prog.awk
Ben Elliston 3e8f6abf1e * alpha.c, basic_blocks.c, basic_blocks.h, bb_exit_func.c,
call_graph.c, call_graph.h, cg_arcs.c, cg_arcs.h, cg_dfn.c,
	cg_dfn.h, cg_print.c, cg_print.h, corefile.c, corefile.h,
	gmon_io.c, gmon_io.h, gprof.c, gprof.h, hertz.h, hist.c, hist.h,
	i386.c, mips.c, search_list.c, search_list.h, source.c, source.h,
	sparc.c, sym_ids.c, sym_ids.h, symtab.c, symtab.h, tahoe.c,
	utils.c, utils.h, vax.c, gen-c-prog.awk: Convert K&R C to ANSI C.
2004-05-26 04:55:55 +00:00

29 lines
648 B
Awk

NR == 1 {
FS="\"";
print "/* ==> Do not modify this file!! It is created automatically"
printf " from %s using the gen-c-prog.awk script. <== */\n\n", FILE
print "#include <stdio.h>"
print "#include \"ansidecl.h\""
}
{
if (curfun != FUNCTION)
{
if (curfun)
print "}"
curfun = FUNCTION
print ""
print "void ", FUNCTION, "(FILE *);"
print "void";
printf "%s (file)\n", FUNCTION
print " FILE *file;";
print "{";
}
printf " fputs (\"";
for (i = 1; i < NF; i++)
printf "%s\\\"", $i;
printf "%s\\n\", file);\n", $NF;
}
END { print "}" }