Whole document tree
    

Whole document tree

FuncSynopsis

FuncSynopsis

Name

FuncSynopsis -- Synopsis of a Function

Content Model

  FuncSynopsisInfo?,
  (FuncPrototype+ | (FuncDef, (Void | VarArgs
  | ParamDef+))+)
  ,
  FuncSynopsisInfo?

Attributes

This element has common and Role attributes.

Tag Minimization

Both the start- and end-tags are required for this element.

Description

Synopsis of a Function that shows a prototype or definition indicating a function's name. A FuncSynopsis also indicates the data type of its return value, and the positions, purposes, and data types of its parameters. A FuncSynopsis begins with an optional FuncSynopsisInfo, which contains additional information about the synopsis that follows; line breaks and leading white space are significant within a FuncSynopsisInfo. This is followed by one or more blocks defining a function (you might use more than one for connecting related sets of functions). Each of these blocks consists of a required FuncDef, followed by a Void, a VarArgs, or one or more ParamDefs. Void, Varargs, and and ParamDef are mutually exclusive. A FuncSynopsisInfo may optionally follow these blocks.

Usage

You should supply no specific information on the arguments before the ellipsis that VarArgs should output when rendered, but if it is necessary to represent the ellipsis in the source it may ben enclosed within a final ParamDef. FuncSynopsis has common and Label attributes.

Processing Expectations

The processing application is expected to provide all parentheses, semicolons, and the like. The exceptions are any spaces surrounding function and parameter names, any parentheses or commas or spacing inside lists of data types of parameters that are pointers to functions, and the parentheses around those parameter names themselves. These exceptions are a bit confusing in the unusual case (pointers to functions), but they greatly simplify tagging and still allow either K&R style or ANSI C style to be produced (assuming writers have cooperated in supplying enough information for ANSI).

Children

FuncSynopsis contains these elements: FuncDef, FuncPrototype, FuncSynopsisInfo, ParamDef, VarArgs, Void.

In some contexts, additional elements may be allowed by inclusions in parent elements. Similarly, in some contexts, some of these elements may be invalid due to exclusions in parent elements.

Attributes

Label

Label holds an identifying number or string to be output in some manner when the element it is applied to is rendered.

Examples

<FUNCSYNOPSIS>
<FUNCSYNOPSISINFO>#include &lt;stdlib.h></FUNCSYNOPSISINFO>
<FUNCDEF>double <FUNCTION>atof</FUNCTION></FUNCDEF>
<PARAMDEF>const char *<PARAMETER>nptr</PARAMETER></PARAMDEF>
</FUNCSYNOPSIS>
<FUNCSYNOPSIS>
<FUNCSYNOPSISINFO>TODO TBS
</FUNCSYNOPSISINFO>
<FUNCPROTOTYPE>
<FUNCDEF>TODO TBS
</FUNCDEF>
<VOID>
</FUNCPROTOTYPE>
</FUNCSYNOPSIS>