aboutsummaryrefslogtreecommitdiff
path: root/gprof/make-c-prog.awk
diff options
context:
space:
mode:
Diffstat (limited to 'gprof/make-c-prog.awk')
-rw-r--r--gprof/make-c-prog.awk29
1 files changed, 29 insertions, 0 deletions
diff --git a/gprof/make-c-prog.awk b/gprof/make-c-prog.awk
new file mode 100644
index 0000000..a0a49de
--- /dev/null
+++ b/gprof/make-c-prog.awk
@@ -0,0 +1,29 @@
+BEGIN {
+ FS="\"";
+ print "/* ==> Do not modify this file!! It is created automatically"
+ print " by make-c-prog.awk; modify make-c-prog.awk instead. <== */"
+ print ""
+ print "#include <stdio.h>"
+ }
+
+ {
+ if (curfun != FUNCTION)
+ {
+ if (curfun)
+ print "}"
+ curfun = FUNCTION
+ print ""
+ 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 "}"
+ }