groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/07: [libgroff]: Add documentary comments.


From: G. Branden Robinson
Subject: [groff] 04/07: [libgroff]: Add documentary comments.
Date: Sun, 26 Jun 2022 09:24:00 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 72d5a17d7b3ad2e46e4b315ebefbdf3109fb27d4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jun 22 15:17:30 2022 -0500

    [libgroff]: Add documentary comments.
---
 src/libs/libgroff/error.cpp  | 6 ++++++
 src/libs/libgroff/lineno.cpp | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp
index 9bd0ed84..259c3053 100644
--- a/src/libs/libgroff/error.cpp
+++ b/src/libs/libgroff/error.cpp
@@ -127,6 +127,12 @@ void fatal(const char *format,
   do_error(FATAL, format, arg1, arg2, arg3);
 }
 
+// Use the functions below when it's more costly to save and restore the
+// globals current_filename, current_source_filename, and current_lineno
+// than to specify additional arguments.  For instance, a function that
+// would need to temporarily change their values and has multiple return
+// paths might prefer these to the simpler variants above.
+
 void debug_with_file_and_line(const char *filename,
                              int lineno,
                              const char *format,
diff --git a/src/libs/libgroff/lineno.cpp b/src/libs/libgroff/lineno.cpp
index 07faabe6..6e356c7b 100644
--- a/src/libs/libgroff/lineno.cpp
+++ b/src/libs/libgroff/lineno.cpp
@@ -15,4 +15,6 @@ for more details.
 The GNU General Public License version 2 (GPL2) is available in the
 internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
 
+// This global stores the line number of the input file being
+// processed by troff, an output driver, or other program.
 int current_lineno = 0;



reply via email to

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