[libvirt PATCH 01/14] docs: coding-style: Clarify on virXXXPtr types

Tim Wiederhake posted 14 patches 4 years ago
[libvirt PATCH 01/14] docs: coding-style: Clarify on virXXXPtr types
Posted by Tim Wiederhake 4 years ago
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
---
 docs/coding-style.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/coding-style.rst b/docs/coding-style.rst
index 470c61860f..ab7634dc14 100644
--- a/docs/coding-style.rst
+++ b/docs/coding-style.rst
@@ -54,6 +54,7 @@ Struct type names
    and each following word should have its first letter in
    uppercase. The struct name should be the same as the typedef
    name with a leading underscore.
+
    ::
 
      typedef struct _virHashTable virHashTable;
@@ -61,6 +62,10 @@ Struct type names
          ...
      };
 
+   Historically, libvirt also declared pointer types 'virXXXPtr',
+   which have been dropped where possible. Do not introduce new
+   such types.
+
 Function names
    All functions should have a 'vir' prefix in their name,
    followed by one or more words with first letter of each word
-- 
2.31.1

Re: [libvirt PATCH 01/14] docs: coding-style: Clarify on virXXXPtr types
Posted by Michal Prívozník 4 years ago
On 1/12/22 14:10, Tim Wiederhake wrote:
> Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
> ---
>  docs/coding-style.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/docs/coding-style.rst b/docs/coding-style.rst
> index 470c61860f..ab7634dc14 100644
> --- a/docs/coding-style.rst
> +++ b/docs/coding-style.rst
> @@ -54,6 +54,7 @@ Struct type names
>     and each following word should have its first letter in
>     uppercase. The struct name should be the same as the typedef
>     name with a leading underscore.
> +
>     ::
>  
>       typedef struct _virHashTable virHashTable;
> @@ -61,6 +62,10 @@ Struct type names
>           ...
>       };
>  
> +   Historically, libvirt also declared pointer types 'virXXXPtr',
> +   which have been dropped where possible. Do not introduce new
> +   such types.
> +

Maybe: Do not introduce new such types for internal types.
We do want those types for public APIs to stay consistent.

>  Function names
>     All functions should have a 'vir' prefix in their name,
>     followed by one or more words with first letter of each word

Michal