aboutsummaryrefslogtreecommitdiff
path: root/gprof/gen-c-prog.awk
blob: d91694072b4a0c9e5188da4c4f7b86aa5160f40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 "}" }