summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/roken/roken.awk
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/roken/roken.awk')
-rw-r--r--crypto/heimdal/lib/roken/roken.awk35
1 files changed, 35 insertions, 0 deletions
diff --git a/crypto/heimdal/lib/roken/roken.awk b/crypto/heimdal/lib/roken/roken.awk
new file mode 100644
index 0000000..626fae5
--- /dev/null
+++ b/crypto/heimdal/lib/roken/roken.awk
@@ -0,0 +1,35 @@
+BEGIN {
+ print "#include <stdio.h>"
+ print "#ifdef HAVE_CONFIG_H"
+ print "#include <config.h>"
+ print "#endif"
+ print ""
+ print "int main()"
+ print "{"
+ print "puts(\"/* This is an OS dependent, generated file */\");"
+ print "puts(\"\\n\");"
+ print "puts(\"#ifndef __ROKEN_H__\");"
+ print "puts(\"#define __ROKEN_H__\");"
+ print "puts(\"\");"
+}
+END {
+ print "puts(\"#endif /* __ROKEN_H__ */\");"
+ print "exit(0);"
+ print "}"
+}
+
+$1 == "\#ifdef" || $1 == "\#ifndef" || $1 == "\#if" || $1 == "\#else" || $1 == "\#elif" || $1 == "\#endif" || $1 == "#ifdef" || $1 == "#ifndef" || $1 == "#if" || $1 == "#else" || $1 == "#elif" || $1 == "#endif" {
+ print $0;
+ next
+}
+
+{
+ s = ""
+ for(i = 1; i <= length; i++){
+ x = substr($0, i, 1)
+ if(x == "\"" || x == "\\")
+ s = s "\\";
+ s = s x;
+ }
+ print "puts(\"" s "\");"
+}
OpenPOWER on IntegriCloud