O'Reilly logo

DocBook 5: The Definitive Guide by Richard L. Hamilton, Norman Walsh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

funcparams — Parameters for a function referenced through a function pointer in a synopsis

Synopsis

funcparams ::= (text | phrase db._phrase | replaceable | Graphic inlines | Indexing inlines | Linking inlines | Ubiquitous inlines)*

Description

In some programming languages (such as 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 expectations, see funcsynopsis.

See Also

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

Examples

<article xmlns='http://docbook.org/ns/docbook'> <title>Example funcparams</title> <funcsynopsis> <funcprototype> <funcdef>void <function>qsort</function></funcdef> <paramdef>void *<parameter>dataptr</parameter>[]</paramdef> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required