]> Savannah Git Hosting - gnulib.git/commitdiff
copy-file: First step towards more consistent function names.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 15:59:26 +0000 (17:59 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Aug 2024 16:22:03 +0000 (18:22 +0200)
* 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.

ChangeLog
lib/copy-file.c
lib/copy-file.h
tests/test-copy-file.c

index b223243229cccd2f010935570d06d9ace52f4d9f..7aff116c4d0df1e72eb129d28ebd71d7c80b21c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
index d2588b82716dd4abb38af35214513425e6acfecf..13fb0fe2e39b39dbc2a66a88634c156b9cb050a9 100644 (file)
@@ -181,7 +181,7 @@ qcopy_file_preserving (const char *src_filename, const char *dest_filename)
 }
 
 void
-copy_file_preserving (const char *src_filename, const char *dest_filename)
+xcopy_file_preserving (const char *src_filename, const char *dest_filename)
 {
   switch (qcopy_file_preserving (src_filename, dest_filename))
     {
@@ -219,3 +219,9 @@ copy_file_preserving (const char *src_filename, const char *dest_filename)
       abort ();
     }
 }
+
+void
+copy_file_preserving (const char *src_filename, const char *dest_filename)
+{
+  xcopy_file_preserving (src_filename, dest_filename);
+}
index 8cc0cc5ba09f000fdbb0785b01407c46a4290f84..cc096c49fe8a56fb74ea0d6ffb565d14f9b4daef 100644 (file)
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
+/* This file uses _GL_ATTRIBUTE_DEPRECATED.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -46,7 +51,10 @@ extern int qcopy_file_preserving (const char *src_filename, const char *dest_fil
    Modification times, owner, group and access permissions are preserved as
    far as possible.
    Exit upon failure.  */
-extern void copy_file_preserving (const char *src_filename, const char *dest_filename);
+extern void xcopy_file_preserving (const char *src_filename, const char *dest_filename);
+
+/* Old name of xcopy_file_preserving.  */
+_GL_ATTRIBUTE_DEPRECATED void copy_file_preserving (const char *src_filename, const char *dest_filename);
 
 
 #ifdef __cplusplus
index a9a811e9d4098b64dbfc16f53cbb117265db1acd..f7ebe0dbecff8374edb194b40f136b085a437495 100644 (file)
@@ -40,7 +40,7 @@ main (int argc, char *argv[])
   if (null_stderr)
     ASSERT (qcopy_file_preserving (file1, file2) == 0);
   else
-    copy_file_preserving (file1, file2);
+    xcopy_file_preserving (file1, file2);
 
   return test_exit_status;
 }