| DocBook: The Definitive Guide Version 2.0.8 (Alpha)

# funcparams

$Revision: 1.3 $

$Date: 2002/06/12 11:18:10 $

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|methodname|
     interfacename|exceptionname|ooclass|oointerface|ooexception|
     command|computeroutput|database|email|envar|errorcode|errorname|
     errortype|errortext|filename|function|guibutton|guiicon|guilabel|
     guimenu|guimenuitem|guisubmenu|hardware|interface|keycap|keycode|
     keycombo|keysym|literal|constant|markup|medialabel|menuchoice|
     mousebutton|option|optional|parameter|prompt|property|
     replaceable|returnvalue|sgmltag|structfield|structname|symbol|
     systemitem|token|type|userinput|varname|nonterminal|anchor|
     remark|subscript|superscript|inlinegraphic|inlinemediaobject|
     indexterm|beginpage)*

### Attributes

Common attributes

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

### Parents

These elements contain funcparams: `methodparam`, `paramdef`.

### Children

The following elements occur in funcparams: `action`, `anchor`, `application`, `beginpage`, `classname`, `command`, `computeroutput`, `constant`, `database`, `email`, `envar`, `errorcode`, `errorname`, `errortext`, `errortype`, `exceptionname`, `filename`, `function`, `guibutton`, `guiicon`, `guilabel`, `guimenu`, `guimenuitem`, `guisubmenu`, `hardware`, `indexterm`, `inlinegraphic`, `inlinemediaobject`, `interface`, `interfacename`, `keycap`, `keycode`, `keycombo`, `keysym`, `link`, `literal`, `markup`, `medialabel`, `menuchoice`, `methodname`, `mousebutton`, `nonterminal`, `olink`, `ooclass`, `ooexception`, `oointerface`, `option`, `optional`, `parameter`, `prompt`, `property`, `remark`, `replaceable`, `returnvalue`, `sgmltag`, `structfield`, `structname`, `subscript`, `superscript`, `symbol`, `systemitem`, `token`, `type`, `ulink`, `userinput`, `varname`.

## See Also

`funcdef`, `funcprototype`, `funcsynopsisinfo`, `function`, `paramdef`, `parameter`, `returnvalue`, `varargs`, `void`.

## Examples

    <!DOCTYPE funcsynopsis PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
              "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
    <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(` | dataptr, |
| left, |
| right, |
| (* comp)`)`; |

void * | dataptr[];
int | left;
int | right;
int (* comp) `(`void *, void *`)`;

For additional examples, see also `funcsynopsis`.

funcdef |  | funcprototype

Copyright © 1999, 2000, 2001, 2002 O'Reilly & Associates, Inc. All rights reserved.