blob: d71df53ddfcff9383a5c37b4430abf90b7130558 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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"
}
|