]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: document some functions used by expand and unexpand
authorCollin Funk <collin.funk1@gmail.com>
Fri, 12 Sep 2025 03:31:05 +0000 (20:31 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 12 Sep 2025 03:31:05 +0000 (20:31 -0700)
* src/expand-common.h (get_next_tab_column, cleanup_file_list_stdin)
(emit_tab_list_info): Document functions.
* src/expand-common.c (cleanup_file_list_stdin, emit_tab_list_info):
Likewise.

src/expand-common.c
src/expand-common.h

index 732123f8d46cf2ae80627a780c68fe7b7c8e6af0..366c589cf65422b02b950253875f83e390ad1a7f 100644 (file)
@@ -380,7 +380,7 @@ next_file (FILE *fp)
   return nullptr;
 }
 
-/* */
+/* Close standard input if we have read from it.  */
 extern void
 cleanup_file_list_stdin (void)
 {
@@ -388,7 +388,8 @@ cleanup_file_list_stdin (void)
       error (EXIT_FAILURE, errno, "-");
 }
 
-
+/* Emit the --help output for --tabs=LIST option accepted by expand and
+   unexpand.  */
 extern void
 emit_tab_list_info (void)
 {
index fe6c8ed45db39f44c2200ccb841cd35c53206f6d..46ef4e35b49cc91d17242dbb3031cedf4ec7091c 100644 (file)
@@ -38,7 +38,10 @@ add_tab_stop (colno tabval);
 extern void
 parse_tab_stops (char const *stops) _GL_ATTRIBUTE_NONNULL ();
 
-/* TODO: Document */
+/* Return number of first tab stop after COLUMN.  TAB_INDEX specifies
+   many multiple tab-sizes.  Set *LAST_TAB depending on whether we are
+   returning COLUMN + 1 merely because we're past the last tab.
+   If the number would overflow, diagnose this and exit.  */
 extern colno
 get_next_tab_column (const colno column, idx_t *tab_index,
                      bool *last_tab)
@@ -63,10 +66,11 @@ set_file_list (char **file_list);
 extern FILE *
 next_file (FILE *fp);
 
-/* */
+/* Close standard input if we have read from it.  */
 extern void
 cleanup_file_list_stdin (void);
 
-
+/* Emit the --help output for --tabs=LIST option accepted by expand and
+   unexpand.  */
 extern void
 emit_tab_list_info (void);