summaryrefslogtreecommitdiffstats
path: root/doc/sphinx/Pacemaker_Development/c.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/sphinx/Pacemaker_Development/c.rst')
-rw-r--r--doc/sphinx/Pacemaker_Development/c.rst14
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/sphinx/Pacemaker_Development/c.rst b/doc/sphinx/Pacemaker_Development/c.rst
index 66ce3b2..b03ddae 100644
--- a/doc/sphinx/Pacemaker_Development/c.rst
+++ b/doc/sphinx/Pacemaker_Development/c.rst
@@ -225,8 +225,8 @@ a ``GHashTable *`` member, the argument should be marked as ``[in,out]`` if the
function inserts data into the table, even if the struct members themselves are
not changed. However, an argument is not ``[in,out]`` if something reachable
via the argument is modified via a separate argument. For example, both
-``pe_resource_t`` and ``pe_node_t`` contain pointers to their
-``pe_working_set_t`` and thus indirectly to each other, but if the function
+``pcmk_resource_t`` and ``pcmk_node_t`` contain pointers to their
+``pcmk_scheduler_t`` and thus indirectly to each other, but if the function
modifies the resource via the resource argument, the node argument does not
have to be ``[in,out]``.
@@ -745,10 +745,20 @@ readability and logging consistency.
Functions
#########
+Function Naming
+_______________
+
Function names should be unique across the entire project, to allow for
individual tracing via ``PCMK_trace_functions``, and make it easier to search
code and follow detail logs.
+A common function signature is a comparison function that returns 0 if its
+arguments are equal for sorting purposes, -1 if the first argument should sort
+first, and 1 is the second argument should sort first. Such a function should
+have ``cmp`` in its name, to parallel ``strcmp()``; ``sort`` should only be
+used in the names of functions that sort an entire list (typically using a
+``cmp`` function).
+
Function Definitions
____________________