1 # awk script to create summary.texinfo from the library texinfo files.
3 # Copyright (C) 1992, 1993 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public License
8 # as published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Library General Public License for more details.
16 # You should have received a copy of the GNU Library General Public
17 # License along with the GNU C Library; see the file COPYING.LIB. If
18 # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 # Cambridge, MA 02139, USA.
21 # This script recognizes sequences that look like:
24 # @def... ITEM | @item ITEM | @vindex ITEM
29 nameword
["@defspec"]=
1
35 nameword
["@deftypefun"]=
2
36 nameword
["@deftypevar"]=
2
37 nameword
["@deftypefn"]=
3
38 nameword
["@deftypevr"]=
3
40 firstword
["@defmac"]=
1
41 firstword
["@defspec"]=
1
42 firstword
["@defvar"]=
1
43 firstword
["@defopt"]=
1
47 firstword
["@deftypefun"]=
1
48 firstword
["@deftypevar"]=
1
49 firstword
["@deftypefn"]=
2
50 firstword
["@deftypevr"]=
2
56 firstword
["@vindex"]=
1
58 print "@c DO NOT EDIT THIS FILE!"
59 print "@c This file is generated by summary.awk from the Texinfo sources."
62 $
1 ==
"@node" { node=$
2;
63 for (i =
3; i
<=
NF; ++i
)
64 { node=node
" " $i
; if ( $i ~
/,/ ) break; }
67 $
1 ==
"@comment" && $
2 ~
/\.h$
/ { header=
"@file{" $
2 "}";
68 for (i =
3; i
<=
NF; ++i
)
69 header=header
", @file{" $i
"}"
72 $
1 ==
"@comment" && $
2 ==
"(none)" { header =
-1; }
74 $
1 ==
"@comment" && header
!= 0 { std=$
2;
75 for (i=
3;i
<=
NF;++i
) std=std
" " $i
}
77 header
!= 0 && $
1 ~
/@def
|@item
|@vindex
/ \
78 { defn=
""; name=
""; curly=
0; n=
1;
79 for (i =
2; i
<=
NF; ++i
) {
80 if ($i ~
/^
{/ && $i !~
/}/) {
82 word=
substr ($i
, 2, length ($i
))
88 word=word
" " substr ($i
, 1, length ($i
) - 1)
92 # Handle a single word in braces.
93 else if ($i ~
/^
{.
*}$
/)
94 word=
substr ($i
, 2, length ($i
) - 2)
98 if (n
>= firstword
[$
1])
100 if (n == nameword
[$
1])
106 printf "@comment %s%c", name
, 012 # FF
107 printf "@item%s%c%c", defn
, 012, 012
108 if (header
!= -1) printf "%s ", header
;
109 printf "(%s): @ref{%s}.%c\n", std
, node
, 012;