-
Notifications
You must be signed in to change notification settings - Fork 11
/
protify.awk
executable file
·46 lines (33 loc) · 1.06 KB
/
protify.awk
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
#!/bin/awk -f
#######################################################################
#
# Because of awk problems on the sgi, this file is converted to perl
# via 'a2p' to yield 'protify'. Do not edit the perl version!!!!
#
#######################################################################
BEGIN {
printf("\n");
printf("/****************************************************** \n");
printf(" * WARNING: This file automatically generated. * \n");
printf(" ****************************************************** \n");
printf(" */ \n");
printf("\n\n\n\n");
}
/[ \t]*extern/ { next }
/main\(/ { next }
/FORT_NAME/ {next}
# Ignore doctext comments
/\/\*[DMN@]/ { while (!match($0,/[DMN@]\*\//)) getline; next; }
/^[^ \t{}/*#].*[^ \t]+\(.*[^;]*$/ \
{
if ($1=="static")
next; #continue;
printf("extern %s",$0);
while (!match($0,"\)"))
{
getline;
gsub("\t"," ");
printf("\n %s",$0);
}
printf(";\n");
}