1 # awk script to create summary.texinfo from the library texinfo files.
3 # Copyright (C) 1992, 1993, 1997 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 not,
18 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # This script recognizes sequences that look like:
24 # @def... ITEM | @item ITEM | @vindex ITEM
30 nameword
["@defmacx"]=
1
31 nameword
["@defspec"]=
1
32 nameword
["@defspecx"]=
1
34 nameword
["@defvarx"]=
1
36 nameword
["@defoptx"]=
1
43 nameword
["@deftypefun"]=
2
44 nameword
["@deftypefunx"]=
2
45 nameword
["@deftypevar"]=
2
46 nameword
["@deftypevarx"]=
2
47 nameword
["@deftypefn"]=
3
48 nameword
["@deftypefnx"]=
3
49 nameword
["@deftypevr"]=
3
50 nameword
["@deftypevrx"]=
3
52 firstword
["@defunx"]=
1
53 firstword
["@defmac"]=
1
54 firstword
["@defmacx"]=
1
55 firstword
["@defspec"]=
1
56 firstword
["@defspecx"]=
1
57 firstword
["@defvar"]=
1
58 firstword
["@defvarx"]=
1
59 firstword
["@defopt"]=
1
60 firstword
["@defoptx"]=
1
62 firstword
["@deffnx"]=
2
64 firstword
["@defvrx"]=
2
66 firstword
["@deftpx"]=
2
67 firstword
["@deftypefun"]=
1
68 firstword
["@deftypefunx"]=
1
69 firstword
["@deftypevar"]=
1
70 firstword
["@deftypevarx"]=
1
71 firstword
["@deftypefn"]=
2
72 firstword
["@deftypefnx"]=
2
73 firstword
["@deftypevr"]=
2
74 firstword
["@deftypevrx"]=
2
80 firstword
["@vindex"]=
1
82 print "@c DO NOT EDIT THIS FILE!"
83 print "@c This file is generated by summary.awk from the Texinfo sources."
86 $
1 ==
"@node" { node=$
2;
87 for (i =
3; i
<=
NF; ++i
)
88 { node=node
" " $i
; if ( $i ~
/,/ ) break; }
89 sub (/,[, ]*$
/, "", node
);
92 $
1 ==
"@comment" && $
2 ~
/\.h$
/ { header=
"@file{" $
2 "}";
93 for (i =
3; i
<=
NF; ++i
)
94 header=header
", @file{" $i
"}"
97 $
1 ==
"@comment" && $
2 ==
"(none)" { header =
-1; }
99 $
1 ==
"@comment" && header
!= 0 { std=$
2;
100 for (i=
3;i
<=
NF;++i
) std=std
" " $i
}
102 header
!= 0 && $
1 ~
/@def
|@item
|@vindex
/ \
103 { defn=
""; name=
""; curly=
0; n=
1;
104 for (i =
2; i
<=
NF; ++i
) {
105 if ($i ~
/^
{/ && $i !~
/}/) {
107 word=
substr ($i
, 2, length ($i
))
113 word=word
" " substr ($i
, 1, length ($i
) - 1)
117 # Handle a single word in braces.
118 else if ($i ~
/^
{.
*}$
/)
119 word=
substr ($i
, 2, length ($i
) - 2)
123 if (n
>= firstword
[$
1])
125 if (n == nameword
[$
1])
131 printf "@comment %s%c", name
, 012 # FF
132 printf "@item%s%c%c", defn
, 012, 012
133 if (header
!= -1) printf "%s ", header
;
134 printf "(%s): @ref{%s}.%c\n", std
, node
, 012;