This document contains:
This document:
Some of the document is aimed at being legal for !DocBook-XML. If we decide to do this more consistently, the following are all issues:
Question: what does the <DATE> tag mean (in <REFSYNOPSISDIVINFO>, <REFSECT1INFO>, and so on)? Is it the date that particular page was last modified (in which case we have a lot of habits to change if we want this to get done manually)? Do we really want these <DATE> tags (I suspect not)?
In addition to the obvious, like displaying italics/typewriter/etc with some sort of usefulness, markup is intended for being used in an index (most obviously, things like <command> and <function>). The following sections give specifics on things which are marked up. Some things which treated as ordinary text (that is, not marked up or spelled differently from customary English usage) are:
In general, all markup should contain meta-information about what is being marked up and why. There is a difference between, for exmple, <emphasis>avail_in</emphasis>, <varname>avail_in</varname>, <structfield>avail_in</structfield> and <parameter>avail_in</parameter>, even though all (might) have the exact same appearance in the rendered text page. NEVER use <emphasis> tags unless all you are doing is stressing a word.
The following <CMDSYNOPSIS> and <FUNCSYNOPSIS> tag structures
A command (fictional) requiring:
Desired effect
abc [-d] [-e file] [month [year]] [-f | -g] {directory} group file...
Syntax
<CMDSYNOPSIS> : <COMMAND>abc</COMMAND> : <ARG>-d</ARG> : <ARG>-e <REPLACEABLE>file</REPLACEABLE></ARG> : <ARG>month <ARG>year</ARG></ARG> : <GROUP> : <ARG>-f</ARG> : <ARG>-g</ARG> : </GROUP> : <ARG CHOICE=REQ><REPLACEABLE>directory</REPLACEABLE></ARG> : <ARG CHOICE=PLAIN><REPLACEABLE>group</REPLACEABLE></ARG> : <ARG REP=REPEAT CHOICE=PLAIN><REPLACEABLE>file</REPLACEABLE></ARG> </CMDSYNOPSIS>
Notes The use of <replaceable> tags is actually optional, and may be phased out. In a <cmdsynopsis>, an <arg> is always replaceable, and will always be rendered consistently. Adding <replaceable> actually ends up obscuring information.
---
Function requiring header file
Desired effect
int abc(int arg1);
Syntax
<FUNCSYNOPSIS> <FUNCSYNOPSISINFO> </FUNCSYNOPSISINFO> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <PARAMDEF>int : <PARAMETER><REPLACEABLE>arg1</REPLACEABLE></PARAMETER></PARAMDEF> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
mksynopperl script. Since the database does not contain argument names, mksynop invents names "arg0", "arg1" etc, and these will need subsequent editing.
---
Desired effect
int abc(int arg1, int arg2);
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int <FUNCTION>abc</FUNCTION></FUNCDEF> : <PARAMDEF>int : <PARAMETER><REPLACEABLE>arg1</REPLACEABLE></PARAMETER></PARAMDEF> : <PARAMDEF>int : <PARAMETER><REPLACEABLE>arg2</REPLACEABLE></PARAMETER></PARAMDEF> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
---
Desired effect
int abc(...);
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <VARARGS> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
---
Desired effect
int abc(char *arg1, ...);
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <PARAMDEF>char * : <PARAMETER><REPLACEABLE>arg1</REPLACEABLE></PARAMETER></PARAMDEF> : <VARARGS> : </FUNCPROTOTYPE> </FUNCSYNOPSIS> '''Notes''' * The target of this illustration is in the text: char *arg1, ... * Ellipses are used to specify variable arguments only when the function also contains absolute arguments. (See "Function requiring variable arguments only" for alternate specification of variable arguments.) '''SPECIAL LSB EXTENSION NOTE''' The syntax above is not officially part of !DocBook 4.1 (though it is accepted at later version). In order for this to process correctly, the book ''must'' start with the following SGML declarations: <pre> <!DOCTYPE BOOK PUBLIC "-//OASIS//DTD [[DocBook]] V4.1//EN" [ <!ENTITY % funcprototype.element "IGNORE"> <!ELEMENT [[FuncPrototype]] - O ([[FuncDef]], (Void | ([[ParamDef]]*, [[VarArgs]]?)))>
---
Desired effect
int abc(void);
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <VOID> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
---
Desired effect
struct hostent *abc(const char arg1);
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>struct : <FUNCTION> : <STRUCTNAME>hostent</STRUCTNAME> *abc</FUNCTION></FUNCDEF> : <PARAMDEF>const char : <PARAMETER><REPLACEABLE>arg1</REPLACEABLE></PARAMETER></PARAMDEF> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
---
Desired effect
int abc(const char * restrict arg1, struct hostent * restrict arg2');
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <PARAMDEF>const char * restrict : <PARAMETER><REPLACEABLE>arg1</REPLACEABLE></PARAMETER></PARAMDEF> : <PARAMDEF>struct hostent * restrict : <PARAMETER>arg2</PARAMETER></PARAMDEF> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
---
Desired effect
int abc(int def, int (*ghi) (const char *, int));
Syntax
<FUNCSYNOPSIS> : <FUNCPROTOTYPE> : <FUNCDEF>int : <FUNCTION>abc</FUNCTION></FUNCDEF> : <PARAMDEF>int : <PARAMETER><REPLACEABLE>def</REPLACEABLE></PARAMETER></PARAMDEF> : <PARAMDEF>int : <FUNCPARAMS>*ghi</FUNCPARAMS> : <FUNCPARAMS>const char *, int</FUNCPARAMS></PARAMDEF> : </FUNCPROTOTYPE> </FUNCSYNOPSIS>
Notes
Desired effect
struct abc_status
{
: const char *abc_field1;
: void *abc_field2;
};
Syntax
<SYNOPSIS>
struct <STRUCTNAME>abc_status</STRUCTNAME>
{
: const char <STRUCTFIELD>*abc_field1</STRUCTFIELD>;
: void <STRUCTFIELD>*abc_field2</STRUCTFIELD>;
};
</SYNOPSIS>
Notes
---
Desired effect
typedef struct
{
: const char *abc_field1;
: void *abc_field2;
: const char *abc_field3;
: void *abc_field4;
} abc_info;
Syntax
<SYNOPSIS>
typedef struct
{
: const char <STRUCTFIELD>*abc_field1</STRUCTFIELD>;
: void <STRUCTFIELD>*abc_field2</STRUCTFIELD>;
: const char <STRUCTFIELD>*abc_field3</STRUCTFIELD>;
: void <STRUCTFIELD>*abc_field4</STRUCTFIELD>;
} <STRUCTNAME>abc_info</STRUCTNAME>;
</SYNOPSIS>
Notes
---
Desired effect
int __xyz;
Syntax
<FUNCSYNOPSIS> <FUNCSYNOPSISINFO> </FUNCSYNOPSISINFO> </FUNCSYNOPSIS> <SYNOPSIS> int <VARNAME>__xyz</VARNAME>; </SYNOPSIS>
Notes
---
Return Values:
<PARA> On success, <RETURNVALUE>0</RETURNVALUE> is returned. On error, <RETURNVALUE>-1</RETURNVALUE> is returned and the global variable <VARNAME>errno</VARNAME> is set appropriately. </PARA>
Cross references to POSIX:
<PARA> <FUNCTION>open</FUNCTION> is as specified in <XREF LINKEND="STD.SUSv3">, but with differences as listed below. </PARA>
Cross reference to POSIX with extensions:
<PARA> <FUNCTION>daylight</FUNCTION> is as specified in <XREF LINKEND="STD.SUSv3">, with the following extensions. </PARA>
Binary only interfaces:
<PARA> <FUNCTION>__getpagesize</FUNCTION> is not in the source standard; it is only in the binary standard. </PARA>
Aliases:
<PARA> <FUNCTION>__getpagesize</FUNCTION> has the same specification as <FUNCTION>getpagesize</FUNCTION>. </PARA> <PARA> <FUNCTION>__getpagesize</FUNCTION> is an alias for <FUNCTION>getpagesize</FUNCTION> - get current page size. </PARA>
For these types, <VARNAME> is used in the same context as <FUNCTION> for functions and interfaces. Example:
<PARA> <VARNAME>__environ</VARNAME> is an alias for <VARNAME>environ</VARNAME> - user environment. </PARA>
<REFNAMEDIV> <REFNAME>fstatfs </REFNAME> <REFPURPOSE>(deprecated) </REFPURPOSE> </REFNAMEDIV> <PARA> <FUNCTION>__dcgettext</FUNCTION> has been deprecated from the <ACRONYM>LSB</ACRONYM> because it is no longer used by <FUNCTION>dcgettext</FUNCTION>. Originally, it was intended only for the binary standard. </PARA> <PARA> <FUNCTION>fstatfs</FUNCTION> is expected to disappear from a future version of the <ACRONYM>LSB</ACRONYM>; applications should call the <FUNCTION>fstatvfs</FUNCTION> interface. </PARA>
To add comments to this page, click on [wiki:WrittenSpecificationStyle/Comments User Comments] and select edit.
[[Include(WrittenSpecificationStyle/Comments)]]