diff options
Diffstat (limited to 'clientcomm/rpcif.h.awk_dec2')
-rw-r--r-- | clientcomm/rpcif.h.awk_dec2 | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/clientcomm/rpcif.h.awk_dec2 b/clientcomm/rpcif.h.awk_dec2 new file mode 100644 index 0000000..d71df53 --- /dev/null +++ b/clientcomm/rpcif.h.awk_dec2 @@ -0,0 +1,46 @@ +BEGIN { + print "#ifndef _RPCIF_H_RPCGEN"; + print "#define _RPCIF_H_RPCGEN"; + print "#include <rpc/rpc.h>"; + } +/\*rpc[^(]*/ { + if (FILENAME == "rpcif.h.tmp") + { + headerLine = $0; + startMethodName = index(headerLine, "*") + 1; + methodNameLength = length(headerLine) - 2 - startMethodName; + methodName = substr(headerLine, startMethodName, methodNameLength); + #print "method name " methodName; + startOfLine = substr(headerLine, 1, startMethodName - 1); + #print "start of line " startOfLine; + #print "method name to replace " methodNameToReplace; + startInMethod = index(theMethods, methodName); + methodIsFirst = substr(theMethods, startInMethod); + #print "methodIsFirst " methodIsFirst; + endInMethod = index(methodIsFirst, ":"); + endInMethod--; + methodIsOnly = substr(methodIsFirst, 1, endInMethod); + #print "methodIsOnly " methodIsOnly; + correctLine = startOfLine methodIsOnly ";"; + print correctLine; + next; + } + } +/^rpc[^(]*/ { + if (FILENAME != "rpcif.h.tmp") + { + theMethods = $0 ":" theMethods; + #print "theMethods " theMethods; + } + next; + } + { + if (FILENAME == "rpcif.h.tmp") + { + print $0; + } + } + +END { + print "#endif" + }
\ No newline at end of file |