From: Bruno Haible <bruno@clisp.org>
Date: Fri, 21 Mar 2025 11:22:42 +0000 (+0100)
Subject: mountlist: Add specification comment in .h file.
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=195dcaf45ccce941f0345b1d4c51d66ee15b9144;p=gnulib.git

mountlist: Add specification comment in .h file.

* lib/mountlist.h (read_file_system_list): Move specification to here...
* lib/mountlist.c (read_file_system_list): ...from here.
---

diff --git a/ChangeLog b/ChangeLog
index fcb8fc2976..8111c9df7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-03-21  Bruno Haible  <bruno@clisp.org>
+
+	mountlist: Add specification comment in .h file.
+	* lib/mountlist.h (read_file_system_list): Move specification to here...
+	* lib/mountlist.c (read_file_system_list): ...from here.
+
 2025-03-21  Bruno Haible  <bruno@clisp.org>
 
 	mountlist: Work around an strtoul() misfeature.
diff --git a/lib/mountlist.c b/lib/mountlist.c
index 6cb947daaa..fae9bb50cb 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -457,12 +457,8 @@ terminate_at_blank (char *str)
     *s = '\0';
   return s;
 }
-#endif
 
-/* Return a list of the currently mounted file systems, or NULL on error.
-   Add each entry to the tail of the list so that they stay in order.
-   If NEED_FS_TYPE is true, ensure that the file system type fields in
-   the returned list are valid.  Otherwise, they might not be.  */
+#endif
 
 struct mount_entry *
 read_file_system_list (bool need_fs_type)
diff --git a/lib/mountlist.h b/lib/mountlist.h
index 5b9da0846c..e8ba1d96f9 100644
--- a/lib/mountlist.h
+++ b/lib/mountlist.h
@@ -46,8 +46,13 @@ struct mount_entry
   struct mount_entry *me_next;
 };
 
+/* Return a list of the currently mounted file systems, or NULL on error.
+   Add each entry to the tail of the list so that they stay in order.
+   If NEED_FS_TYPE is true, ensure that the file system type fields in
+   the returned list are valid.  Otherwise, they might not be.  */
 struct mount_entry *read_file_system_list (bool need_fs_type)
   _GL_ATTRIBUTE_MALLOC;
+
 void free_mount_entry (struct mount_entry *entry);