マニュアルページのグループ化の説明はどこで定義されていますか?

マニュアルページのグループ化の説明はどこで定義されていますか?

「グループの説明」がこれを呼び出す正しい方法であるかどうかはわかりませんが、マニュアルページの最初の行が通常どこで定義されているのか疑問に思います。これらの説明の大部分は、1つのプログラムに限定されない。たとえば、Slackwareでは次のようになります。

man rpc

印刷:

RPC(3) BSD ライブラリ機能マニュアル RPC(3)

名前
     rpc — リモートプロシージャコール用のライブラリルーチン

要約
    ...

マニュアルページで「BSD Library Functions Manual」という説明はどこで定義されていますか?私はこのパッケージの完全なソースコードとマニュアルページを再帰的に検索しましたが、何も見つかりませんでした。

ベストアンサー1

rpc(3) のヘッダーは.Dtタイトルマクロとして定義されます:

$ zcat  $(man -w 3 rpc) | head
.\" @(#)rpc.3n 1.31 93/08/31 SMI; from SVr4
.\" Copyright 1989 AT&T
.Dd May 7, 1993
.Dt RPC 3
.Os
.Sh NAME
.Nm rpc
.Nd library routines for remote procedure calls
.Sh SYNOPSIS
.In rpc/rpc.h

これについては、以下で読むことができますman 7 groff_mdoc

TITLE MACROS
     The title macros are part of the page structure domain but are presented
     first and separately for someone who wishes to start writing a man page
     yesterday.  Three header macros designate the document title or manual
     page title, the operating system, and the date of authorship.  These
     macros are called once at the very beginning of the document and are used
     to construct headers and footers only.

 .Dt [⟨document title⟩] [⟨section number⟩] [⟨volume⟩]
         The document title is the subject of the man page and must be in
         CAPITALS due to troff limitations.  If omitted, ‘UNTITLED’ is
         used.  The section number may be a number in the range 1, ..., 9
         or ‘unass’, ‘draft’, or ‘paper’.  If it is specified, and no vol‐
         ume name is given, a default volume name is used.

         Under BSD, the following sections are defined:

         1   BSD General Commands Manual
         2   BSD System Calls Manual
         3   BSD Library Functions Manual
         4   BSD Kernel Interfaces Manual
         5   BSD File Formats Manual
         6   BSD Games Manual
         7   BSD Miscellaneous Information Manual
         8   BSD System Manager's Manual
         9   BSD Kernel Developer's Manual

たとえば、次のように変更すると、次のような結果が.Dt RPC 9表示されます。

RPC(9)   BSD Kernel Developer's Manual   RPC(9) 

おすすめ記事