📄 summary.awk
字号:
# awk script to create summary.texinfo from the library texinfo files.# Copyright (C) 1992, 1993 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 Library General Public License# as published by the Free Software Foundation; either version 2 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# Library General Public License for more details.# You should have received a copy of the GNU Library General Public# License along with the GNU C Library; see the file COPYING.LIB. If# not, write to the Free Software Foundation, Inc., 675 Mass Ave,# Cambridge, MA 02139, USA.# This script recognizes sequences that look like:# @comment HEADER.h# @comment STANDARD# @def... ITEM | @item ITEM | @vindex ITEMBEGIN { header = 0;nameword["@defun"]=1nameword["@defmac"]=1nameword["@defspec"]=1nameword["@defvar"]=1nameword["@defopt"]=1nameword["@deffn"]=2nameword["@defvr"]=2nameword["@deftp"]=2nameword["@deftypefun"]=2nameword["@deftypevar"]=2nameword["@deftypefn"]=3nameword["@deftypevr"]=3firstword["@defun"]=1firstword["@defmac"]=1firstword["@defspec"]=1firstword["@defvar"]=1firstword["@defopt"]=1firstword["@deffn"]=2firstword["@defvr"]=2firstword["@deftp"]=2firstword["@deftypefun"]=1firstword["@deftypevar"]=1firstword["@deftypefn"]=2firstword["@deftypevr"]=2nameword["@item"]=1firstword["@item"]=1nameword["@itemx"]=1firstword["@itemx"]=1nameword["@vindex"]=1firstword["@vindex"]=1print "@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; } } $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, 012 # FF printf "@item%s%c%c", defn, 012, 012 if (header != -1) printf "%s ", header; printf "(%s): @ref{%s}.%c\n", std, node, 012; header = 0 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -