[libvirt] [PATCH v2] Document preferred naming conventions

Jiri Denemark jdenemar at redhat.com
Fri Mar 3 18:57:24 UTC 2017


On Fri, Mar 03, 2017 at 17:47:23 +0000, Daniel P. Berrange wrote:
> This documents the preferred conventions for naming files,
> structs, enums, typedefs and functions.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> 
> Changed in v2:
> 
>  - Fix typo
>  - Add macro docs
>  - Clarify that $VERB is always last in function/macro names

Hmm, so what do we do if there is an object, an action, and a subject?
Typically accessors which are designed to return some specific part of
the object. For example,

    virQEMUCapsGetDefaultMachine
    \         / | \            /
       object   |    subject
                |
                `- action (verb)

Are we supposed to name such function as virQEMUCapsDefaultMachineGet?
While it is certainly possible, it just doesn't read well.

Jirka

P.S. No nit-picking intended, I'm just trying to avoid future flames on
this matter.




More information about the libvir-list mailing list