
B Documentation Guidelines
B.5 Format and Style
165
B
Example input:
\ts
Key | Name | Meaning
----|------------+--------
\& | ampersand | bitwise AND
\| | pipe / bar | bitwise OR
# | pound sign | bitwise NAND
\te
Resulting output:
Code Examples, Syntax Displays, and Diagrams
Code Examples
Display code or terminal input/output with the \cs and \ce tags.
Text between these tags is interpreted as preformatted text; therefore, markup such
as angle brackets (< and >) and backslashes (\) is not interpreted, but passed
through as typed. Thus markup characters must not be escaped with a backslash.
The one exception is that /@ and @/ are converted to /* and */. In C files, all example
comments should be bracketed with /@ and @/. C compilers are generally
unfriendly toward nested comments.
Code displays should be indented by four spaces from column 1. The following
example shows how a code example would appear in a C routine section:
*\cs
* /@ Get file status information @/
*
* struct stat statStruct;
* fd = open ("file", READ);
* status = ioctl (fd, FIOFSTATGET, &statStruct);
*\ce
*
Resulting output:
/* Get file status information */
struct stat statStruct;
fd = open ("file", READ);
status = ioctl (fd, FIOFSTATGET, &statStruct);
Key Name Meaning
& ampersand bitwise AND
|pipe / barbitwise OR
# pound sign bitwise NAND
Comentários a estes Manuais