DocBook: The Definitive GuideBy Norman Walsh & Leonard Muellner1st Edition October 1999 1-56592-580-7, Order Number: 5807 652 pages, $36.95 , Includes CD-ROM |
FuncParams
Synopsis
Mixed Content Model
FuncParams ::= ((#PCDATA|Link|OLink|ULink|Action|Application|ClassName|Command| ComputerOutput|Database|Email|EnVar|ErrorCode|ErrorName| ErrorType|Filename|Function|GUIButton|GUIIcon|GUILabel|GUIMenu| GUIMenuItem|GUISubmenu|Hardware|Interface|InterfaceDefinition| KeyCap|KeyCode|KeyCombo|KeySym|Literal|Constant|Markup| MediaLabel|MenuChoice|MouseButton|MsgText|Option|Optional| Parameter|Prompt|Property|Replaceable|ReturnValue|SGMLTag| StructField|StructName|Symbol|SystemItem|Token|Type|UserInput| VarName|Anchor|Comment|Subscript|Superscript|InlineGraphic| InlineMediaObject|IndexTerm)*)Attributes
Tag Minimization
Both the start- and end-tags are required for this element.
Description
In some programming languages (like C), it is possible for a function to have a pointer to another function as one of its parameters. In the syntax summary for such a function, the FuncParams element provides a wrapper for the function pointer.
For example, the following prototype describes the function sort, which takes two parameters. The first parameter, arr, is an array of integers. The second parameter is a pointer to a function, comp that returns an int. The comp function takes two parameters, both of type int *:
<funcprototype> <funcdef>void <function>sort</function></funcdef> <paramdef>int *<parameter>arr</parameter>[]</paramdef> <paramdef>int <parameter>(* comp)</parameter> <funcparams>int *, int *</funcparams></paramdef> </funcprototype>Processing expectations
Formatted inline. For a complete description of the processing expecations, see FuncSynopsis.
Future Changes
The InterfaceDefinition element will be discarded in DocBook V4.0. It will no longer be available in the content model of this element.
Children
The following elements occur in FuncParams: Action, Anchor, Application, ClassName, Command, Comment, ComputerOutput, Constant, Database, Email, EnVar, ErrorCode, ErrorName, ErrorType, Filename, Function, GUIButton, GUIIcon, GUILabel, GUIMenu, GUIMenuItem, GUISubmenu, Hardware, IndexTerm, InlineGraphic, InlineMediaObject, Interface, InterfaceDefinition, KeyCap, KeyCode, KeyCombo, KeySym, Link, Literal, Markup, MediaLabel, MenuChoice, MouseButton, MsgText, OLink, Option, Optional, Parameter, Prompt, Property, Replaceable, ReturnValue, SGMLTag, StructField, StructName, Subscript, Superscript, Symbol, SystemItem, Token, Type, ULink, UserInput, VarName.
In some contexts, the following elements are allowed anywhere: BeginPage, IndexTerm.
In some contexts, the following elements are excluded: IndexTerm.
See Also
FuncDef, FuncPrototype, FuncSynopsisInfo, Function, ParamDef, Parameter, ReturnValue, VarArgs, Void
Examples
<!DOCTYPE funcsynopsis PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> <funcsynopsis> <funcprototype> <funcdef>void <function>qsort</function></funcdef> <paramdef>void *<parameter>dataptr</parameter>[]</paramdef> <paramdef>int <parameter>left</parameter></paramdef> <paramdef>int <parameter>right</parameter></paramdef> <paramdef>int <parameter>(* comp)</parameter> <funcparams>void *, void *</funcparams></paramdef> </funcprototype> </funcsynopsis>
void qsort
(void *dataptr[], int left, int right, int (* comp) (void *, void *));For additional examples, see also FuncSynopsis.
Back to: DocBook: The Definitive Guide
© 2001, O'Reilly & Associates, Inc.