1 # awk script to create summary.texinfo from the library texinfo files.
2 # Copyright (C) 1992-2013 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <http://www.gnu.org/licenses/>.
19 # This script recognizes sequences that look like:
22 # @def... ITEM | @item ITEM | @vindex ITEM
28 nameword
["@defmacx"]=
1
29 nameword
["@defspec"]=
1
30 nameword
["@defspecx"]=
1
32 nameword
["@defvarx"]=
1
34 nameword
["@defoptx"]=
1
41 nameword
["@deftypefun"]=
2
42 nameword
["@deftypefunx"]=
2
43 nameword
["@deftypevar"]=
2
44 nameword
["@deftypevarx"]=
2
45 nameword
["@deftypefn"]=
3
46 nameword
["@deftypefnx"]=
3
47 nameword
["@deftypevr"]=
3
48 nameword
["@deftypevrx"]=
3
50 firstword
["@defunx"]=
1
51 firstword
["@defmac"]=
1
52 firstword
["@defmacx"]=
1
53 firstword
["@defspec"]=
1
54 firstword
["@defspecx"]=
1
55 firstword
["@defvar"]=
1
56 firstword
["@defvarx"]=
1
57 firstword
["@defopt"]=
1
58 firstword
["@defoptx"]=
1
60 firstword
["@deffnx"]=
2
62 firstword
["@defvrx"]=
2
64 firstword
["@deftpx"]=
2
65 firstword
["@deftypefun"]=
1
66 firstword
["@deftypefunx"]=
1
67 firstword
["@deftypevar"]=
1
68 firstword
["@deftypevarx"]=
1
69 firstword
["@deftypefn"]=
2
70 firstword
["@deftypefnx"]=
2
71 firstword
["@deftypevr"]=
2
72 firstword
["@deftypevrx"]=
2
78 firstword
["@vindex"]=
1
80 print "@c DO NOT EDIT THIS FILE!"
81 print "@c This file is generated by summary.awk from the Texinfo sources."
84 $
1 ==
"@node" { node=$
2;
85 for (i =
3; i
<=
NF; ++i
)
86 { node=node
" " $i
; if ( $i ~
/,/ ) break; }
87 sub (/,[, ]*$
/, "", node
);
90 $
1 ==
"@comment" && $
2 ~
/\.h$
/ { header=
"@file{" $
2 "}";
91 for (i =
3; i
<=
NF; ++i
)
92 header=header
", @file{" $i
"}"
95 $
1 ==
"@comment" && $
2 ==
"(none)" { header =
-1; }
97 $
1 ==
"@comment" && header
!= 0 { std=$
2;
98 for (i=
3;i
<=
NF;++i
) std=std
" " $i
}
100 header
!= 0 && $
1 ~
/@def
|@item
|@vindex
/ \
101 { defn=
""; name=
""; curly=
0; n=
1;
102 for (i =
2; i
<=
NF; ++i
) {
103 if ($i ~
/^
{/ && $i !~
/}/) {
105 word=
substr ($i
, 2, length ($i
))
111 word=word
" " substr ($i
, 1, length ($i
) - 1)
115 # Handle a single word in braces.
116 else if ($i ~
/^
{.
*}$
/)
117 word=
substr ($i
, 2, length ($i
) - 2)
121 if (n
>= firstword
[$
1])
123 if (n == nameword
[$
1])
129 printf "@comment %s%c", name
, 12 # FF
130 printf "@item%s%c%c", defn
, 12, 12
131 if (header
!= -1) printf "%s ", header
;
132 printf "(%s): @ref{%s}.%c\n", std
, node
, 12;