groff-commit
[Top][All Lists]
Advanced

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

[groff] 34/80: [grohtml]: Align with modern groff conventions.


From: G. Branden Robinson
Subject: [groff] 34/80: [grohtml]: Align with modern groff conventions.
Date: Sat, 30 Nov 2024 04:02:18 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit d13a2f64a205755324facb333a9b5886ba7ab08a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 27 20:08:23 2024 -0600

    [grohtml]: Align with modern groff conventions.
    
    * src/devices/grohtml/html-table.cpp:
    * src/devices/grohtml/html-text.cpp:
    * src/devices/grohtml/output.cpp:
    * src/devices/grohtml/post-html.cpp: Add Autoconf "<config.h>"-inclusion
      boilerplate to these translation units.
    
    * src/preproc/grohtml/output.cpp:
    * src/devices/grohtml/post-html.cpp: Include system library headers
      before local ones.
    
    Fix sloppy whitespace.
---
 ChangeLog                          | 14 ++++++++++++++
 src/devices/grohtml/html-table.cpp | 27 ++++++++++++++++++---------
 src/devices/grohtml/html-text.cpp  | 25 +++++++++++++++++--------
 src/devices/grohtml/output.cpp     | 22 ++++++++++++++++------
 src/devices/grohtml/post-html.cpp  | 27 +++++++++++++++------------
 5 files changed, 80 insertions(+), 35 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81151527c..5122a7ca7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [grohtml]: Align with modern groff conventions.
+
+       * src/devices/grohtml/html-table.cpp:
+       * src/devices/grohtml/html-text.cpp:
+       * src/devices/grohtml/output.cpp:
+       * src/devices/grohtml/post-html.cpp: Add Autoconf "<config.h>"-
+       inclusion boilerplate to these translation units.
+
+       * src/preproc/grohtml/output.cpp:
+       * src/devices/grohtml/post-html.cpp: Include system library
+       headers before local ones.
+
 2024-11-27  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [pic]: Align with modern groff conventions.
diff --git a/src/devices/grohtml/html-table.cpp 
b/src/devices/grohtml/html-table.cpp
index 0295da4df..b06341891 100644
--- a/src/devices/grohtml/html-table.cpp
+++ b/src/devices/grohtml/html-table.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2024 Free Software Foundation, Inc.
  *
  *  Gaius Mulley (gaius@glam.ac.uk) wrote html-table.cpp
  *
@@ -25,6 +24,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "driver.h"
 #include "stringclass.h"
 #include "cset.h"
@@ -160,7 +163,7 @@ void tabs::init (const char *s)
     }
     last->alignment = align;
     last->position = total;
-    last->next = NULL;    
+    last->next = NULL;
   }
 }
 
@@ -251,7 +254,7 @@ html_table::~html_table ()
   cols *c;
   if (tab_stops != NULL)
     delete tab_stops;
-  
+
   c = columns;
   while (columns != NULL) {
     columns = columns->next;
@@ -399,7 +402,7 @@ void html_table::emit_colspan (void)
        .put_number(is_gap(b))
        .put_string("%\" class=\"center\"></col>")
        .nl();
-    
+
     width = (get_right(c)*100 + get_effective_linelength()/2)
              / get_effective_linelength()
              - (c->left*100 + get_effective_linelength()/2)
@@ -482,7 +485,7 @@ void html_table::emit_col (int n)
       b = columns;
     else
       b = last_col;
-    
+
     // have we a gap?
     if (last_col != NULL) {
       emit_td(is_gap(b), "></td>");
@@ -533,7 +536,7 @@ void html_table::finish_row (void)
   if (last_col != NULL) {
     for (c = last_col->next; c != NULL; c = c->next)
       n = c->no;
-    
+
     if (n > 0)
       emit_col(n);
 #if 1
@@ -631,7 +634,7 @@ int html_table::insert_column (int coln, int hstart, int 
hend, char align)
 
   if ((l != NULL) && (hstart < l->right))
     return FALSE;      // new column bumps into previous one
-  
+
   if ((l != NULL) && (l->next != NULL) &&
       (l->next->left < hend))
     return FALSE;  // new column bumps into next one
@@ -667,7 +670,7 @@ int html_table::modify_column (cols *c, int hstart, int 
hend, char align)
 
   if ((l != NULL) && (hstart < l->right))
     return FALSE;      // new column bumps into previous one
-  
+
   if ((c->next != NULL) && (c->next->left < hend))
     return FALSE;  // new column bumps into next one
 
@@ -846,3 +849,9 @@ void html_indent::get_reg (int *ind, int *pageoffset, int 
*linelength)
   *pageoffset = pg;
   *linelength = ll;
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/devices/grohtml/html-text.cpp 
b/src/devices/grohtml/html-text.cpp
index ff7263a10..3659fd882 100644
--- a/src/devices/grohtml/html-text.cpp
+++ b/src/devices/grohtml/html-text.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
  *
  *  Gaius Mulley (gaius@glam.ac.uk) wrote html-text.cpp
  *
@@ -25,6 +24,10 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "driver.h"
 #include "stringclass.h"
 #include "cset.h"
@@ -99,7 +102,7 @@ void html_text::dump_stack_element (tag_definition *p)
       fprintf(stderr, "<COLOR (default)>");
     else {
       unsigned int r, g, b;
-      
+
       p->col.get_rgb(&r, &g, &b);
       fprintf(stderr, "<COLOR %x %x %x>", r/0x101, g/0x101, b/0x101);
     }
@@ -505,7 +508,7 @@ char *html_text::shutdown (HTML_TAG t)
     tag_definition *p    =stackptr;
     tag_definition *temp =NULL;
     int notext           =TRUE;
-    
+
     dump_stack();
     while ((stackptr != NULL) && (stackptr->type != t)) {
       notext = (notext && (! stackptr->text_emitted));
@@ -520,7 +523,7 @@ char *html_text::shutdown (HTML_TAG t)
       stackptr = stackptr->next;
       if (stackptr == NULL)
        lastptr = NULL;
-    
+
       /*
        *  push tag onto temp stack
        */
@@ -686,7 +689,7 @@ void html_text::do_para (const char *arg, html_indent *in, 
int space)
   if (! is_present(P_TAG)) {
     if (is_present(PRE_TAG)) {
       html_indent *i = remove_indent(PRE_TAG);
-      done_pre();    
+      done_pre();
       if ((arg == NULL || (strcmp(arg, "") == 0)) &&
          (i == in || in == NULL))
        in = i;
@@ -871,7 +874,7 @@ void html_text::remove_def (tag_definition *t)
 {
   tag_definition *p = stackptr;
   tag_definition *l = 0;
-    
+
   while ((p != 0) && (p != t)) {
     l = p;
     p = p->next;
@@ -899,7 +902,7 @@ void html_text::remove_def (tag_definition *t)
 void html_text::remove_tag (HTML_TAG tag)
 {
   tag_definition *p = stackptr;
-    
+
   while ((p != 0) && (p->type != tag)) {
     p = p->next;
   }
@@ -1054,3 +1057,9 @@ void html_text::do_sub (void)
 {
   push_para(SUB_TAG);
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/devices/grohtml/output.cpp b/src/devices/grohtml/output.cpp
index 0ffeb5838..d0ed691f4 100644
--- a/src/devices/grohtml/output.cpp
+++ b/src/devices/grohtml/output.cpp
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-/* Copyright (C) 2000-2020 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2024 Free Software Foundation, Inc.
  *
  *  Gaius Mulley (gaius@glam.ac.uk) wrote output.cpp
  *  but it owes a huge amount of ideas and raw code from
@@ -26,17 +25,22 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "driver.h"
-#include "stringclass.h"
-#include "cset.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <time.h>
-#include "html.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#include "driver.h"
+#include "stringclass.h"
+#include "cset.h"
+
+#include "html.h"
+
 #if !defined(TRUE)
 #   define TRUE  (1==1)
 #endif
@@ -361,3 +365,9 @@ void simple_output::flush_last_word (void)
     }
   }
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/devices/grohtml/post-html.cpp 
b/src/devices/grohtml/post-html.cpp
index 1c8d399d6..d41876c6c 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -21,24 +21,27 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
-#include "driver.h"
-#include "stringclass.h"
-#include "cset.h"
-#include "html.h"
-#include "html-text.h"
-#include "html-table.h"
-#include "curtime.h"
-#include "unicode.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
 #include <time.h>
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#include <stdio.h>
-#include <fcntl.h>
-#include <string.h>
+#include "cset.h"
+#include "curtime.h"
+#include "driver.h"
+#include "stringclass.h"
+#include "unicode.h"
+
+#include "html.h"
+#include "html-text.h"
+#include "html-table.h"
 
 extern "C" const char *Version_string;
 



reply via email to

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