summaryrefslogtreecommitdiff
path: root/manual/xtract-typefun.awk
blob: 2f0bbc748e4b981b532f1e5c8db52506be56fd2c (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
#! /usr/local/bin/gawk -f
BEGIN {
  last_node="";
}

/^@node/ {
  last_node = gensub (/@node +([^@,]+).*/, "\\1", 1);
}

/^@deftypefun/ {
  printf ("* %s: (libc)%s.\n",
	  gensub (/@deftypefunx? +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]*).*/, "\\2", 1),
    last_node);
}

/^@deftypevr/ {
  printf ("* %s: (libc)%s.\n",
	  gensub (/@deftypevrx? +([^{ ]+|\{[^}]+\}) +([^{ ]+|\{[^}]+\}) +([[:alpha:]_][[:alnum:]_]*).*/, "\\3", 1),
    last_node);
}

/^@deftypefn/ {
  printf ("* %s: (libc)%s.\n",
	  gensub (/@deftypefnx? +([^{ ]+|\{[^}]+\}) +[^{ ]*(\{[^}]+\})? +([[:alpha:]_][[:alnum:]_]*).*/, "\\3", 1),
    last_node);
}