From d08a7e4cbe43d5e4e4b14dea950fea623d96c1a1 Mon Sep 17 00:00:00 2001 From: Rical Jasan Date: Thu, 15 Jun 2017 21:12:39 -0700 Subject: manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise. --- manual/summary.awk | 133 ----------------------------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 manual/summary.awk (limited to 'manual/summary.awk') diff --git a/manual/summary.awk b/manual/summary.awk deleted file mode 100644 index 1defe616f7..0000000000 --- a/manual/summary.awk +++ /dev/null @@ -1,133 +0,0 @@ -# awk script to create summary.texinfo from the library texinfo files. -# Copyright (C) 1992-2017 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -# This script recognizes sequences that look like: -# @comment HEADER.h -# @comment STANDARD -# @def... ITEM | @item ITEM | @vindex ITEM - -BEGIN { header = 0; -nameword["@defun"]=1 -nameword["@defunx"]=1 -nameword["@defmac"]=1 -nameword["@defmacx"]=1 -nameword["@defspec"]=1 -nameword["@defspecx"]=1 -nameword["@defvar"]=1 -nameword["@defvarx"]=1 -nameword["@defopt"]=1 -nameword["@defoptx"]=1 -nameword["@deffn"]=2 -nameword["@deffnx"]=2 -nameword["@defvr"]=2 -nameword["@defvrx"]=2 -nameword["@deftp"]=2 -nameword["@deftpx"]=2 -nameword["@deftypefun"]=2 -nameword["@deftypefunx"]=2 -nameword["@deftypevar"]=2 -nameword["@deftypevarx"]=2 -nameword["@deftypefn"]=3 -nameword["@deftypefnx"]=3 -nameword["@deftypevr"]=3 -nameword["@deftypevrx"]=3 -firstword["@defun"]=1 -firstword["@defunx"]=1 -firstword["@defmac"]=1 -firstword["@defmacx"]=1 -firstword["@defspec"]=1 -firstword["@defspecx"]=1 -firstword["@defvar"]=1 -firstword["@defvarx"]=1 -firstword["@defopt"]=1 -firstword["@defoptx"]=1 -firstword["@deffn"]=2 -firstword["@deffnx"]=2 -firstword["@defvr"]=2 -firstword["@defvrx"]=2 -firstword["@deftp"]=2 -firstword["@deftpx"]=2 -firstword["@deftypefun"]=1 -firstword["@deftypefunx"]=1 -firstword["@deftypevar"]=1 -firstword["@deftypevarx"]=1 -firstword["@deftypefn"]=2 -firstword["@deftypefnx"]=2 -firstword["@deftypevr"]=2 -firstword["@deftypevrx"]=2 -nameword["@item"]=1 -firstword["@item"]=1 -nameword["@itemx"]=1 -firstword["@itemx"]=1 -nameword["@vindex"]=1 -firstword["@vindex"]=1 - -print "@c DO NOT EDIT THIS FILE!" -print "@c This file is generated by summary.awk from the Texinfo sources." -} - -$1 == "@node" { node=$2; - for (i = 3; i <= NF; ++i) - { node=node " " $i; if ( $i ~ /,/ ) break; } - sub (/,[, ]*$/, "", node); - } - -$1 == "@comment" && $2 ~ /\.h$/ { header="@file{" $2 "}"; - for (i = 3; i <= NF; ++i) - header=header ", @file{" $i "}" - } - -$1 == "@comment" && $2 == "(none)" { header = -1; } - -$1 == "@comment" && header != 0 { std=$2; - for (i=3;i<=NF;++i) std=std " " $i } - -header != 0 && $1 ~ /@def|@item|@vindex/ \ - { defn=""; name=""; curly=0; n=1; - for (i = 2; i <= NF; ++i) { - if ($i ~ /^{/ && $i !~ /}/) { - curly=1 - word=substr ($i, 2, length ($i)) - } - else { - if (curly) { - if ($i ~ /}$/) { - curly=0 - word=word " " substr ($i, 1, length ($i) - 1) - } else - word=word " " $i - } - # Handle a single word in braces. - else if ($i ~ /^{.*}$/) - word=substr ($i, 2, length ($i) - 2) - else - word=$i - if (!curly) { - if (n >= firstword[$1]) - defn=defn " " word - if (n == nameword[$1]) - name=word - ++n - } - } - } - printf "@comment %s%c", name, 12 # FF - printf "@item%s%c%c", defn, 12, 12 - if (header != -1) printf "%s ", header; - printf "(%s): @ref{%s}.%c\n", std, node, 12; - header = 0 } -- cgit 1.4.1