1998-10-19 Roland McGrath <roland@baalperazim.frob.com>
[glibc.git] / manual / xtract-typefun.awk
blob3fccd8000ee42f615e0587e528de88b553848685
1 #! /usr/local/bin/gawk -f
2 BEGIN {
3 last_node="";
6 /^@node/ {
7 name = $0;
8 sub(/^@node +/, "", name);
9 sub(/[@,].*$/, "", name);
10 last_node = name;
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)
20 if($check ~ /{/) squig++;
21 if($check ~ /}/) squig--;
22 if(squig) id++;
23 check++;
26 printf ("* %s: (libc)%s.\n", $id, last_node);
29 /^@deftypefun/ {
30 # Likewise, except it's $3 theoretically.
31 id = 3; check = 2; squig = 0;
32 while(check < id)
34 if($check ~ /{/) squig++;
35 if($check ~ /}/) squig--;
36 if(squig) id++;
37 check++;
40 printf ("* %s: (libc)%s.\n", $id, last_node);