bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

acl, copy-file: First step towards more consistent function names


From: Bruno Haible
Subject: acl, copy-file: First step towards more consistent function names
Date: Sat, 24 Aug 2024 18:49:09 +0200

In most Gnulib modules, when we have a function that does something
and another function that does the same thing with diagnostics, the
common convention is that the latter has an 'x' prefix. Such as for
  malloc — xalloc
  vasprintf — xvasprintf
  getcwd — xgetcwd
  striconv — xstriconv
  etc.

The modules 'acl' and 'copy-file' use an opposite convention:
  qcopy_acl — copy_acl

This is so for historical reasons: the function which emits diagnostics
was there before the silent function.

In the name of consistency of the API, I'd like to migrate 'acl' and 'copy-file'
to the common conventions: In a first step
  qcopy_acl — xcopy_acl

and then later (in a year or two):
  copy_acl — xcopy_acl

At some point, we can then also rename the modules accordingly.


These two patches implement the first step: introducing the function with
'x' prefix.


2024-08-24  Bruno Haible  <bruno@clisp.org>

        copy-file: First step towards more consistent function names.
        * lib/copy-file.h (xcopy_file_preserving): New declaration.
        (copy_file_preserving): Mark deprecated.
        * lib/copy-file.c (xcopy_file_preserving): Renamed from
        copy_file_preserving.
        (copy_file_preserving): New function.
        * tests/test-copy-file.c (main): Test xcopy_file_preserving instead of
        copy_file_preserving.

        acl: First step towards more consistent function names.
        * lib/acl.h (xset_acl): New declaration.
        (set_acl): Mark deprecated.
        (xcopy_acl): New declaration.
        (copy_acl): Mark deprecated.
        * lib/set-acl.c (xset_acl): Renamed from set_acl.
        (set_acl): New function.
        * lib/copy-acl.c (xcopy_acl): Renamed from copy_acl.
        (copy_acl): New function.
        * tests/test-set-mode-acl.c (main): Test xset_acl instead of set_acl.
        * tests/test-copy-acl.c (main): Test xcopy_acl instead of copy_acl.

Attachment: 0001-acl-First-step-towards-more-consistent-function-name.patch
Description: Text Data

Attachment: 0002-copy-file-First-step-towards-more-consistent-functio.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]