Search the Catalog
DocBook: The Definitive Guide

DocBook: The Definitive Guide

By Norman Walsh & Leonard Muellner
1st Edition October 1999
1-56592-580-7, Order Number: 5807
652 pages, $36.95 , Includes CD-ROM

FuncParams

Name

FuncParams -- Parameters for a function referenced through a function pointer in a synopsis

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

Common 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.

(4.0) 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.

Parents

These elements contain FuncParams: ParamDef.

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


oreilly.com Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts
International | About O'Reilly | Affiliated Companies | Privacy Policy

© 2001, O'Reilly & Associates, Inc.