freebsd-dev/crypto/heimdal/lib/roken/roken.awk

44 lines
875 B
Awk
Raw Normal View History

2011-10-05 07:23:29 +00:00
# $Id$
2001-02-13 16:46:19 +00:00
BEGIN {
print "#include <config.h>"
print "#include <stdio.h>"
2011-10-05 07:23:29 +00:00
print "#ifdef HAVE_SYS_TYPES_H"
print "#include <sys/types.h>"
print "#endif"
print "#ifdef HAVE_SYS_SOCKET_H"
print "#include <sys/socket.h>"
print "#endif"
print ""
2003-10-09 19:36:20 +00:00
print "int main(int argc, char **argv)"
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(\"\");"
}
2008-05-07 13:39:42 +00:00
$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 "\");"
}
2001-06-21 02:12:07 +00:00
END {
print "puts(\"\");"
print "puts(\"#endif /* __ROKEN_H__ */\");"
print "return 0;"
print "}"
}