diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/heimdal/lib/roken/roken.awk | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/lib/roken/roken.awk')
-rw-r--r-- | third_party/heimdal/lib/roken/roken.awk | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/third_party/heimdal/lib/roken/roken.awk b/third_party/heimdal/lib/roken/roken.awk new file mode 100644 index 0000000..47313c8 --- /dev/null +++ b/third_party/heimdal/lib/roken/roken.awk @@ -0,0 +1,46 @@ +# $Id$ + +BEGIN { + print "#include <config.h>" + print "#include <stdio.h>" + 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 "#ifdef HAVE_ERRNO_H" + print "#include <errno.h>" + print "#endif" + print "" + 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(\"\");" +} + +$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 "\");" +} + +END { + print "puts(\"\");" + print "puts(\"#endif /* __ROKEN_H__ */\");" + print "return 0;" + print "}" +} |