mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
doc: Document function pointer source code style
as implemented in 1356f78ea9
This commit is contained in:
@@ -964,5 +964,23 @@ handle_sighup(SIGNAL_ARGS)
|
|||||||
</para>
|
</para>
|
||||||
</simplesect>
|
</simplesect>
|
||||||
|
|
||||||
|
<simplesect>
|
||||||
|
<title>Calling Function Pointers</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
For clarity, it is preferred to explicitly dereference a function pointer
|
||||||
|
when calling the pointed-to function if the pointer is a simple variable,
|
||||||
|
for example:
|
||||||
|
<programlisting>
|
||||||
|
(*emit_log_hook) (edata);
|
||||||
|
</programlisting>
|
||||||
|
(even though <literal>emit_log_hook(edata)</literal> would also work).
|
||||||
|
When the function pointer is part of a structure, then the extra
|
||||||
|
punctuation can and usually should be omitted, for example:
|
||||||
|
<programlisting>
|
||||||
|
paramInfo->paramFetch(paramInfo, paramId);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</simplesect>
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
Reference in New Issue
Block a user