Opensourceinfo

Opensource for an Openmind.

OpenSource Headlines

PS3 firmware update could kill jailbreak

SONY HAS RELEASED yet another compulsory PS3 firmware update that might put a damper on the recent open source jailbreak fun.

Open Source Software Examples

If you have ever used Ubuntu or Linux, you probably have some idea about open source softwares.

Down

The Ubuntu developers are moving quickly to bring you the absolute latest and greatest software the Open Source community has to offer.

Some Simple Economics of Open Source

To insert individual citation into a bibliography in a word-processor, select your preferred citation style below and drag-and-drop it into the document.

proxy servers

May 4, 2009 ... As an alternative to downloading the files, the HCPM/HAI Synthesis Cost Proxy Model may be obtained from the FCC's duplicating contractor, ... http://www.fcc.gov/ccb/apd/hcpm/ Patent Database Notices and Status The database servers are now capable of processing approximately 300 simultaneous searches.

The Fridge: Ubuntu Weekly Newsletter #209

Welcome to the Ubuntu Weekly Newsletter. This is Issue #209 for the week August 29th - September 4th, 2010 and is available here.

ubuntu-news-team mailing list

Hash: SHA1 AND THE WINNER IS ... I want to thank all the artists that submitted artwork for Xubuntu Maverick Meerkat, soon to become Xubuntu 10.10. We certainly got some great images from you.

Shortcomings in the setup

Forced to upgrade by a flood of junk mail, this university went to a heavy-duty system based on Linux.

Haste makes waste for value added services

By exploiting third party experts and mobile open source software, operators are free to concentrate on developing their core product offerings Over the past three years, the mobile industry has seen a dramatic shake-up at every level, from phones to services.

Fast Easy Web Hosting

Your Say About Movies

Cigars Review

Man Pages



Macros and Conventions
Browse in : All > Documents > Man Pages > Macros and Conventions (227)
All A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other

mailaddr

NAME

mailaddr - mail addressing description  

DESCRIPTION

This manual page gives a brief introduction to SMTP mail addresses, as used on the Internet. These addresses are in the general format

       user@domain

where a domain is a hierarchical dot separated list of subdomains. For example, the addresses

       eric@monet.berkeley.edu

       Eric Allman <eric@monet.berkeley.edu>

       eric@monet.berkeley.edu (Eric Allman)

are valid forms of the same address.

The domain part (``monet.berkeley.edu``) may be the name of an internet host, or it may be a logical mail address. The domain part is not case sensitive.

The local part (``eric``) is often a user name, but its meaning is defined by the local software. It can be case sensitive, but usually isn`t. If you see a local-part that looks like garbage, it is usually because of a gateway between an internal e-mail system and the net, here are some examples:

       "surname/admd=telemail/c=us/o=hp/prmd=hp"@some.where
        USER%SOMETHING@some.where
        machine!machine!name@some.where
        I2461572@some.where

(These are, respectively, an X.400 gateway, a gateway to an arbitrary inernal mail system that lacks proper internet support, an UUCP gateway, and the last one is just boring username policy.)

The real-name part (``Eric Allman``) can either be placed first, outside <>, or last, inside (). (Strictly speaking the two aren`t the same, but the difference is outside the scope of this page.) The name may have to be quoted using "" if it contains certain characters, most commonly ``.``:

       "Eric P. Allman" <eric@monet.berkeley.edu>
 

Abbreviation.

Many mail systems let users abbreviate the domain name. For instance, users at berkeley.edu may get away with ``eric@monet`` to send mail to Eric Allman. This behavior is deprecated.  

Route-addrs.

Under some circumstances it may be necessary to route a message through several hosts to get it to the final destination. Normally this happens automatically and invisibly, but sometimes not, particularly with old and broken software. Addresses which show these relays are termed ``route-addrs.`` These use the syntax:

       <@hosta,@hostb:user@hostc>

This specifies that the message should be sent to hosta, from there to hostb, and finally to hostc. Some hosts disregard route-addrs and send directly to hostc.

Route-addrs occur frequently on return addresses, since these are generally augmented by the software at each host. It is generally possible to ignore all but the ``user@hostc`` part of the address to determine the actual sender.  

Postmaster.

Every site is required to have a user or user alias designated ``postmaster`` to which problems with the mail system may be addressed. The ``postmaster`` address is not case sensitive.  

FREQUENTLY ASKED QUESTIONS

rtfm.mit.edu and many mirrors store a collection of FAQs. Please find and use a nearby FAQ archive; there are dozens or hundreds around the world. mail/inter-network-guide explains how to send mail between many different networks. mail/country-codes lists the top level domains (e.g. ``no`` is Norway and ``ea`` is Eritrea). mail/college-email/part* gives some useful tips on how to locate e-mail addresses.  

FILES

/etc/aliases
~/.forward  

SEE ALSO

binmail(1), mail(1), mconnect(1), forward(5), aliases(5), sendmail(8), vrfy(8), RFC822 (Standard for the Format of Arpa Internet Text Messages).

mdoc

NAME

mdoc - quick reference guide for the -mdoc macro package  

SYNOPSIS

groff -m doc files ...  

DESCRIPTION

The -mdoc package is a set of content-based and domain-based macros used to format the BSD man pages. The macro names and their meanings are listed below for quick reference; for a detailed explanation on using the package, see the tutorial sampler mdoc.samples7.

Note that this is not the usual macro package for Linux documentation, although it is used for documentation of several widely-used programs; see man(7).

The macros are described in two groups, the first includes the structural and physical page layout macros. The second contains the manual and general text domain macros which differentiate the -mdoc package from other troff formatting packages.  

PAGE STRUCTURE DOMAIN

 

Title Macros

To create a valid manual page, these three macros, in this order, are required:

. Month day, year
Document date.
.
Title, in upper case.
. OPERATING_SYSTEM [version/release]
Operating system (BSD )

 

Page Layout Macros

Section headers, paragraph breaks, lists and displays.

.
 

Section Headers.

Valid headers, in the order of presentation:

NAME
Name section, should include the `.groff ` or `.Fn and ` the `. - macros. `
SYNOPSIS
Usage.
DESCRIPTION
General description, should include options and parameters.
RETURN VALUES
Sections two and three function calls.
ENVIRONMENT
Describe environment variables.
FILES
Files associated with the subject.
EXAMPLES
Examples and suggestions.
DIAGNOSTICS
Normally used for section four device interface diagnostics.
ERRORS
Sections two and three error and signal handling.
SEE ALSO
Cross references and citations.
CONFORMING TO
Conformance to standards if applicable.
HISTORY
If a standard is not applicable, the history of the subject should be given.
BUGS
Gotchas and caveats.
other
Customized headers may be added at the authors discretion.

Li .Ss Subsection Headers. Li .Pp Paragraph Break. Vertical space (one line). Li .D1 (D-one) Display-one Indent and display one text line. Li .Dl (D-ell) Display-one literal. Indent and display one line of literal text. Li .Bd Begin-display block. Display options:

-ragged
Unjustified (ragged edges).
-filled
Justified.
-literal
Literal text or code.
-file name
Read in named file and display.
-offset string
Offset display. Acceptable string values:

left
Align block on left (default).
center
Approximate center margin.
indent
Six constant width spaces (a tab).
indent-two
Two tabs.
right
Left aligns block 2 inches from right.
xx n
Where xx is a number from 4 n to 99 n
Aa Where
Aa is a callable macro name.
string
The width of string is used.

Li .Ed End-display (matches .Bd). Li .Bl Begin-list. Create lists or columns. Options:

List-types

-bullet Ta Bullet Item List
-item Ta Unlabeled List
-enum Ta Enumerated List
-tag Ta Tag Labeled List
-diag Ta Diagnostic List
-hang Ta Hanging Labeled List
-ohang Ta Overhanging Labeled List
-inset Ta Inset or Run-on Labeled List

List-parameters

-offset
(All lists.) See `. ` begin-display above.
-width
( -tag and -hang lists only.) See `. `
-compact
(All lists.) Suppresses blank lines.

Li .El End-list. Li .It List item.

 

MANUAL AND GENERAL TEXT DOMAIN MACROS

The manual and general text domain macros are special in that most of them are parsed for callable macros for example:

.[-s file ]
Produces [-s file ]

In this example, the option enclosure macro `.[is] ` parsed, and calls the callable content macro `- ` which operates on the argument `s` and then calls the callable content macro `file ... ` which operates on the argument `file` Some macros may be callable, but are not parsed and vice versa. These macros are indicated in the parsed and callable columns below.

Unless stated, manual domain macros share a common syntax:

.argument [ . , ; : ( ) [ ] argument ...]

Note Opening and closing punctuation characters are only recognized as such if they are presented one at a time. The string `),` is not recognized as punctuation and will be output with a leading white space and in what ever font the calling macro uses. The argument list `]` ) , is recognized as three sequential closing punctuation characters and a leading white space is not output between the characters and the previous argument (if any). The special meaning of a punctuation character may be escaped with the string `&` For example the following string,

.file1 , file2 , file3 ) .
Produces file1 , file2 , file3 )

 

Manual Domain Macros

Name   Parsed  Callable        Description
Ta Yes Ta Yes Ta Address. (This macro may be deprecated.)
An Ta Yes Ta Yes Ta Author name.
Ta Yes Ta Yes Ta Command line argument.
Ta Ta Ta Configuration declaration (section four only).
Ta Yes Ta Yes Ta Command line argument modifier.
Ta Yes Ta Yes Ta Defined variable (source code).
Er Ta Yes Ta Yes Ta Error number (source code).
Ta Yes Ta Yes Ta Environment variable.
Fa Ta Yes Ta Yes Ta Function argument.
Fd Ta Yes Ta Yes Ta Function declaration.
Fn Ta Yes Ta Yes Ta Function call (also .Fo and .Fc).
Ta Yes Ta Yes Ta Interactive command.
Ta Yes Ta Yes Ta Literal text.
Ta Yes Ta Yes Ta Command name.
[Ta Yes Ta Yes Ta Option (also .[and .Oc). ]
Ot Ta Yes Ta Yes Ta Old style function type (Fortran only).
Ta Yes Ta Yes Ta Pathname or file name.
St Ta Yes Ta Yes Ta Standards (-p1003.2, -p1003.1 or -ansiC)
Ta Yes Ta Yes Ta Variable name.
Vt Ta Yes Ta Yes Ta Variable type (Fortran only).
TaYesTaYesTaManualPageCrossReference.

 

General Text Domain Macros

Name  Parsed  Callable        Description
%A Ta Yes Ta Ta Reference author.
%B Ta Yes Ta Yes Ta Reference book title.
%C Ta Ta Ta Reference place of publishing (city).
%D Ta Ta Ta Reference date.
%J Ta Yes Ta Yes Ta Reference journal title.
%N Ta Ta Ta Reference issue number.
%O Ta Ta Ta Reference optional information.
%P Ta Ta Ta Reference page number(s).
%R Ta Ta Ta Reference report Name.
%T Ta Yes Ta Yes Ta Reference article title.
%V Ta Ta Ta Reference volume.
Ac Ta Yes Ta Yes Ta Angle close quote.
Ao Ta Yes Ta Yes Ta Angle open quote.
Ap Ta Yes Ta Yes Ta Apostrophe.
Aq Ta Yes Ta Yes Ta Angle quote.
AT&T System Ta Ta Ta AT&T UNIX
Bc Ta Yes Ta Yes Ta Bracket close quote.
Bf Ta Ta Ta Begin font mode.
Bo Ta Yes Ta Yes Ta Bracket open quote.
Bq Ta Yes Ta Yes Ta Bracket quote.
BSD Ta Yes Ta Yes Ta BSD
Db Ta Ta Ta Debug (default is *qoff*q)
Dc Ta Yes Ta Yes Ta Double close quote.
Do Ta Yes Ta Yes Ta Double open quote.
``Ta Yes Ta Yes Ta Double quote. ``
Ec Ta Yes Ta Yes Ta Enclose string close quote.
Ef Ta Ta Ta End font mode.
Ta Yes Ta Yes Ta Emphasis (traditional English).
Eo Ta Yes Ta Yes Ta Enclose string open quote.
Fx Ta Ta Ta FreeBSD operating system
Ta Yes Ta Yes Ta Normal text (no-op).
Ta Yes Ta Yes Ta space.
Pc Ta Yes Ta Yes Ta Parenthesis close quote.
Ta Yes Ta Ta Prefix string.
Po Ta Yes Ta Yes Ta Parenthesis open quote.
(Ta Yes Ta Yes Ta Parentheses quote. )
Qc Ta Yes Ta Yes Ta Straight Double close quote.
`Ta Yes `
Ta Yes Ta Quoted literal.
Qo Ta Yes Ta Yes Ta Straight Double open quote.
Qq Ta Yes Ta Yes Ta Straight Double quote.
Li Rs Ta No Ta No Ta "Reference start." Li Rv Ta No Ta No Ta "Return values (sections two and three only)." Li Sc Ta Yes Ta Yes Ta "Single close quote." Li So Ta Yes Ta Yes Ta "Single open quote." Li Sq Ta Yes Ta Yes Ta "Single quote." Li Sm Ta No Ta No Ta "Space mode (default is *qon*q)" Li Sx Ta Yes Ta Yes Ta "Section Cross Reference." Li Sy Ta Yes Ta Yes Ta "Symbolic (traditional English)." Li Tn Ta Yes Ta Yes Ta "Trade or type name (small Caps)." Li Ux Ta Yes Ta Yes Ta Ux Li Xc Ta Yes Ta Yes Ta "Extend argument list close." Li Xo Ta Yes Ta Yes Ta "Extend argument list open."

Macro names ending in `q` quote remaining items on the argument list. Macro names ending in `o` begin a quote which may span more than one line of input and are close quoted with the matching macro name ending in `c` Enclosure macros may be nested and are limited to eight arguments.

Note: the extended argument list macros ( `. ` `. ` and the function enclosure macros ( `.Fo , ` `.Fc ) ` are irregular. The extended list macros are used when the number of macro arguments would exceed the troff limitation of nine arguments.

The macros UR (starting a URI/URL hypertext reference), UE (ending one), and UN (identifying a target for a reference) are also available. See man(7) for more information on these macros.  

CONFIGURATION

For site specific configuration of the macro package, see the file /usr/src/share/tmac/README  

FILES

tmac.doc
Manual and general text domain macros.
tmac.doc-common
Common structural macros and definitions.
tmac.doc-nroff
Site dependent nroff style file.
tmac.doc-ditroff
Site dependent troff style file.
tmac.doc-syms
Special defines (such as the standards macro).

 

SEE ALSO

mdoc.samples7, man(7)

Modes.7ssl.php

NAME

Modes of DES - the variants of DES and other crypto algorithms of OpenSSL  

DESCRIPTION

Several crypto algorithms for OpenSSL can be used in a number of modes. Those are used for using block ciphers in a way similar to stream ciphers, among other things.  

OVERVIEW

 

Electronic Codebook Mode (<FONT SIZE="-1">ECB</FONT>)

Normally, this is found as the function algorithm_ecb_encrypt().
*
64 bits are enciphered at a time.
*
The order of the blocks can be rearranged without detection.
*
The same plaintext block always produces the same ciphertext block (for the same key) making it vulnerable to a `dictionary attack`.
*
An error will only affect one ciphertext block.
 

Cipher Block Chaining Mode (<FONT SIZE="-1">CBC</FONT>)

Normally, this is found as the function algorithm_cbc_encrypt(). Be aware that des_cbc_encrypt() is not really <FONT SIZE="-1">DES</FONT> <FONT SIZE="-1">CBC</FONT> (it does not update the <FONT SIZE="-1">IV</FONT>); use des_ncbc_encrypt() instead.
*
a multiple of 64 bits are enciphered at a time.
*
The <FONT SIZE="-1">CBC</FONT> mode produces the same ciphertext whenever the same plaintext is encrypted using the same key and starting variable.
*
The chaining operation makes the ciphertext blocks dependent on the current and all preceding plaintext blocks and therefore blocks can not be rearranged.
*
The use of different starting variables prevents the same plaintext enciphering to the same ciphertext.
*
An error will affect the current and the following ciphertext blocks.
 

Cipher Feedback Mode (<FONT SIZE="-1">CFB</FONT>)

Normally, this is found as the function algorithm_cfb_encrypt().
*
a number of bits (j) <= 64 are enciphered at a time.
*
The <FONT SIZE="-1">CFB</FONT> mode produces the same ciphertext whenever the same plaintext is encrypted using the same key and starting variable.
*
The chaining operation makes the ciphertext variables dependent on the current and all preceding variables and therefore j-bit variables are chained together and can not be rearranged.
*
The use of different starting variables prevents the same plaintext enciphering to the same ciphertext.
*
The strength of the <FONT SIZE="-1">CFB</FONT> mode depends on the size of k (maximal if j == k). In my implementation this is always the case.
*
Selection of a small value for j will require more cycles through the encipherment algorithm per unit of plaintext and thus cause greater processing overheads.
*
Only multiples of j bits can be enciphered.
*
An error will affect the current and the following ciphertext variables.
 

Output Feedback Mode (<FONT SIZE="-1">OFB</FONT>)

Normally, this is found as the function algorithm_ofb_encrypt().
*
a number of bits (j) <= 64 are enciphered at a time.
*
The <FONT SIZE="-1">OFB</FONT> mode produces the same ciphertext whenever the same plaintext enciphered using the same key and starting variable. More over, in the <FONT SIZE="-1">OFB</FONT> mode the same key stream is produced when the same key and start variable are used. Consequently, for security reasons a specific start variable should be used only once for a given key.
*
The absence of chaining makes the <FONT SIZE="-1">OFB</FONT> more vulnerable to specific attacks.
*
The use of different start variables values prevents the same plaintext enciphering to the same ciphertext, by producing different key streams.
*
Selection of a small value for j will require more cycles through the encipherment algorithm per unit of plaintext and thus cause greater processing overheads.
*
Only multiples of j bits can be enciphered.
*
<FONT SIZE="-1">OFB</FONT> mode of operation does not extend ciphertext errors in the resultant plaintext output. Every bit error in the ciphertext causes only one bit to be in error in the deciphered plaintext.
*
<FONT SIZE="-1">OFB</FONT> mode is not self-synchronizing. If the two operation of encipherment and decipherment get out of synchronism, the system needs to be re-initialized.
*
Each re-initialization should use a value of the start variable different from the start variable values used before with the same key. The reason for this is that an identical bit stream would be produced each time from the same parameters. This would be susceptible to a `known plaintext` attack.
 

Triple <FONT SIZE="-1">ECB</FONT> Mode

Normally, this is found as the function algorithm_ecb3_encrypt().
*
Encrypt with key1, decrypt with key2 and encrypt with key3 again.
*
As for <FONT SIZE="-1">ECB</FONT> encryption but increases the key length to 168 bits. There are theoretic attacks that can be used that make the effective key length 112 bits, but this attack also requires 2^56 blocks of memory, not very likely, even for the <FONT SIZE="-1">NSA</FONT>.
*
If both keys are the same it is equivalent to encrypting once with just one key.
*
If the first and last key are the same, the key length is 112 bits. There are attacks that could reduce the effective key strength to only slightly more than 56 bits, but these require a lot of memory.
*
If all 3 keys are the same, this is effectively the same as normal ecb mode.
 

Triple <FONT SIZE="-1">CBC</FONT> Mode

Normally, this is found as the function algorithm_ede3_cbc_encrypt().
*
Encrypt with key1, decrypt with key2 and then encrypt with key3.
*
As for <FONT SIZE="-1">CBC</FONT> encryption but increases the key length to 168 bits with the same restrictions as for triple ecb mode.
 

NOTES

This text was been written in large parts by Eric Young in his original documentation for SSLeay, the predecessor of OpenSSL. In turn, he attributed it to:

AS 2805.5.2 Australian Standard Electronic funds transfer - Requirements for interfaces, Part 5.2: Modes of operation for an n-bit block cipher algorithm Appendix A

 

SEE ALSO

blowfish(3), des(3), idea(3), rc2(3)

mozplugger

NAME

mozplugger - a streaming multimedia plugin for UNIX mozilla
mozpluggerrc - configure file for mozplugger

 

DESCRIPTION

MozPlugger is a Mozilla plugin which can show many types of multimedia inside your Mozilla. To accomplish this, MozPlugger uses external programs such as mplayer, xanim, mtv, timidity and tracker.

 

CONFIGURE FILE

You can configure mozplugger by changing the file mozpluggerrc which can be located in any of the following directories:

        $HOME/.netscape/

       $HOME/.opera/

       $MOZILLA_HOME/

       $OPERA_HOME/

       /usr/local/netscape/mozpluggerrc

       /etc/mozpluggerrc

       /usr/etc/mozpluggerrc

       /usr/local/etc/mozpluggerrc

The format of mozpluggerrc is very simple. The general layout is to have one or more lines describing mime-types followed by one or more lines describing commands used to handle those mime-types. Lines beginning with # are considered comments and are ignored. Here is a simple example:

        video/mpeg; mpeg; Mpeg video

       video/quicktime; qt; Mpeg video

               : xanim +W$window -Zr +q +Ze +f $file

Each line describing a mime type has three fields:

        
mime type ; extensions ; description

mime type
The mime type is the standardized name for the content type you want MozPlugger to handle. This must be the same type as the web server claims the file to be, or MozPlugger will not be used for that file, regardless of the extension.
extensions
This is a comma separated list of extensions that should be associated with this particular mime type. The extensions are only used when a web server does not report what type of file it is, or when loading files directly from disk.
description
This is the description that shows up in about:plugins and in the application preferences section in Mozilla.

Lines that describe what command to use for a mime type must begin with a whitespace and have two fields:

        
flags : command

flags
This is a comma-separated list of flags which tells mozplugger how to handle this particular application. See below for further details.
command
This is a command which is sent to /bin/sh when handling this mime type.

 

FINDING THE RIGHT COMMAND

When MozPlugger is called from your browser, it looks through the configuration file and tries to find a matching mime type. For an application to be chosen it has to fulfill certain criteria, it has to exist, and it must match the flags given to mozplugger.

When it does, it tries to figure out which command to use. First, it looks through all the commands for that particular mime type to see if it can find an application that has the stream flag. If it cannot find a streaming application it downloads the file and tries again. Note that MozPlugger will check the first word of the command and search your $PATH for that command. If that command is not found MozPlugger will go to the next line in your mozpluggerrc.

 

FLAGS

repeat
This indicates that the command uses the $repeat variable.
loop
This indicates that the application loops forever. If the <EMBED> tag used to start MozPlugger indicated that the file should not loop forever, the command on this line will not be used.
stream
This indicates that this application can take an url. In this case, the variable $file contains the URL of the file to play and the browser does not download it.
ignore_errors
This flag tells MozPlugger to ignore the exit status of the application.
noisy
This flag tells MozPlugger to redirect the stdout and stderr of the application to /dev/null.
nokill
This will tell MozPlugger not to try to kill the application when leaving the page. This is normally used for programs which start in their own window and can play multiple files, such as xmms.
swallow ( name )
This is the only flag that takes an argument so far. It will tell mozplugger that the application will open a window with the specified name and that this window will then be moved to inside your browser.
fill
This keyword is used to maximize an swallowed window.
maxaspect
This keyword is used to maximize an swallowed window while keeping the width/height ratio constant.
controls
This flag is typically used with audio files to display a controller with the buttons play, pause and stop while playing. It only works with EMBED tags.
embed, noembed
These flags can be used to define embed-only or full-window-only commands.
hidden
In conjunction with the swallow keyword, this tells the plugin to swallow windows which are not visible yet.

 

VARIABLES

MozPlugger gives some variables to /bin/sh when starting the application, these variables are:

$repeats
This variable contains how many times the file should be played. Applications which use this variable should also set the repeat flag.
$window
This is the X window Mozilla has given the plugin. This can be used with applications such as MPlayer to display graphics inside the netscape window.
$width
This is the horizontal resolution in pixels.
$height
This is the vertical resolution in pixels.
$file
This is the file to play. If the application uses the stream flag, this this variable contains the URL of the file to play.
$mimetype
This variable contains the mime type of $file.
$VAR_<parameter_name>
All the parameters of the <EMBED> tags are made avalable in mozpluggerrc through environment variables. For example the parameter loop="1" in an <EMBED> tag defines the varibale VAR_loop=1.

 

BUGS

You have to remove ~/.netscape/plugin-list or ~/.mozilla/pluginreg.dat after changing the configuration, or nothing will happen. This is a Netscape/Mozilla bug, not a MozPlugger bug.

Netscape 3.x will not play anything for <EMBED> tags for which height or width are zero. This too is a Netscape bug.

 

AUTHORS

Fredrik Hübinette, hubbe@hubbe.net
Louis Bavoil, louis@bavoil.net

man

NAME

man - macros to format man pages  

SYNOPSIS

groff -Tascii -man file ...

groff -Tps -man file ...

man [section] title  

DESCRIPTION

This manual page explains the groff tmac.an macro package (often called the man macro package) and related conventions for creating manual (man) pages. This macro package should be used by developers when writing or porting man pages for Linux. It is fairly compatible with other versions of this macro package, so porting man pages should not be a major problem (exceptions include the NET-2 BSD release, which uses a totally different macro package called mdoc; see mdoc(7)).

Note that NET-2 BSD mdoc man pages can be used with groff simply by specifying the -mdoc option instead of the -man option. Using the -mandoc option is, however, recommended, since this will automatically detect which macro package is in use.  

PREAMBLE

The first command in a man page (after comment lines) should be

.TH title section date source manual,

where:
title
The title of the man page (e.g., MAN).
section
The section number the man page should be placed in (e.g., 7).
date
The date of the last revision---remember to change this every time a change is made to the man page, since this is the most general way of doing version control.
source
The source of the command.

For binaries, use something like: GNU, NET-2, SLS Distribution, MCC Distribution.

For system calls, use the version of the kernel that you are currently looking at: Linux 0.99.11.

For library calls, use the source of the function: GNU, BSD 4.3, Linux DLL 4.4.1.

manual
The title of the manual (e.g., Linux Programmer`s Manual).

Note that BSD mdoc-formatted pages begin with the Dd command, not the TH command.

The manual sections are traditionally defined as follows:

1 Commands
Those commands that can be executed by the user from within a shell.
2 System calls
Those functions which must be performed by the kernel.
3 Library calls
Most of the libc functions, such as qsort(3).
4 Special files
Files found in /dev.
5 File formats and conventions
The format for /etc/passwd and other human-readable files.
6 Games
7 Conventions and miscellaneous
A description of the standard file system layout, network protocols, ASCII and other character codes, this man page, and other things.
8 System management commands
Commands like mount(8), many of which only root can execute.
9 Kernel routines
This is an obsolete manual section. Once it was thought a good idea to document the Linux kernel here, but in fact very little has been documented, and the documentation that exists is outdated already. There are better sources of information for kernel developers.
 

SECTIONS

Sections are started with .SH followed by the heading name. If the name contains spaces and appears on the same line as .SH, then place the heading in double quotes. Traditional or suggested headings include: NAME, SYNOPSIS, DESCRIPTION, RETURN VALUE, EXIT STATUS, ERROR HANDLING, ERRORS, OPTIONS, USAGE, EXAMPLES, FILES, ENVIRONMENT, DIAGNOSTICS, SECURITY, CONFORMING TO, NOTES, BUGS, AUTHOR, and SEE ALSO. Where a traditional heading would apply, please use it; this kind of consistency can make the information easier to understand. However, feel free to create your own headings if they make things easier to understand. The only required heading is NAME, which should be the first section and be followed on the next line by a one line description of the program:

.SH NAME
chess - the game of chess

It is extremely important that this format is followed, and that there is a backslash before the single dash which follows the command name. This syntax is used by the makewhatis(8) program to create a database of short command descriptions for the whatis(1) and apropos(1) commands.

Some other traditional sections have the following contents:

SYNOPSIS
briefly describes the command or function`s interface. For commands, this shows the syntax of the command and its arguments (including options); boldface is used for as-is text and italics are used to indicate replaceable arguments. Brackets ([]) surround optional arguments, vertical bars (|) separate choices, and ellipses (...) can be repeated. For functions, it shows any required data declarations or #include directives, followed by the function declaration.
DESCRIPTION
gives an explanation of what the command, function, or format does. Discuss how it interacts with files and standard input, and what it produces on standard output or standard error. Omit internals and implementation details unless they`re critical for understanding the interface. Describe the usual case; for information on options use the OPTIONS section. If there is some kind of input grammar or complex set of subcommands, consider describing them in a separate USAGE section (and just place an overview in the DESCRIPTION section).
RETURN VALUE
gives a list of the values the library routine will return to the caller and the conditions that cause these values to be returned.
EXIT STATUS
lists the possible exit status values or a program and the conditions that cause these values to be returned.
OPTIONS
describes the options accepted by the program and how they change its behavior.
USAGE
describes the grammar of any sublanguage this implements.
EXAMPLES
provides one or more examples describing how this function, file or command is used.
FILES
lists the files the program or function uses, such as configuration files, startup files, and files the program directly operates on. Give the full pathname of these files, and use the installation process to modify the directory part to match user preferences. For many programs, the default installation location is in /usr/local, so your base manual page should use /usr/local as the base.
ENVIRONMENT
lists all environment variables that affect your program or function and how they affect it.
DIAGNOSTICS
gives an overview of the most common error messages and how to cope with them. You don`t need to explain system error messages or fatal signals that can appear during execution of any program unless they`re special in some way to your program.
SECURITY
discusses security issues and implications. Warn about configurations or environments that should be avoided, commands that may have security implications, and so on, especially if they aren`t obvious. Discussing security in a separate section isn`t necessary; if it`s easier to understand, place security information in the other sections (such as the DESCRIPTION or USAGE section). However, please include security information somewhere!
CONFORMING TO
describes any standards or conventions this implements.
NOTES
provides miscellaneous notes.
BUGS
lists limitations, known defects or inconveniences, and other questionable activities.
AUTHOR
lists authors of the documentation or program so you can mail in bug reports.
SEE ALSO
lists related man pages in alphabetical order, possibly followed by other related pages or documents. Conventionally this is the last section.
 

FONTS

Although there are many arbitrary conventions for man pages in the UNIX world, the existence of several hundred Linux-specific man pages defines our font standards:
For functions, the arguments are always specified using italics, even in the SYNOPSIS section, where the rest of the function is specified in bold:
int myfunction(int argc, char **argv);
Filenames are always in italics (e.g., /usr/include/stdio.h), except in the SYNOPSIS section, where included files are in bold (e.g., #include <stdio.h>).
Special macros, which are usually in upper case, are in bold (e.g., MAXINT).
When enumerating a list of error codes, the codes are in bold (this list usually uses the .TP macro).
Any reference to another man page (or to the subject of the current man page) is in bold. If the manual section number is given, it is given in Roman (normal) font, without any spaces (e.g., man(7)).

The commands to select the type face are:

.B
Bold
.BI
Bold alternating with italics (especially useful for function specifications)
.BR
Bold alternating with Roman (especially useful for referring to other manual pages)
.I
Italics
.IB
Italics alternating with bold
.IR
Italics alternating with Roman
.RB
Roman alternating with bold
.RI
Roman alternating with italics
.SB
Small alternating with bold
.SM
Small (useful for acronyms)

Traditionally, each command can have up to six arguments, but the GNU implementation removes this limitation (you might still want to limit yourself to 6 arguments for portability`s sake). Arguments are delimited by spaces. Double quotes can be used to specify an argument which contains spaces. All of the arguments will be printed next to each other without intervening spaces, so that the .BR command can be used to specify a word in bold followed by a mark of punctuation in Roman. If no arguments are given, the command is applied to the following line of text.  

OTHER MACROS AND STRINGS

Below are other relevant macros and predefined strings. Unless noted otherwise, all macros cause a break (end the current line of text). Many of these macros set or use the "prevailing indent." The "prevailing indent" value is set by any macro with the parameter i below; macros may omit i in which case the current prevailing indent will be used. As a result, successive indented paragraphs can use the same indent without re-specifying the indent value. A normal (non-indented) paragraph resets the prevailing indent value to its default value (0.5 inches). By default a given indent is measured in ens; try to ens or ems as units for indents, since these will automatically adjust to font size changes. The other key macro definitions are:  

Normal Paragraphs

.LP
Same as .PP (begin a new paragraph).
.P
Same as .PP (begin a new paragraph).
.PP
Begin a new paragraph and reset prevailing indent.
 

Relative Margin Indent

.RS i
Start relative margin indent - moves the left margin i to the right (if i is omitted, the prevailing indent value is used). A new prevailing indent is set to 0.5 inches. As a result, all following paragraph(s) will be indented until the corresponding .RE.
.RE
End relative margin indent and restores the previous value of the prevailing indent.
 

Indented Paragraph Macros

.HP i
Begin paragraph with a hanging indent (the first line of the paragraph is at the left margin of normal paragraphs, and the rest of the paragraph`s lines are indented).
.IP x i
Indented paragraph with optional hanging tag. If the tag x is omitted, the entire following paragraph is indented by i. If the tag x is provided, it is hung at the left margin before the following indented paragraph (this is just like .TP except the tag is included with the command instead of being on the following line). If the tag is too long, the text after the tag will be moved down to the next line (text will not be lost or garbled). For bulleted lists, use this macro with (bu (bullet) or (em (em dash) as the tag, and for numbered lists, use the number or letter followed by a period as the tag; this simplifies translation to other formats.
.TP i
Begin paragraph with hanging tag. The tag is given on the next line, but its results are like those of the .IP command.
 

Hypertext Link Macros

.UR u
Begins a hypertext link to the URI (URL) u; it will end with the corresponding UE command. When generating HTML this should translate into the HTML command <A HREF="u">. There is an exception: if u is the special value ":", then no hypertext link of any kind will be generated until after the closing UE (this permits disabling hypertext links in phrases like LALR(1) when linking is not appropriate). These hypertext link "macros" are new, and many tools won`t do anything with them, but since many tools (including troff) will simply ignore undefined macros (or at worst insert their text) these are safe to insert.
.UE
Ends the corresponding UR command; when generating HTML this should translate into </A>.
.UN u
Creates a named hypertext location named u; do not include a corresponding UE command. When generating HTML this should translate into the HTML command <A NAME="u" id="u">&nbsp;</A> (the &nbsp; is optional if support for Mosaic is unneeded).
 

Miscellaneous Macros

.DT
Reset tabs to default tab values (every 0.5 inches); does not cause a break.
.PD d
Set inter-paragraph vertical distance to d (if omitted, d=0.4v); does not cause a break.
.SS t
Subheading t (like .SH, but used for a subsection inside a section).
 

Predefined Strings

The man package has the following predefined strings:
*R
Registration Symbol: ®
*S
Change to default font size
*(Tm
Trademark Symbol:
*(lq
Left angled doublequote: ``
*(rq
Right angled doublequote: ``
 

SAFE SUBSET

Although technically man is a troff macro package, in reality a large number of other tools process man page files that don`t implement all of troff`s abilities. Thus, it`s best to avoid some of troff`s more exotic abilities where possible to permit these other tools to work correctly. Avoid using the various troff preprocessors (if you must, go ahead and use tbl(1), but try to use the IP and TP commands instead for two-column tables). Avoid using computations; most other tools can`t process them. Use simple commands that are easy to translate to other formats. The following troff macros are believed to be safe (though in many cases they will be ignored by translators): , ., ad, bp, br, ce, de, ds, el, ie, if, fi, ft, hy, ig, in, na, ne, nf, nh, ps, so, sp, ti, tr.

You may also use many troff escape sequences (those sequences beginning with ). When you need to include the backslash character as normal text, use e. Other sequences you may use, where x or xx are any characters and N is any digit, include: `, `, -, ., , \%, *x, *(xx, (xx, $N, x, (xx, fx, and f(xx. Avoid using the escape sequences for drawing graphics.

Do not use the optional parameter for bp (break page). Use only positive values for sp (vertical space). Don`t define a macro (de) with the same name as a macro in this or the mdoc macro package with a different meaning; it`s likely that such redefinitions will be ignored. Every positive indent (in) should be paired with a matching negative indent (although you should be using the RS and RE macros instead). The condition test (if,ie) should only have `t` or `n` as the condition. Only translations (tr) that can be ignored should be used. Font changes (ft and the f escape sequence) should only have the values 1, 2, 3, 4, R, I, B, P, or CW (the ft command may also have no parameters).

If you use capabilities beyond these, check the results carefully on several tools. Once you`ve confirmed that the additional capability is safe, let the maintainer of this document know about the safe command or sequence that should be added to this list.  

NOTES

By all means include full URLs (or URIs) in the text itself; some tools such as man2html(1) can automatically turn them into hypertext links. You can also use the new UR macro to identify links to related information. If you include URLs, use the full URL (e.g., <http://www.kernelnotes.org>) to ensure that tools can automatically find the URLs.

Tools processing these files should open the file and examine the first non-whitespace character. A period (.) or single quote (`) at the beginning of a line indicates a troff-based file (such as man or mdoc). A left angle bracket (<) indicates an SGML/XML-based file (such as HTML or Docbook). Anything else suggests simple ASCII text (e.g., a "catman" result).

Many man pages begin with `" followed by a space and a list of characters, indicating how the page is to be preprocessed. For portability`s sake to non-troff translators we recommend that you avoid using anything other than tbl(1), and Linux can detect that automatically. However, you might want to include this information so your man page can be handled by other (less capable) systems. Here are the definitions of the preprocessors invoked by these characters:

e
eqn(1)
g
grap(1)
p
pic(1)
r
refer(1)
t
tbl(1)
v
vgrind(1)
 

FILES

/usr/share/groff/[*/]tmac/tmac.an
/usr/man/whatis  

BUGS

Most of the macros describe formatting (e.g., font type and spacing) instead of marking semantic content (e.g., this text is a reference to another page), compared to formats like mdoc and DocBook (even HTML has more semantic markings). This situation makes it harder to vary the man format for different media, to make the formatting consistent for a given media, and to automatically insert cross-references. By sticking to the safe subset described above, it should be easier to automate transitioning to a different reference page format in the future.

The Sun macro TX is not implemented.  

AUTHORS

---
James Clark (jjc@jclark.com) wrote the implementation of the macro package.
---
Rickard E. Faith (faith@cs.unc.edu) wrote the initial version of this manual page.
---
Jens Schweikhardt (schweikh@noc.fdn.de) wrote the Linux Man-Page Mini-HOWTO (which influenced this manual page).
---
David A. Wheeler (dwheeler@ida.org) heavily modified this manual page, such as adding detailed information on sections and macros.
 

SEE ALSO

apropos(1), groff(1), man(1), man2html(1), mdoc(7), mdoc.samples(7), whatis(1)

mdoc.samples

NAME

mdoc.samples - tutorial sampler for writing BSD manuals with -mdoc  

SYNOPSIS

man mdoc.samples  

DESCRIPTION

A tutorial sampler for writing BSD manual pages with the -mdoc macro package, a content -based and domain -based formatting package for troff(1). Its predecessor, the -man7 package, addressed page layout leaving the manipulation of fonts and other typesetting details to the individual author. In -mdoc page layout macros make up the page structure domain which consists of macros for titles, section headers, displays and lists. Essentially items which affect the physical position of text on a formatted page. In addition to the page structure domain, there are two more domains, the manual domain and the general text domain. The general text domain is defined as macros which perform tasks such as quoting or emphasizing pieces of text. The manual domain is defined as macros that are a subset of the day to day informal language used to describe commands, routines and related BSD files. Macros in the manual domain handle command names, command line arguments and options, function names, function parameters, pathnames, variables, cross references to other manual pages, and so on. These domain items have value for both the author and the future user of the manual page. It is hoped the consistency gained across the manual set will provide easier translation to future documentation tools.

Throughout the UNIX manual pages, a manual entry is simply referred to as a man page, regardless of actual length and without sexist intention.  

GETTING STARTED

Since a tutorial document is normally read when a person desires to use the material immediately, the assumption has been made that the user of this document may be impatient. The material presented in the remained of this document is outlined as follows:

  1. TROFF IDIOSYNCRASIES

    "Macro Usage"
    "Passing Space Characters in an Argument"
    "Trailing Blank Space Characters (a warning)"
    "Escaping Special Characters"

  2. THE ANATOMY OF A MAN PAGE

    "A manual page template"

  3. TITLE MACROS
  4. INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS

    "What`s in a name..."
    "General Syntax"

  5. MANUAL DOMAIN

    "Addresses"
    "Author name"
    "Arguments"
    "Configuration Declarations (section four only)"
    "Command Modifier"
    "Defined Variables"
    "Errno`s (Section two only)"
    "Environment Variables"
    "Function Argument"
    "Function Declaration"
    "Flags"
    "Functions (library routines)"
    "Function Types"
    "Interactive Commands"
    "Names"
    "Options"
    "Pathnames"
    "Variables"
    "Cross References"

  6. GENERAL TEXT DOMAIN

    "AT&T Macro"
    "BSD Macro"
    "FreeBSD Macro"
    "UNIX Macro"
    "Enclosure/Quoting Macros"

    "Angle Bracket Quote/Enclosure"
    "Bracket Quotes/Enclosure"
    "Double Quote macro/Enclosure"
    "Parenthesis Quote/Enclosure"
    "Single Quotes/Enclosure"
    "Prefix Macro"

    "No-[or Normal Text Macro]
    "Space Macro
    "Section Cross References"
    "References and Citations"
    "Return Values (sections two and three only)"
    "Trade Names (Acronyms and Type Names)"
    "Extended Arguments"

  7. PAGE STRUCTURE DOMAIN

    "Section Headers"
    "Paragraphs and Line Spacing"
    "Keeps"
    "Displays"
    "Font Modes (Emphasis, Literal, and Symbolic)"
    "Lists and Columns"

  8. PREDEFINED STRINGS
  9. DIAGNOSTICS
  10. FORMATTING WITH GROFF, TROFF AND NROFF
  11. BUGS

 

TROFF IDIOSYNCRASIES

The -mdoc package attempts to simplify the process of writing a man page. Theoretically, one should not have to learn the dirty details of troff(1) to use -mdoc however, there are a few limitations which are unavoidable and best gotten out of the way. And, too, be forewarned, this package is not fast.  

Macro Usage

As in troff(1), a macro is called by placing a `.` (dot character) at the beginning of a line followed by the two character name for the macro. Arguments may follow the macro separated by spaces. It is the dot character at the beginning of the line which causes troff(1) to interpret the next two characters as a macro name. To place a `.` (dot character) at the beginning of a line in some context other than a macro invocation, precede the `.` (dot) with the `&` escape sequence. The `&` translates literally to a zero width space, and is never displayed in the output.

In general, troff(1) macros accept up to nine arguments, any extra arguments are ignored. Most macros in -mdoc accept nine arguments and, in limited cases, arguments may be continued or extended on the next line (See Sx Extensions ) . A few macros handle quoted arguments (see Sx Passing Space Characters in an Argument below).

Most of the -mdoc general text domain and manual domain macros are special in that their argument lists are parsed for callable macro names. This means an argument on the argument list which matches a general text or manual domain macro name and is determined to be callable will be executed or called when it is processed. In this case the argument, although the name of a macro, is not preceded by a `.` (dot). It is in this manner that many macros are nested; for example the option macro, `.[,] ` may call the flag and argument macros, `- ` and `file ... ` to specify an optional flag with an argument:

[-s bytes ]
is produced by .[-s bytes ]

To prevent a two character string from being interpreted as a macro name, precede the string with the escape sequence `&` :

[-s bytes ]
is produced by .[&-s &bytes ]

Here the strings `- ` and `file ... ` are not interpreted as macros. Macros whose argument lists are parsed for callable arguments are referred to as parsed and macros which may be called from an argument list are referred to as callable throughout this document and in the companion quick reference manual mdoc(7). This is a technical faux pas as almost all of the macros in -mdoc are parsed, but as it was cumbersome to constantly refer to macros as being callable and being able to call other macros, the term parsed has been used.  

Passing Space Characters in an Argument

Sometimes it is desirable to give as one argument a string containing one or more blank space characters. This may be necessary to defeat the nine argument limit or to specify arguments to macros which expect particular arrangement of items in the argument list. For example, the function macro `.Fn expects ` the first argument to be the name of a function and any remaining arguments to be function parameters. As ANSI C stipulates the declaration of function parameters in the parenthesized parameter list, each parameter is guaranteed to be at minimum a two word string. For example, Fa int foo .

There are two possible ways to pass an argument which contains an embedded space. Implementation note Unfortunately, the most convenient way of passing spaces in between quotes by reassigning individual arguments before parsing was fairly expensive speed wise and space wise to implement in all the macros for AT&T troff. It is not expensive for groff but for the sake of portability, has been limited to the following macros which need it the most:

Configuration declaration (section 4
Sx SYNOPSIS )

Begin list (for the width specifier).
Emphasized text.
Fn Functions (sections two and four).
List items.
Literal text.
Symbolic text.
%B
Book titles.
%J
Journal names.
%O
Optional notes for a reference.
%R
Report title (in a reference).
%T
Title of article in a book or journal.

One way of passing a string containing blank spaces is to use the hard or unpaddable space character `
 ,` that is, a blank space preceded by the escape character `` This method may be used with any macro but has the side effect of interfering with the adjustment of text over the length of a line. Troff sees the hard space as if it were any other printable character and cannot split the string into blank or newline separated pieces as one would expect. The method is useful for strings which are not expected to overlap a line boundary. For example:

Fn fetch char *str
is created by `.Fn fetch ` char *str
Fn fetch char *str
can also be created by `.Fn fetch ` *qchar *str*q

If the `` or quotes were omitted, `.Fn would ` see three arguments and the result would be:

Fn fetch char *str

For an example of what happens when the parameter list overlaps a newline boundary, see the Sx BUGS section.

 

Trailing Blank Space Characters

Troff can be confused by blank space characters at the end of a line. It is a wise preventive measure to globally remove all blank spaces from <blank-space><end-of-line> character sequences. Should the need arise to force a blank character at the end of a line, it may be forced with an unpaddable space and the `&` escape character. For example, `string\& .`  

Escaping Special Characters

Special characters like the newline character ` ` , are handled by replacing the `` with `e` (e.g. `en` ) to preserve the backslash.  

THE ANATOMY OF A MAN PAGE

The body of a man page is easily constructed from a basic template found in the file /usr/share/misc/mdoc.template Several example man pages can also be found in /usr/share/examples/mdoc

 

A manual page template

." The following requests are required for all man pages. .Dd Month day, year .Os OPERATING_SYSTEM [version/release] .Dt DOCUMENT_TITLE [section number] [volume] .Sh NAME .Nm name .Nd one line description of name .Sh SYNOPSIS .Sh DESCRIPTION ." The following requests should be uncommented and ." used where appropriate. This next request is ." for sections 2 and 3 function return values only. ." .Sh RETURN VALUES ." This next request is for sections 1, 6, 7 & 8 only ." .Sh ENVIRONMENT ." .Sh FILES ." .Sh EXAMPLES ." This next request is for sections 1, 6, 7 & 8 only ." (command return values (to shell) and ." fprintf/stderr type diagnostics) ." .Sh DIAGNOSTICS ." The next request is for sections 2 and 3 error ." and signal handling only. ." .Sh ERRORS ." .Sh SEE ALSO ." .Sh CONFORMING TO ." .Sh HISTORY ." .Sh AUTHORS ." .Sh BUGS

The first items in the template are the macros (., ., . ) the document date, the operating system the man page or subject source is developed or modified for, and the man page title (in upper case ) along with the section of the manual the page belongs in. These macros identify the page, and are discussed below in Sx TITLE MACROS .

The remaining items in the template are section headers (. 

;

) of which Sx NAME , Sx SYNOPSIS and Sx DESCRIPTION are mandatory. The headers are discussed in Sx PAGE STRUCTURE DOMAIN , after presentation of Sx MANUAL DOMAIN . Several content macros are used to demonstrate page layout macros; reading about content macros before page layout macros is recommended.  

TITLE MACROS

The title macros are the first portion of the page structure domain, but are presented first and separate 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 one called once at the very beginning of the document and are used to construct the headers and footers only.

.
The document title is the subject of the man page and must be in CAPITALS due to troff limitations. The section number may be 1, ..., 8, and if it is specified, the volume title may be omitted. A volume title may be arbitrary or one of the following:

AMD    UNIX Ancestral Manual Documents
SMM  UNIX System Manager`s Manual
URM     UNIX Reference Manual
PRMUNIX Programmer`s Manual

The default volume labeling is
URM for sections 1, 6, and 7; SMM for section 8; PRM for sections 2, 3, 4, and 5.

.operating_system release#
The name of the operating system should be the common acronym, e.g. BSD or FreeBSD or ATT The release should be the standard release nomenclature for the system specified, e.g. 4.3, 4.3+Tahoe, V.3, V.4. Unrecognized arguments are displayed as given in the page footer. For instance, a typical footer might be:

.BSD 4.3

or

.FreeBSD 2.2

or for a locally produced set

.CS Department

The Berkeley default, `.without ` an argument, has been defined as BSD in the site specific file /usr/share/tmac/mdoc/doc-common It really should default to LOCAL Note, if the `.macro ` is not present, the bottom left corner of the page will be ugly.

.month day, year
The date should be written formally:

January 25, 1989

 

INTRODUCTION OF MANUAL AND GENERAL TEXT DOMAINS

 

What`s in a name...

The manual domain macro names are derived from the day to day informal language used to describe commands, subroutines and related files. Slightly different variations of this language are used to describe the three different aspects of writing a man page. First, there is the description of -mdoc macro request usage. Second is the description of a UNIX command with -mdoc macros and third, the description of a command to a user in the verbal sense; that is, discussion of a command in the text of a man page.

In the first case, troff(1) macros are themselves a type of command; the general syntax for a troff command is:

.Va argument1 argument2 ... argument9

The `.is ` a macro command or request, and anything following it is an argument to be processed. In the second case, the description of a UNIX command using the content macros is a bit more involved; a typical Sx SYNOPSIS command line might be displayed as:

filter [-flag ] infile outfile

Here, filter is the command name and the bracketed string -flag is a flag argument designated as optional by the option brackets. In -mdoc terms, infile and outfile are called arguments The macros which formatted the above example:

.Nm filter .Op Fl flag .Ar infile outfile

In the third case, discussion of commands and command syntax includes both examples above, but may add more detail. The arguments infile and outfile from the example above might be referred to as operands or file arguments Some command line argument lists are quite long:

make
[-eiknqrstv ] [-D variable ] [-d flags ] [-f makefile ] -words [-I directory ] [-j max_jobs ] [variable=value ] -words [target ... ]

Here one might talk about the command make and qualify the argument makefile as an argument to the flag, -f or discuss the optional file operand target In the verbal context, such detail can prevent confusion, however the -mdoc package does not have a macro for an argument to a flag. Instead the `file ... ` argument macro is used for an operand or file argument like target as well as an argument to a flag like variable The make command line was produced from:

.Nm make .Op Fl eiknqrstv .Op Fl D Ar variable .Op Fl d Ar flags .Op Fl f Ar makefile .Op Fl I Ar directory .Op Fl j Ar max_jobs .Op Ar variable=value .Bk -words .Op Ar target ... .Ek

The `.and ` `.macros ` are explained in Sx Keeps .  

General Syntax

The manual domain and general text domain macros share a similar syntax with a few minor deviations: `.file ... ` `.- ` `.man mdoc.samples ` and `.differ ` only when called without arguments; `.Fn and ` `.impose ` an order on their argument lists and the `.[and] ` `.Fn macros ` have nesting limitations. All content macros are capable of recognizing and properly handling punctuation, provided each punctuation character is separated by a leading space. If an request is given:

.sptr, ptr),

The result is:

sptr, ptr),

The punctuation is not recognized and all is output in the literal font. If the punctuation is separated by a leading white space:

.sptr , ptr ) ,

The result is:

sptr , ptr

The punctuation is now recognized and is output in the default font distinguishing it from the strings in literal font.

To remove the special meaning from a punctuation character escape it with `&` Troff is limited as a macro language, and has difficulty when presented with a string containing a member of the mathematical, logical or quotation set:

{+,-,/,*,%,<,>,<=,>=,=,==,&,`,`,"}

The problem is that troff may assume it is supposed to actually perform the operation or evaluation suggested by the characters. To prevent the accidental evaluation of these characters, escape them with `&` Typical syntax is shown in the first content macro displayed below, `. `  

MANUAL DOMAIN

 

Address Macro

The address macro identifies an address construct of the form addr1[,addr2[,addr3]].

Usage: .address ...

.addr1
addr1
.addr1
addr1
.addr1 , file2
addr1 , file2
.f1 , f2 , f3:
f1 , f2 , f3
.addr ) ),
addr ) )

It is an error to call `.without ` arguments. `.is ` callable by other macros and is parsed.  

Author Name

The `.An macro ` is used to specify the name of the author of the item being documented, or the name of the author of the actual manual page. Any remaining arguments after the name information are assumed to be punctuation.

Usage: .An author_name

.An Joe Author
An Joe Author
.An Joe Author,
An Joe Author ,
.An Joe Author Aq nobody@FreeBSD.ORG
An Joe Author Aq nobody@FreeBSD.ORG
.An Joe Author ) ),
An Joe Author ) ) ,

The `.An macro ` is parsed and is callable. It is an error to call `.An without ` any arguments.  

Argument Macro

The `.file ... ` argument macro may be used whenever a command line argument is referenced.

Usage: .argument ...

.file ...
file ...
.file1
file1
.file1
file1
.file1 file2
file1 file2
.f1 f2 f3:
f1 f2 f3
.file ) ),
file ) )

If `.file ... ` is called without arguments `file ... ` is assumed. The `.file ... ` macro is parsed and is callable.  

Configuration Declaration (section four only)

The `.macro ` is used to demonstrate a config(8) declaration for a device interface in a section four manual. This macro accepts quoted arguments (double quotes only).

device le0 at scode?
produced by: `.device ` le0 at scode? .

 

Command Modifier

The command modifier is identical to the `.- ` (flag) command with the exception the `.macro ` does not assert a dash in front of every argument. Traditionally flags are marked by the preceding dash, some commands or subsets of commands do not use them. Command modifiers may also be specified in conjunction with interactive commands such as editor commands. See Sx Flags .  

Defined Variables

A variable which is defined in an include file is specified by the macro `. `

Usage: .defined_variable ...

.MAXHOSTNAMELEN
MAXHOSTNAMELEN
.TIOCGPGRP )
TIOCGPGRP

It is an error to call `.without ` arguments. `.is ` parsed and is callable.  

Errno`s (Section two only)

The `.Er errno ` macro specifies the error return value for section two library routines. The second example below shows `.Er used ` with the `.Bq general ` text domain macro, as it would be used in a section two manual page.

Usage: .Er ERRNOTYPE ...

.Er ENOENT
Er ENOENT
.Er ENOENT );
Er ENOENT ) ;
.Bq Er ENOTDIR
Bq Er ENOTDIR

It is an error to call `.Er without ` arguments. The `.Er macro ` is parsed and is callable.  

Environment Variables

The `.macro ` specifies an environment variable.

Usage: .argument ...

.DISPLAY
DISPLAY
.PATH
PATH
.PRINTER ) ),
PRINTER ) )

It is an error to call `.without ` arguments. The `.macro ` is parsed and is callable.  

Function Argument

The `.Fa macro ` is used to refer to function arguments (parameters) outside of the Sx SYNOPSIS section of the manual or inside the Sx SYNOPSIS section should a parameter list be too long for the `.Fn macro ` and the enclosure macros `.Fo and ` `.Fc must ` be used. `.Fa may ` also be used to refer to structure members.

Usage: .Fa function_argument ...

.Fa d_namlen ) ),
Fa d_namlen ) ) ,
.Fa iov_len
Fa iov_len

It is an error to call `.Fa without ` arguments. `.Fa is ` parsed and is callable.  

Function Declaration

The `.Fd macro ` is used in the Sx SYNOPSIS section with section two or three functions. The `.Fd macro ` does not call other macros and is not callable by other macros.

Usage: .Fd include_file (or defined variable)

In the Sx SYNOPSIS section a `.Fd request ` causes a line break if a function has already been presented and a break has not occurred. This leaves a nice vertical space in between the previous function call and the declaration for the next function.  

Flags

The `.- ` macro handles command line flags. It prepends a dash, `-` , to the flag. For interactive command flags, which are not prepended with a dash, the `.(command ` modifier) macro is identical, but without the dash.

Usage: .-argument ...

.-
-
.-cfv
-cfv
.-cfv
-cfv
.-s v t
-s v t
.--,
--
.-xyz ),
-xyz )

The `.- ` macro without any arguments results in a dash representing stdin/stdout. Note that giving `.- ` a single dash, will result in two dashes. The `.- ` macro is parsed and is callable.  

Functions (library routines)

The .Fn macro is modeled on ANSI C conventions.

Usage: .Fn [type] function [[type] parameters ... ]

.Fn getchar
Fn getchar
.Fn strlen ) ,
Fn strlen ) ,
.Fn *qint align*q *qconst * char *sptrs*q
Fn int align const * char *sptrs ,

It is an error to call `.Fn without ` any arguments. The `.Fn macro ` is parsed and is callable, note that any call to another macro signals the end of the `.Fn call ` (it will close-parenthesis at that point).

For functions that have more than eight parameters (and this is rare), the macros `.Fo (function ` open) and `.Fc (function ` close) may be used with `.Fa (function ` argument) to get around the limitation. For example:

.Fo "int res_mkquery" .Fa "int op" .Fa "char *dname" .Fa "int class" .Fa "int type" .Fa "char *data" .Fa "int datalen" .Fa "struct rrec *newrr" .Fa "char *buf" .Fa "int buflen" .Fc

Produces:

Fo int res_mkquery Fa int op Fa char *dname Fa int class Fa int type Fa char *data Fa int datalen Fa struct rrec *newrr Fa char *buf Fa int buflen Fc

The `.Fo and ` `.Fc macros ` are parsed and are callable. In the Sx SYNOPSIS section, the function will always begin at the beginning of line. If there is more than one function presented in the Sx SYNOPSIS section and a function type has not been given, a line break will occur, leaving a nice vertical space between the current function name and the one prior. At the moment, `.Fn does ` not check its word boundaries against troff line lengths and may split across a newline ungracefully. This will be fixed in the near future.  

Function Type

This macro is intended for the Sx SYNOPSIS section. It may be used anywhere else in the man page without problems, but its main purpose is to present the function type in kernel normal form for the Sx SYNOPSIS of sections two and three (it causes a line break allowing the function name to appear on the next line).

Usage: .Ft type ...

.Ft struct stat
Ft struct stat

The `.Ft request ` is not callable by other macros.  

Interactive Commands

The `.macro ` designates an interactive or internal command.

Usage: .argument ...

.:wq
:wq
.do while {...}
do while {...}
.setenv , unsetenv
setenv , unsetenv

It is an error to call `.without ` arguments. The `.macro ` is parsed and is callable.  

Name Macro

The `.man mdoc.samples ` macro is used for the document title or subject name. It has the peculiarity of remembering the first argument it was called with, which should always be the subject name of the page. When called without arguments, `.man mdoc.samples ` regurgitates this initial name for the sole purpose of making less work for the author. Note: a section two or three document function name is addressed with the `.man mdoc.samples ` in the Sx NAME section, and with `.Fn in ` the Sx SYNOPSIS and remaining sections. For interactive commands, such as the `while` command keyword in csh(1), the `.macro ` should be used. While the `.is ` nearly identical to `.man mdoc.samples ` it can not recall the first argument it was invoked with.

Usage: .argument ...

.mdoc.sample
mdoc.sample
.-mdoc
-mdoc
.foo ) ),
foo ) )
.man mdoc.samples
man mdoc.samples

The `.man mdoc.samples ` macro is parsed and is callable.  

Options

The `.[macro] ` places option brackets around the any remaining arguments on the command line, and places any trailing punctuation outside the brackets. The macros `.] ` and `.[may ` be used across one or more lines.

Usage: .[options ... ]

.[[
.[-k ]
] ]
[-k ]
.[-k ) . ]
[-k ]
.[-k kookfile ]
[-k kookfile ]
.[-k kookfile , ]
[-k kookfile ]
.[objfil [corfil ] ]
[objfil [corfil ] ]
.[-c objfil [corfil , ] ]
[-c objfil [corfil ] ]
.[word1 word2]
[word1 word2]

The `.] ` and `.[macros: `

.Oo .Op Fl k Ar kilobytes .Op Fl i Ar interval .Op Fl c Ar count .Oc

Produce: [[-k kilobytes ] [-i interval ] [-c count ] ]

The macros `.[,] ` `.] ` and `.[are ` parsed and are callable.  

Pathnames

The `.macro ` formats path or file names.

Usage: .pathname

./usr/share
/usr/share
./tmp/fooXXXXX )
/tmp/fooXXXXX )

The `.macro ` is parsed and is callable.  

Variables

Generic variable reference:

Usage: .variable ...

.count
count
.settimer
settimer
.int *prt ):
int *prt )
.char s ] ) ),
char s ] ) )

It is an error to call `.without ` any arguments. The `.macro ` is parsed and is callable.  

Manual Page Cross References

The `.macro ` expects the first argument to be a manual page name, and the second argument, if it exists, to be either a section page number or punctuation. Any remaining arguments are assumed to be punctuation.

Usage: .man_page[1,...,8]

.mdoc
mdoc
.mdoc
mdoc,
.mdoc(7)
mdoc(7)
.mdoc(7)))
mdoc(7))),

The `.macro ` is parsed and is callable. It is an error to call `.without ` any arguments.  

GENERAL TEXT DOMAIN

 

AT&T Macro

Usage: .At [v6 | v7 | 32v | V.1 | V.4] ...

.At
AT&T System
.AT&T System v6 .
AT&T System v6 .

The `.AT&T System ` macro is not parsed and not callable. It accepts at most two arguments.  

BSD Macro

Usage: .BSD [Version/release] ...

.Bx
BSD
.BSD 4.3 .
BSD 4.3

The `.BSD macro ` is parsed and is callable.  

FreeBSD Macro

Usage: .Fx Version.release ...

.Fx 2.2 .
Fx 2.2 .

The `.Fx macro ` is not parsed and not callable. It accepts at most two arguments.  

UNIX Macro

Usage: .UNIX

.Ux
UNIX

The `.UNIX ` macro is parsed and is callable.  

Enclosure and Quoting Macros

The concept of enclosure is similar to quoting. The object being to enclose one or more strings between a pair of characters like quotes or parentheses. The terms quoting and enclosure are used interchangeably throughout this document. Most of the one line enclosure macros end in small letter `q` to give a hint of quoting, but there are a few irregularities. For each enclosure macro there is also a pair of open and close macros which end in small letters `o` and `c` respectively. These can be used across one or more lines of text and while they have nesting limitations, the one line quote macros can be used inside of them.

Quote         Close   Open   Function        Result .Aq    .Ac     .Ao     Angle Bracket Enclosure<string>
.Bq     .Bc     .Bo     Bracket Enclosure       [string]
.Dq     .Dc     .Do     Double Quote    ``string``
        .Ec     .Eo     Enclose String (in XX)  XXstringXX
.Pq     .Pc     .Po     Parenthesis Enclosure   (string)
.Ql                     Quoted Literal  `st` or string
.Qq     .Qc     .Qo     Straight Double Quote   "string"
.Sq     .Sc     .So     Single Quote    `string`

Except for the irregular macros noted below, all of the quoting macros are parsed and callable. All handle punctuation properly, as long as it is presented one character at a time and separated by spaces. The quoting macros examine opening and closing punctuation to determine whether it comes before or after the enclosing string. This makes some nesting possible.

.Ec , .Eo These macros expect the first argument to be the
opening and closing strings respectively.
.`The`
quoted literal macro behaves differently for troff than nroff. If formatted with nroff, a quoted literal is always quoted. If formatted with troff, an item is only quoted if the width of the item is less than three constant width characters. This is to make short strings more visible where the font change to literal (constant width) is less noticeable.
.The prefix macro is not callable, but it is parsed:

.( Fa name2
becomes ( Fa name2

The `.(no ` space) macro performs the analogous suffix function.

Examples of quoting:

.Aq Aq
.Aq ctype.h ),
Aq Ar ctype.h ) ,
.Bq Bq
.Bq Greek , French .
Bq Em Greek , French .
.````
.``string abc .``
`` ``
``string abc``
.```^[A-Z]```
```^[A-Z]```
.`man`
mdoc `man` mdoc
.Qq Qq
.Qq string ) ,
Qq string ) ,
.Qq string ),
Qq string Ns ),
.``
.`string`
` `
`string`

For a good example of nested enclosure macros, see the `.[option] ` macro. It was created from the same underlying enclosure macros as those presented in the list above. The `. ` and `. ` extended argument list macros were also built from the same underlying routines and are a good example of -mdoc macro usage at its worst.  

No-[or Normal Text Macro]

The macro `.is ` a hack for words in a macro command line which should not be formatted and follows the conventional syntax for content macros.  

Space Macro

The `.macro ` eliminates unwanted spaces in between macro requests. It is useful for old style argument lists where there is no space between the flag and argument:

.[-I directory ]
produces [-I directory ]

Note: the `.macro ` always invokes the `.macro ` after eliminating the space unless another macro name follows it. The macro `.is ` parsed and is callable.  

Section Cross References

The `.Sx macro ` designates a reference to a section header within the same document. It is parsed and is callable.

.Sx FILES
Sx FILES

 

References and Citations

The following macros make a modest attempt to handle references. At best, the macros make it convenient to manually drop in a subset of refer style references.

.Rs
Reference Start. Causes a line break and begins collection of reference information until the reference end macro is read.
.Re
Reference End. The reference is printed.
.%A
Reference author name, one name per invocation.
.%B
Book title.
.%C
City/place.
.%D
Date.
.%J
Journal name.
.%N
Issue number.
.%O
Optional information.
.%P
Page number.
.%R
Report name.
.%T
Title of article.
.%V
Volume(s).

The macros beginning with `%` are not callable, and are parsed only for the trade name macro which returns to its caller. (And not very predictably at the moment either.) The purpose is to allow trade names to be pretty printed in troffNs/NsXrditroff output.  

Return Values

The `.Rv macro ` generates text for use in the Sx RETURN VALUES section.

Usage: .Rv [-std function]

`.Rv -std ` atexit will generate the following text:

Rv -std atexit

The -std option is valid only for manual page sections 2 and 3.  

Trade Names (or Acronyms and Type Names)

The trade name macro is generally a small caps macro for all upper case words longer than two characters.

Usage: .symbol ...

.DEC
DEC
.ASCII
ASCII

The `.macro ` is parsed and is callable by other macros.  

Extended Arguments

The `. ` and `. ` macros allow one to extend an argument list on a macro boundary. Argument lists cannot be extended within a macro which expects all of its arguments on one line such as `.[] `

Here is an example of `. ` using the space mode macro to turn spacing off:

.Sm off .It Xo Sy I Ar operation .No en Ar count No en .Xc .Sm on

Produces

I operation count

Another one:

.Sm off .It Cm S No / Ar old_pattern Xo .No / Ar new_pattern .No / Op Cm g .Xc .Sm on

Produces

S / old_pattern / new_pattern / [g ]

Another example of `. ` and using enclosure macros: Test the value of an variable.

.It Xo .Ic .ifndef .Oo &! Oc Ns Ar variable .Op Ar operator variable ... .Xc

Produces

.ifndef [! variable ] [operator variable ... ]

All of the above examples have used the `. ` macro on the argument list of the `. ` (list-item) macro. The extend macros are not used very often, and when they are it is usually to extend the list-item argument list. Unfortunately, this is also where the extend macros are the most finicky. In the first two examples, spacing was turned off; in the third, spacing was desired in part of the output but not all of it. To make these macros work in this situation make sure the `. ` and `. ` macros are placed as shown in the third example. If the `. ` macro is not alone on the `. ` argument list, spacing will be unpredictable. The `.(no ` space macro) must not occur as the first or last macro on a line in this situation. Out of 900 manual pages (about 1500 actual pages) currently released with BSD only fifteen use the `. ` macro.  

PAGE STRUCTURE DOMAIN

 

Section Headers

The first three `. 

section

` header macros list below are required in every man page. The remaining section headers are recommended at the discretion of the author writing the manual page. The `. 

macro

` can take up to nine arguments. It is parsed and but is not callable.

.
 

NAME

The `. 

NAME

` macro is mandatory. If not specified, the headers, footers and page layout defaults will not be set and things will be rather unpleasant. The Sx NAME section consists of at least three items. The first is the `.man mdoc.samples ` name macro naming the subject of the man page. The second is the Name Description macro, `. - , ` which separates the subject name from the third item, which is the description. The description should be the most terse and lucid possible, as the space available is small. .Sh SYNOPSIS The Sx SYNOPSIS section describes the typical usage of the subject of a man page. The macros required are either `.Nm` , `.Cd` , `.Fn` , (and possibly `.Fo` , `.Fc` , `.Fd` , `.Ft` macros). The function name macro `.Fn` is required for manual page sections 2 and 3, the command and general name macro `.man mdoc.samples ` is required for sections 1, 5, 6, 7, 8. Section 4 manuals require a `.Nm` , `.Fd` or a `.Cd` configuration device usage macro. Several other macros may be necessary to produce the synopsis line as shown below:

cat [-benstuv ] [- ] file ...

The following macros were used:

.cat
.[-benstuv ]
.[- ]
.file ...

Note The macros `.[,] ` `.- ` and `.file ... ` recognize the pipe bar character `` so a command line such as:

".[-a | -b ]

will not go orbital. Troff normally interprets a as a special operator. See Sx PREDEFINED STRINGS for a usable character in other situations. .Sh DESCRIPTION In most cases the first text in the Sx DESCRIPTION section is a brief paragraph on the command, function or file, followed by a lexical list of options and respective explanations. To create such a list, the `.

` begin-list, `.

list-item `
and `.

` end-list macros are used (see Sx Lists and Columns below).

The following `. 

section

` headers are part of the preferred manual page layout and must be used appropriately to maintain consistency. They are listed in the order in which they would be used.

.
 

ENVIRONMENT

The Sx ENVIRONMENT section should reveal any related environment variables and clues to their behavior and/or usage. .Sh EXAMPLES There are several ways to create examples. See the Sx EXAMPLES section below for details. .Sh FILES Files which are used or created by the man page subject should be listed via the `.macro ` in the Sx FILES section. .Sh SEE ALSO References to other material on the man page topic and cross references to other relevant man pages should be placed in the Sx SEE ALSO section. Cross references are specified using the `.macro. ` Cross references in the Sx SEE ALSO section should be sorted by section number, and then placed in alphabetical order and comma separated. For example:

ls(1), ps(1), group(5), passwd(5).

At this time refer(1) style references are not accommodated. .Sh CONFORMING TO If the command, library function or file adheres to a specific implementation such as St -p1003.2 or St -ansiC this should be noted here. If the command does not adhere to any standard, its history should be noted in the Sx HISTORY section. .Sh HISTORY Any command which does not adhere to any specific standards should be outlined historically in this section. .Sh AUTHORS Credits, if need be, should be placed here. .Sh DIAGNOSTICS Diagnostics from a command should be placed in this section. .Sh ERRORS Specific error handling, especially from library functions (man page sections 2 and 3) should go here. The `.Er macro ` is used to specify an errno. .Sh BUGS Blatant problems with the topic go here...

User specified `. 

sections

` may be added, for example, this section was set with:

.Sh PAGE STRUCTURE DOMAIN

 

Paragraphs and Line Spacing.

.

The `.

` paragraph command may be used to specify a line space where necessary. The macro is not necessary after a `.

 

or

` `. 

macro

` or before a `.

` macro. (The `.

` macro asserts a vertical distance unless the -compact flag is given).

 

Keeps

The only keep that is implemented at this time is for words. The macros are `.(begin-keep) ` and `.(end-keep). ` The only option that `.accepts ` is -words and is useful for preventing line breaks in the middle of options. In the example for the make command line arguments (see Sx What`s in a name ) , the keep prevented nroff from placing up the flag and the argument on separate lines. (Actually, the option macro used to prevent this from occurring, but was dropped when the decision (religious) was made to force right justified margins in troff as options in general look atrocious when spread across a sparse line. More work needs to be done with the keep macros, a -line option needs to be added.)  

Examples and Displays

There are five types of displays, a quickie one line indented display `.D1` , a quickie one line literal display `.
,
` and a block literal, block filled and block ragged which use the `. ` begin-display and `. ` end-display macros.

.D1 (D-one) Display one line of indented text.
This macro is parsed, but it is not callable.

-ldghfstru

The above was produced by: .

-ldghfstru
.
(D-ell)
Display one line of indented literal text. The `.
example
` macro has been used throughout this file. It allows the indent (display) of one line of text. Its default font is set to constant width (literal) however it is parsed and will recognized other macros. It is not callable however.

% ls -ldg /usr/local/bin

The above was produced by .

% ls -ldg /usr/local/bin
.
Begin-display. The `. ` display must be ended with the `. ` macro. Displays may be nested within displays and lists. `. ` has the following syntax:

".

The display-type must be one of the following four types and may have an offset specifier for indentation: `. `

-ragged
Display a block of text as typed, right (and left) margin edges are left ragged.
-filled
Display a filled (formatted) block. The block of text is formatted (the edges are filled - not left unjustified).
-literal
Display a literal block, useful for source code or simple tabbed or spaced text.
-file file_name
The file name following the -file flag is read and displayed. Literal mode is asserted and tabs are set at 8 constant width character intervals, however any troff/NsNm-mdoc commands in file will be processed.
-offset string
If -offset is specified with one of the following strings, the string is interpreted to indicate the level of indentation for the forthcoming block of text:

left
Align block on the current left margin, this is the default mode of `. `
center
Supposedly center the block. At this time unfortunately, the block merely gets left aligned about an imaginary center margin.
indent
Indents by one default indent value or tab. The default indent value is also used for the `.D1` display so one is guaranteed the two types of displays will line up. This indent is normally set to 6n or about two thirds of an inch (six constant width characters).
indent-two
Indents two times the default indent value.
right
This left aligns the block about two inches from the right side of the page. This macro needs work and perhaps may never do the right thing by troff.

".Ed"
End-display.

 

Font Modes

There are five macros for changing the appearance of the manual page text:

.Text may be stressed or emphasized with the `.
macro. ` The usual font for emphasis is italic.

Usage: .argument ...

.does not does not
.exceed 1024 . exceed 1024
.vide infra ) ) , vide infra ) )

The `.macro ` is parsed and is callable. It is an error to call `.without ` arguments.
.The `.
literal ` macro may be used for special characters, variable constants, anything which should be displayed as it would be typed.

Usage: .argument ...

.en
.M1 M2 M3; M1 M2 M3
.cntrl-D ), cntrl-D )
.1024 ... 1024 ...

The `.macro ` is parsed and is callable.
.The symbolic emphasis macro is generally a boldface macro in
either the symbolic sense or the traditional English usage.

Usage: .symbol ...

.Important Notice Important Notice

The `.macro ` is parsed and is callable. Arguments to `.may ` be quoted.
.Bf Begin font mode.
The `.Bf font ` mode must be ended with the `.Ef macro. ` Font modes may be nested within other font modes. `.Bf has ` the following syntax:

".Bf font-mode

The font-mode must be one of the following three types: `.Bf `

| -emphasis
Same as if the `.macro ` was used for the entire block of text.
| -literal
Same as if the `.macro ` was used for the entire block of text.
| -symbolic
Same as if the `.macro ` was used for the entire block of text.

".Ef"
End font mode.

 

Tagged Lists and Columns

There are several types of lists which may be initiated with the `.Bl` begin-list macro. Items within the list are specified with the `.It` item macro and each list must end with the `.El` macro. Lists may be nested within themselves and within displays. Columns may be used inside of lists, but lists are unproven inside of columns.

In addition, several list attributes may be specified such as the width of a tag, the list offset, and compactness (blank lines between items allowed or disallowed). Most of this document has been formatted with a tag style list (-tag ) For a change of pace, the list-type used to present the list-types is an over-hanging list (-ohang ) This type of list is quite popular with TeX users, but might look a bit funny after having read many pages of tagged lists. The following list types are accepted by `.Bl` :

-bullet
-item
-enum
These three are the simplest types of lists. Once the `.Bl` macro has been given, items in the list are merely indicated by a line consisting solely of the `.It` macro. For example, the source text for a simple enumerated list would look like:

.Bl -enum -compact .It Item one goes here. .It And item two here. .It Lastly item three goes here. .El

The results:

  1. Item one goes here.
  2. And item two here.
  3. Lastly item three goes here.

A simple bullet list construction:

.Bl -bullet -compact .It Bullet one goes here. .It Bullet two here. .El

Produces:

  • Bullet one goes here.
  • Bullet two here.

-tag
-diag
-hang
-ohang
-inset
These list-types collect arguments specified with the `.
macro `
and create a label which may be inset into the forthcoming text, hanged from the forthcoming text, overhanged from above and not indented or tagged This list was constructed with the `-ohang ` list-type. The `.
macro `
is parsed only for the inset, hang and tag list-types and is not callable. Here is an example of inset labels:

Tag
The tagged list (also called a tagged paragraph) is the most common type of list used in the Berkeley manuals.
Diag
Diag lists create section four diagnostic lists and are similar to inset lists except callable macros are ignored.
Hang
Hanged labels are a matter of taste.
Ohang
Overhanging labels are nice when space is constrained.
Inset
Inset labels are useful for controlling blocks of paragraphs and are valuable for converting -mdoc manuals to other formats.

Here is the source text which produced the above example:

.Bl -inset -offset indent .It Em Tag The tagged list (also called a tagged paragraph) is the most common type of list used in the Berkeley manuals. .It Em Diag Diag lists create section four diagnostic lists and are similar to inset lists except callable macros are ignored. .It Em Hang Hanged labels are a matter of taste. .It Em Ohang Overhanging labels are nice when space is constrained. .It Em Inset Inset labels are useful for controlling blocks of paragraphs and are valuable for converting .Nm -mdoc manuals to other formats. .El

Here is a hanged list with two items:

Hanged
labels appear similar to tagged lists when the label is smaller than the label width.
Longer hanged list labels
blend in to the paragraph unlike tagged paragraph labels.

And the unformatted text which created it:

.Bl -hang -offset indent .It Em Hanged labels appear similar to tagged lists when the label is smaller than the label width. .It Em Longer hanged list labels blend in to the paragraph unlike tagged paragraph labels. .El

The tagged list which follows uses an optional width specifier to control the width of the tag.

SL
sleep time of the process (seconds blocked)
PAGEIN
number of disk I/O `s resulting from references by the process to pages not loaded in core.
UID
numerical user-id of process owner
PPID
numerical id of parent of process process priority (non-positive when in non-interruptible wait)

The raw text:

.Bl -tag -width "PAGEIN" -compact -offset indent .It SL sleep time of the process (seconds blocked) .It PAGEIN number of disk .Tn I/O Ns `s resulting from references by the process to pages not loaded in core. .It UID numerical user-id of process owner .It PPID numerical id of parent of process process priority (non-positive when in non-interruptible wait) .El

Acceptable width specifiers:

-width Fl
sets the width to the default width for a flag. All callable macros have a default width value. The `.- ` value is presently set to ten constant width characters or about five sixth of an inch.
-width 24n
sets the width to 24 constant width characters or about two inches. The `n` is absolutely necessary for the scaling to work correctly.
-width ENAMETOOLONG
sets width to the constant width length of the string given.
-width *qint mkfifo*q
again, the width is set to the constant width of the string given.

If a width is not specified for the tag list type, the first time `.

is `
invoked, an attempt is made to determine an appropriate width. If the first argument to `.It` is a callable macro, the default width for that macro will be used as if the macro name had been supplied as the width. However, if another item in the list is given with a different callable macro name, a new and nested list is assumed.
 

PREDEFINED STRINGS

The following strings are predefined as may be used by preceding with the troff string interpreting sequence `*(xx` where xx is the name of the defined string or as `*x` where x is the name of the string. The interpreting sequence may be used any where in the text.

String        Nroff   Troff
<= Ta <= Ta
>= Ta >= Ta
Rq Ta `` Ta
Lq Ta `` Ta
ua Ta ^ Ta
aa Ta ` Ta
ga Ta ` Ta
q Ta Ta
Pi Ta pi Ta
Ne Ta != Ta
Le Ta <= Ta
Ge Ta >= Ta
Lt Ta < Ta
Gt Ta > Ta
Pm Ta +- Ta
If Ta infinity Ta
Na Ta NaN Ta
Ba Ta | Ta

Note

The string named `q` should be written as `*q` since it is only one char.  

DIAGNOSTICS

The debugging facilities for -mdoc are limited, but can help detect subtle errors such as the collision of an argument name with an internal register or macro name. (A what?) A register is an arithmetic storage class for troff with a one or two character name. All registers internal to -mdoc for troff and ditroff are two characters and of the form <upper_case><lower_case> such as `file ... ` <lower_case><upper_case> as `aR` or <upper or lower letter><digit> as `C1` And adding to the muddle, troff has its own internal registers all of which are either two lower case characters or a dot plus a letter or meta-character character. In one of the introduction examples, it was shown how to prevent the interpretation of a macro name with the escape sequence `&` This is sufficient for the internal register names also.

If a non-escaped register name is given in the argument list of a request unpredictable behavior will occur. In general, any time huge portions of text do not appear where expected in the output, or small strings such as list tags disappear, chances are there is a misunderstanding about an argument type in the argument list. Your mother never intended for you to remember this evil stuff - so here is a way to find out whether or not your arguments are valid: The `.Db (debug) ` macro displays the interpretation of the argument list for most macros. Macros such as the `.

` (paragraph) macro do not contain debugging information. All of the callable macros do, and it is strongly advised whenever in doubt, turn on the `.Db macro. `

Usage: .Db [on | off]

An example of a portion of text with the debug macro placed above and below an artificially created problem (a flag argument `aC` which should be `&aC` in order to work):

.Db on .Op Fl aC Ar file ) .Db off

The resulting output:

DEBUGGING ON DEBUG(argv) MACRO: `.Op` Line #: 2 Argc: 1 Argv: `Fl` Length: 2 Space: `` Class: Executable Argc: 2 Argv: `aC` Length: 2 Space: `` Class: Executable Argc: 3 Argv: `Ar` Length: 2 Space: `` Class: Executable Argc: 4 Argv: `file` Length: 4 Space: ` ` Class: String Argc: 5 Argv: `)` Length: 1 Space: ` ` Class: Closing Punctuation or suffix MACRO REQUEST: .Op Fl aC Ar file ) DEBUGGING OFF

</BLOCK

move

NAME

MOVE - position a cursor

 

SYNOPSIS

MOVE [ direction { FROM | IN } ] cursorname

 

DESCRIPTION

MOVE repositions a cursor without retrieving any data. MOVE works exactly like the FETCH command, except it only positions the cursor and does not return rows.

Refer to FETCH [fetch(7)] for details on syntax and usage.  

OUTPUTS

On successful completion, a MOVE command returns a command tag of the form

MOVE count

The count is the number of rows moved over (possibly zero).  

EXAMPLES

BEGIN WORK; DECLARE liahona CURSOR FOR SELECT * FROM films; -- Skip the first 5 rows: MOVE FORWARD 5 IN liahona; MOVE 5 -- Fetch the 6th row from the cursor liahona: FETCH 1 FROM liahona; code | title | did | date_prod | kind | len -------+--------+-----+------------+--------+------- P_303 | 48 Hrs | 103 | 1982-10-22 | Action | 01:37 (1 row) -- Close the cursor liahona and end the transaction: CLOSE liahona; COMMIT WORK;

 

COMPATIBILITY

There is no MOVE statement in the SQL standard.


Please review our Privacy Policy
and Terms of Use .