I was looking at multi-byte character support for expand and unexpand
and saw this TODO comment for documentation.

I figured it was easy enough to clean up so I pushed the attached.

Collin

>From f585f3a3584ee3cde2437003321104606ed04064 Mon Sep 17 00:00:00 2001
Message-ID: <f585f3a3584ee3cde2437003321104606ed04064.1757648229.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Thu, 11 Sep 2025 20:31:05 -0700
Subject: [PATCH] maint: document some functions used by expand and unexpand

* 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 |  5 +++--
 src/expand-common.h | 10 +++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/expand-common.c b/src/expand-common.c
index 732123f8d..366c589cf 100644
--- a/src/expand-common.c
+++ b/src/expand-common.c
@@ -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)
 {
diff --git a/src/expand-common.h b/src/expand-common.h
index fe6c8ed45..46ef4e35b 100644
--- a/src/expand-common.h
+++ b/src/expand-common.h
@@ -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);
-- 
2.51.0

Reply via email to