]>
Commit | Line | Data |
---|---|---|
48d0341c | 1 | #!/usr/local/bin/gawk -f |
ceb2d9aa UD |
2 | BEGIN { |
3 | last_node=""; | |
4 | } | |
5 | ||
6 | /^@node/ { | |
5aa8ff62 UD |
7 | name = $0; |
8 | sub(/^@node +/, "", name); | |
9 | sub(/[@,].*$/, "", name); | |
10 | last_node = name; | |
ceb2d9aa UD |
11 | } |
12 | ||
5aa8ff62 UD |
13 | /^@deftype(fn|vr)/ { |
14 | # The string we want is $4, except that if there were brace blocks | |
15 | # before that point then it gets shifted to the right, since awk | |
16 | # doesn't know from brace blocks. | |
17 | id = 4; check = 2; squig = 0; | |
18 | while(check < id) | |
19 | { | |
20 | if($check ~ /{/) squig++; | |
21 | if($check ~ /}/) squig--; | |
22 | if(squig) id++; | |
23 | check++; | |
24 | } | |
ceb2d9aa | 25 | |
2c9a1488 | 26 | gsub(/[(){}*]/, "", $id); |
5aa8ff62 | 27 | printf ("* %s: (libc)%s.\n", $id, last_node); |
ceb2d9aa UD |
28 | } |
29 | ||
5aa8ff62 UD |
30 | /^@deftypefun/ { |
31 | # Likewise, except it's $3 theoretically. | |
32 | id = 3; check = 2; squig = 0; | |
33 | while(check < id) | |
34 | { | |
35 | if($check ~ /{/) squig++; | |
36 | if($check ~ /}/) squig--; | |
37 | if(squig) id++; | |
38 | check++; | |
39 | } | |
40 | ||
2c9a1488 | 41 | gsub(/[(){}*]/, "", $id); |
5aa8ff62 | 42 | printf ("* %s: (libc)%s.\n", $id, last_node); |
ceb2d9aa | 43 | } |