texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sat, 6 Jan 2024 05:58:23 -0500 (EST)

branch: master
commit 8a4edfb41d6eaa7836cf1e2ff8a60aa2dca127f8
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jan 6 11:24:22 2024 +0100

    XS interface for getting/setting CSS information
    
    * tp/Texinfo/Convert/HTML.pm (_prepare_css): use css_add_info
    instead of accessing directly css_rule_lines and css_import_lines.
    
    * tp/Texinfo/XS/convert/convert_html.c (sort_css_element_class_styles)
    (html_css_set_selector_style, html_css_selector_style)
    (html_css_add_info, html_css_get_info),
    tp/Texinfo/XS/convert/convert_html.h (enum css_info_type),
    tp/Texinfo/XS/main/converter_types.h (CSS_SELECTOR_STYLE_LIST)
    (CONVERTER): add functions and data fields to implement the css
    information getting/setting interface.
    
    * tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
    (_initialize_output_state), tp/Texinfo/XS/convert/ConvertXS.xs
    (html_css_add_info, html_css_set_selector_style, html_css_get_info)
    (html_css_selector_style), tp/Texinfo/XS/convert/convert_html.c
    (css_info_type_names, html_converter_initialize)
    (html_converter_prepare_output),
    tp/Texinfo/XS/convert/get_html_perl_info.c
    (html_converter_initialize_sv, html_converter_prepare_output_sv)
    (html_get_css_info_spec): add an XS interface for css information
    setting/getting.  Get css_element_class_styles earlier from perl.
    
    * tp/Texinfo/XS/convert/convert_html.c
    (html_default_format_css_lines): implement.  Not used.
---
 ChangeLog                                  |  29 +++++
 tp/TODO                                    |   8 ++
 tp/Texinfo/Convert/HTML.pm                 |  24 +++-
 tp/Texinfo/XS/convert/ConvertXS.xs         |  73 +++++++++++++
 tp/Texinfo/XS/convert/convert_html.c       | 169 ++++++++++++++++++++++++++++-
 tp/Texinfo/XS/convert/convert_html.h       |  14 +++
 tp/Texinfo/XS/convert/get_html_perl_info.c |  58 ++++++----
 tp/Texinfo/XS/convert/get_html_perl_info.h |   5 +
 tp/Texinfo/XS/main/converter_types.h       |   5 +
 9 files changed, 357 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b83dd63d7e..91b0e06a52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2024-01-06  Patrice Dumas  <pertusus@free.fr>
+
+       XS interface for getting/setting CSS information
+
+       * tp/Texinfo/Convert/HTML.pm (_prepare_css): use css_add_info
+       instead of accessing directly css_rule_lines and css_import_lines.
+
+       * tp/Texinfo/XS/convert/convert_html.c (sort_css_element_class_styles)
+       (html_css_set_selector_style, html_css_selector_style)
+       (html_css_add_info, html_css_get_info),
+       tp/Texinfo/XS/convert/convert_html.h (enum css_info_type),
+       tp/Texinfo/XS/main/converter_types.h (CSS_SELECTOR_STYLE_LIST)
+       (CONVERTER): add functions and data fields to implement the css
+       information getting/setting interface.
+
+       * tp/Texinfo/Convert/HTML.pm (%XS_conversion_overrides)
+       (_initialize_output_state), tp/Texinfo/XS/convert/ConvertXS.xs
+       (html_css_add_info, html_css_set_selector_style, html_css_get_info)
+       (html_css_selector_style), tp/Texinfo/XS/convert/convert_html.c
+       (css_info_type_names, html_converter_initialize)
+       (html_converter_prepare_output),
+       tp/Texinfo/XS/convert/get_html_perl_info.c
+       (html_converter_initialize_sv, html_converter_prepare_output_sv)
+       (html_get_css_info_spec): add an XS interface for css information
+       setting/getting.  Get css_element_class_styles earlier from perl.
+
+       * tp/Texinfo/XS/convert/convert_html.c
+       (html_default_format_css_lines): implement.  Not used.
+
 2024-01-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_default_format_node_redirection_page):
diff --git a/tp/TODO b/tp/TODO
index 4fcee33f43..3058332150 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -13,6 +13,14 @@ Before next release
 add test of 
 @enumerate 0
 
+add test of init css_add_info 
+  $converter->css_set_selector_style('h1.titlefont', 'text-align:center');
+and css_set_selector_style for a selector already set
+
+Do a test that shows that accessing directly css_element_class_styles
+in perl in _collect_css_element_class and html_attribute_class is problematic
+with some perl/C mixing case.
+
 it is not documented that .info or .inf at the end of the @ref file name 
argument of the source cross reference command is ignored when doing the HTML 
cross ref.
 in HTML Cross-reference Link Basics:
 Any directory part in the file name argument of the source cross reference 
command is ignored. Thus, @xref{,,,../foo} and @xref{,,,foo} both use ‘foo’ as 
the manual name. This is because any such attempted hardwiring of the directory 
is very unlikely to be useful for all the output formats that use the manual 
name. 
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index c73c1171b7..805077f2b0 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -231,6 +231,14 @@ my %XS_conversion_overrides = (
    => "Texinfo::Convert::ConvertXS::html_attribute_class",
   "Texinfo::Convert::HTML::html_get_css_elements_classes"
    => "Texinfo::Convert::ConvertXS::html_get_css_elements_classes",
+  "Texinfo::Convert::HTML::css_add_info"
+   => "Texinfo::Convert::ConvertXS::html_css_add_info",
+  "Texinfo::Convert::HTML::css_set_selector_style"
+   => "Texinfo::Convert::ConvertXS::html_css_set_selector_style",
+  "Texinfo::Convert::HTML::css_get_info"
+   => "Texinfo::Convert::ConvertXS::html_css_get_info",
+  "Texinfo::Convert::HTML::css_selector_style",
+   => "Texinfo::Convert::ConvertXS::html_css_selector_style",
   "Texinfo::Convert::HTML::register_footnote",
    => "Texinfo::Convert::ConvertXS::html_register_footnote",
   "Texinfo::Convert::HTML::get_pending_footnotes",
@@ -555,7 +563,6 @@ sub css_add_info($$$)
   my $self = shift;
   my $spec = shift;
   my $css_info = shift;
-  my $css_style = shift;
 
   if ($spec eq 'rules') {
     push @{$self->{'css_rule_lines'}}, $css_info;
@@ -576,7 +583,7 @@ sub css_set_selector_style($$$)
 sub css_get_info($$) {
   my $self = shift;
   my $spec = shift;
-  my $css_info = shift;
+
   my @empty_array;
 
   if ($spec eq 'rules') {
@@ -9108,7 +9115,7 @@ sub _default_format_css_lines($;$)
   foreach my $element_class (@$css_element_classes) {
     my $css_style = $self->css_selector_style($element_class);
     $css_text .= "$element_class {$css_style}\n"
-      if defined($css_style );
+      if defined($css_style);
   }
   $css_text .= join('', @$css_rule_lines) . "\n"
     if (@$css_rule_lines);
@@ -9299,8 +9306,12 @@ sub _prepare_css($)
       }
     }
   }
-  $self->{'css_import_lines'} = \@css_import_lines;
-  $self->{'css_rule_lines'} = \@css_rule_lines;
+  foreach my $line (@css_import_lines) {
+    $self->css_add_info('imports', $line);
+  }
+  foreach my $line (@css_rule_lines) {
+    $self->css_add_info('rules', $line);
+  }
 }
 
 # Get the name of a file containing a label, as well as the identifier within
@@ -11589,6 +11600,9 @@ sub _initialize_output_state($$)
   $self->{'pending_footnotes'} = [];
   $self->{'pending_closes'} = [];
 
+  $self->{'css_rule_lines'} = [];
+  $self->{'css_import_lines'} = [];
+
   # to avoid infinite recursions when a section refers to itself, possibly
   # indirectly
   $self->{'referred_command_stack'} = [];
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 66fdb52a84..c4cf71ad80 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -1325,6 +1325,79 @@ html_get_css_elements_classes (SV *converter_in, ...)
     OUTPUT:
          RETVAL
 
+void
+html_css_add_info (SV *converter_in, char *spec, css_info)
+         char *css_info = (char *)SvPVutf8_nolen($arg);
+    PREINIT:
+         CONVERTER *self;
+    CODE:
+         self = get_sv_converter (converter_in,
+                                  "html_css_add_info");
+         if (self)
+           {
+             enum css_info_type type = html_get_css_info_spec (spec);
+             html_css_add_info (self, type, css_info);
+           }
+
+void
+html_css_set_selector_style (SV *converter_in, css_info, SV *css_style_sv)
+         char *css_info = (char *)SvPVutf8_nolen($arg);
+    PREINIT:
+         CONVERTER *self;
+    CODE:
+         self = get_sv_converter (converter_in,
+                                  "html_css_set_selector_style");
+         if (self)
+           {
+             char *css_style = 0;
+             if (SvOK (css_style_sv))
+               css_style = (char *)SvPVutf8_nolen (css_style_sv);
+
+             html_css_set_selector_style (self, css_info, css_style);
+           }
+
+SV *
+html_css_get_info (SV *converter_in, char *spec)
+    PREINIT:
+         CONVERTER *self;
+         AV *result_av = 0;
+    CODE:
+         self = get_sv_converter (converter_in,
+                                  "html_css_add_info");
+         if (self)
+           {
+             STRING_LIST *result;
+             enum css_info_type type = html_get_css_info_spec (spec);
+             result = html_css_get_info (self, type);
+             if (result)
+               result_av = build_string_list (result, svt_char);
+            }
+         if (!result_av)
+           result_av = newAV ();
+         RETVAL = newRV_noinc ((SV *) result_av);
+    OUTPUT:
+         RETVAL
+
+SV *
+html_css_selector_style (SV *converter_in, css_info)
+         char *css_info = (char *)SvPVutf8_nolen($arg);
+    PREINIT:
+         CONVERTER *self;
+         const char *css_style = 0;
+    CODE:
+         self = get_sv_converter (converter_in,
+                                  "html_css_selector_style");
+         if (self)
+           {
+             css_style = html_css_selector_style (self, css_info);
+           }
+         if (css_style)
+           RETVAL = newSVpv_utf8 (css_style, 0);
+         else
+           RETVAL = newSV (0);
+    OUTPUT:
+         RETVAL
+
 void
 html_register_footnote (SV *converter_in, SV *command, footid, docid, int 
number_in_doc, footnote_location_filename, ...)
          char *footid = (char *)SvPVutf8_nolen($arg);
diff --git a/tp/Texinfo/XS/convert/convert_html.c 
b/tp/Texinfo/XS/convert/convert_html.c
index 4353907781..c5202d4f69 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -166,6 +166,11 @@ const char 
*htmlxref_split_type_names[htmlxref_split_type_chapter + 1] =
   "mono", "node", "section", "chapter"
 };
 
+const char *css_info_type_names[] =
+{
+  "element_classes", "imports", "rules"
+};
+
 enum htmlxref_split_type htmlxref_entries[htmlxref_split_type_chapter + 
1][htmlxref_split_type_chapter + 1] = {
  { htmlxref_split_type_mono, htmlxref_split_type_chapter, 
htmlxref_split_type_section, htmlxref_split_type_node },
  { htmlxref_split_type_node, htmlxref_split_type_section, 
htmlxref_split_type_chapter, htmlxref_split_type_mono },
@@ -4189,6 +4194,14 @@ compare_selector_style (const void *a, const void *b)
   return strcmp (css_a->selector, css_b->selector);
 }
 
+static void
+sort_css_element_class_styles (CONVERTER* self)
+{
+  qsort (self->css_element_class_styles.list,
+         self->css_element_class_styles.number,
+         sizeof (CSS_SELECTOR_STYLE), compare_selector_style);
+}
+
 CSS_SELECTOR_STYLE *
 find_css_selector_style
      (const CSS_SELECTOR_STYLE_LIST *css_element_class_styles,
@@ -4207,6 +4220,56 @@ find_css_selector_style
   return result;
 }
 
+void
+html_css_set_selector_style (CONVERTER* self, const char *css_info,
+                             const char *css_style)
+{
+  CSS_SELECTOR_STYLE *selector_style
+   = find_css_selector_style (&self->css_element_class_styles, css_info);
+
+  if (selector_style)
+    {
+      free (selector_style->style);
+      selector_style->style = 0;
+      if (css_style)
+        selector_style->style = strdup (css_style);
+    }
+  else
+    {
+      CSS_SELECTOR_STYLE_LIST *elt_class_styles
+        = &self->css_element_class_styles;
+      if (elt_class_styles->space <= elt_class_styles->number)
+        {
+          elt_class_styles->list = realloc (elt_class_styles->list,
+             (elt_class_styles->space += 10) * sizeof (CSS_SELECTOR_STYLE));
+        }
+
+      selector_style
+        = &elt_class_styles->list[elt_class_styles->number];
+      selector_style->selector = strdup (css_info);
+      if (css_style)
+        selector_style->style = strdup (css_style);
+      else
+        selector_style->style = 0;
+
+      elt_class_styles->number++;
+
+      sort_css_element_class_styles (self);
+    }
+}
+
+const char *
+html_css_selector_style (CONVERTER* self, const char *css_info)
+{
+  CSS_SELECTOR_STYLE *selector_style
+   = find_css_selector_style (&self->css_element_class_styles, css_info);
+
+  if (selector_style)
+    return selector_style->style;
+
+  return 0;
+}
+
 static void
 add_new_css_page (PAGES_CSS_LIST *css_pages, const char *page_name)
 {
@@ -4417,6 +4480,44 @@ html_get_css_elements_classes (CONVERTER *self, const 
char *filename)
   return result;
 }
 
+void
+html_css_add_info (CONVERTER *self, enum css_info_type type,
+                   const char *css_info)
+{
+  if (type == CI_css_info_rules)
+    add_string (css_info, &self->css_rule_lines);
+  else if (type == CI_css_info_imports)
+    add_string (css_info, &self->css_import_lines);
+}
+
+STRING_LIST *
+html_css_get_info (CONVERTER *self, enum css_info_type type)
+{
+  if (type == CI_css_info_rules)
+    return &self->css_rule_lines;
+  else if (type == CI_css_info_imports)
+    return &self->css_import_lines;
+  else
+    {
+      size_t i;
+      if (self->css_element_class_styles.number > 0)
+        {
+          if (self->css_element_class_list.number == 0)
+            {
+              for (i = 0; i < self->css_element_class_styles.number; i++)
+                {
+                  CSS_SELECTOR_STYLE *selector_style
+                    = &self->css_element_class_styles.list[i];
+                  if (selector_style->selector)
+                    add_string (selector_style->selector,
+                                &self->css_element_class_list);
+                }
+            }
+        }
+      return &self->css_element_class_list;
+    }
+}
+
 void
 close_html_lone_element (CONVERTER *self, TEXT *result)
 {
@@ -6608,6 +6709,70 @@ convert_string_tree_new_formatting_context (CONVERTER 
*self,
   return result;
 }
 
+void
+html_default_format_css_lines (CONVERTER *self, const char *filename,
+                               TEXT *result)
+{
+  STRING_LIST *css_refs;
+  STRING_LIST *css_element_classes;
+  STRING_LIST *css_import_lines;
+  STRING_LIST *css_rule_lines;
+  size_t i;
+
+  if (self->conf->NO_CSS.integer > 0)
+    return;
+
+  css_refs = self->conf->CSS_REFS.strlist;
+  css_element_classes = html_get_css_elements_classes (self, filename);
+  css_import_lines = html_css_get_info (self, CI_css_info_imports);
+  css_rule_lines = html_css_get_info (self, CI_css_info_rules);
+
+  if (css_import_lines->number <= 0 && css_element_classes->number <= 0
+      && css_rule_lines->number <= 0
+      && (!css_refs || css_refs->number <= 0))
+    return;
+
+  text_append (result, "<style type=\"text/css\">\n<!--\n");
+  for (i = 0; i < css_import_lines->number; i++)
+    {
+      text_append (result, css_import_lines->list[i]);
+      text_append_n (result, "\n", 1);
+    }
+
+  for (i = 0; i < css_element_classes->number; i++)
+    {
+      const char *selector = css_element_classes->list[i];
+      CSS_SELECTOR_STYLE *selector_style
+       = find_css_selector_style (&self->css_element_class_styles, selector);
+      if (selector_style->style)
+        text_printf (result, "%s {%s}\n", selector, selector_style->style);
+    }
+
+  for (i = 0; i < css_rule_lines->number; i++)
+    {
+      text_append (result, css_rule_lines->list[i]);
+      text_append_n (result, "\n", 1);
+    }
+
+  text_append (result, "-->\n</style>\n");
+
+  if (css_refs)
+    {
+      for (i = 0; i < css_refs->number; i++)
+        {
+          char *protected_ref = url_protect_url_text (self,
+                                                css_refs->list[i]);
+          text_printf (result,
+               "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\"",
+                       protected_ref);
+          free (protected_ref);
+
+          close_html_lone_element (self, result);
+          text_append_n (result, "\n", 1);
+        }
+    }
+}
+
 void
 format_css_lines (CONVERTER *self, const char *filename, TEXT *result)
 {
@@ -15556,6 +15721,7 @@ html_converter_initialize (CONVERTER *self)
   qsort (self->htmlxref.list, self->htmlxref.number,
          sizeof (HTMLXREF_MANUAL), compare_htmlxref_manual);
 
+  sort_css_element_class_styles (self);
 
   /* remaining of the file is for the replacement of call to external
      functions by internal functions in C.  Uncomment the next line
@@ -15778,9 +15944,6 @@ html_converter_initialize (CONVERTER *self)
 void
 html_converter_prepare_output (CONVERTER* self)
 {
-  qsort (self->css_element_class_styles.list,
-         self->css_element_class_styles.number,
-         sizeof (CSS_SELECTOR_STYLE), compare_selector_style);
 }
 
 void
diff --git a/tp/Texinfo/XS/convert/convert_html.h 
b/tp/Texinfo/XS/convert/convert_html.h
index 82cdc81329..e57bad2743 100644
--- a/tp/Texinfo/XS/convert/convert_html.h
+++ b/tp/Texinfo/XS/convert/convert_html.h
@@ -14,6 +14,12 @@ enum count_elements_in_filename_type {
   CEFT_current,
 };
 
+enum css_info_type {
+   CI_css_info_element_classes,
+   CI_css_info_imports,
+   CI_css_info_rules,
+};
+
 extern char *html_conversion_context_type_names[];
 extern char *html_global_unit_direction_names[];
 
@@ -23,6 +29,8 @@ extern TRANSLATED_SUI_ASSOCIATION 
translated_special_unit_info[];
 extern const char *special_unit_info_type_names[SUI_type_heading + 1];
 extern const char *htmlxref_split_type_names[htmlxref_split_type_chapter + 1];
 
+extern const char *css_info_type_names[];
+
 extern const char *direction_string_type_names[];
 extern const char *direction_string_context_names[];
 
@@ -129,6 +137,12 @@ char *html_attribute_class (CONVERTER *self, const char 
*element,
                             const STRING_LIST *classes);
 STRING_LIST *html_get_css_elements_classes (CONVERTER *self,
                                             const char *filename);
+void html_css_add_info (CONVERTER *self, enum css_info_type type,
+                        const char *css_info);
+STRING_LIST *html_css_get_info (CONVERTER *self, enum css_info_type type);
+void html_css_set_selector_style (CONVERTER* self, const char *css_info,
+                                  const char *css_style);
+const char *html_css_selector_style (CONVERTER* self, const char *css_info);
 
 void html_register_footnote (CONVERTER *self, const ELEMENT *command,
      const char *footid, const char *docid, const int number_in_doc,
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c 
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index d9b6487f47..2a6007c97c 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -164,6 +164,7 @@ html_converter_initialize_sv (SV *converter_sv,
   SV **pre_class_types_sv;
   SV **directions_strings_sv;
   SV **translated_direction_strings_sv;
+  SV **css_element_class_styles_sv;
   HV *formatting_function_hv;
   HV *commands_open_hv;
   HV *commands_conversion_hv;
@@ -1072,26 +1073,6 @@ html_converter_initialize_sv (SV *converter_sv,
             }
         }
     }
-  html_converter_initialize (converter);
-
-  /* at that point, the format specific informations, in particular the number
-     of special elements is available, such that all the options can be
-     passed to C.  It is important to set the force argument to 1 to get
-     all the configuration, even if the configured field is set */
-  copy_converter_conf_sv (converter_hv, converter,
-                          &converter->conf, "conf", 1);
-}
-
-void
-html_converter_prepare_output_sv (SV *converter_sv, CONVERTER *converter)
-{
-  HV *converter_hv;
-  SV **css_element_class_styles_sv;
-  SV **jslicenses_sv;
-
-  dTHX;
-
-  converter_hv = (HV *)SvRV (converter_sv);
 
   FETCH(css_element_class_styles)
 
@@ -1105,6 +1086,7 @@ html_converter_prepare_output_sv (SV *converter_sv, 
CONVERTER *converter)
 
       hv_number = hv_iterinit (css_element_class_styles_hv);
 
+      converter->css_element_class_styles.space = hv_number;
       converter->css_element_class_styles.list = (CSS_SELECTOR_STYLE *)
         malloc (hv_number * sizeof (CSS_SELECTOR_STYLE));
       converter->css_element_class_styles.number = hv_number;
@@ -1124,6 +1106,26 @@ html_converter_prepare_output_sv (SV *converter_sv, 
CONVERTER *converter)
         }
     }
 
+  html_converter_initialize (converter);
+
+  /* at that point, the format specific informations, in particular the number
+     of special elements is available, such that all the options can be
+     passed to C.  It is important to set the force argument to 1 to get
+     all the configuration, even if the configured field is set */
+  copy_converter_conf_sv (converter_hv, converter,
+                          &converter->conf, "conf", 1);
+}
+
+void
+html_converter_prepare_output_sv (SV *converter_sv, CONVERTER *converter)
+{
+  HV *converter_hv;
+  SV **jslicenses_sv;
+
+  dTHX;
+
+  converter_hv = (HV *)SvRV (converter_sv);
+
   FETCH(jslicenses)
 
   if (jslicenses_sv)
@@ -1712,3 +1714,19 @@ html_get_shared_conversion_state (CONVERTER *converter, 
SV *converter_in,
     return newSViv(converter->shared_conversion_state.in_skipped_node_top);
   return newSV (0);
 }
+
+enum css_info_type
+html_get_css_info_spec (const char *spec)
+{
+  int i;
+  enum css_info_type type = CI_css_info_element_classes;
+  for (i = 0; i < CI_css_info_rules +1; i++)
+    {
+      if (!strcmp (css_info_type_names[i], spec))
+        {
+          type = i;
+          break;
+        }
+    }
+  return type;
+}
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.h 
b/tp/Texinfo/XS/convert/get_html_perl_info.h
index fcde7db85d..f75889a223 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.h
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.h
@@ -5,6 +5,8 @@
 #include "EXTERN.h"
 #include "perl.h"
 
+#include "convert_html.h"
+
 int get_output_units_descriptor_converter_sv (SV *converter_in);
 
 void html_converter_initialize_sv (SV *converter_sv,
@@ -33,4 +35,7 @@ void html_set_shared_conversion_state (CONVERTER *converter, 
SV *converter_in,
 SV *html_get_shared_conversion_state (CONVERTER *converter, SV *converter_in,
                                const char *cmdname, const char *state_name,
                                const int args_nr, SV **args_sv);
+
+enum css_info_type html_get_css_info_spec (const char *spec);
+
 #endif
diff --git a/tp/Texinfo/XS/main/converter_types.h 
b/tp/Texinfo/XS/main/converter_types.h
index fe75adc168..1254fb6c27 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -506,6 +506,7 @@ typedef struct CSS_SELECTOR_STYLE {
 
 typedef struct CSS_SELECTOR_STYLE_LIST {
     size_t number;
+    size_t space;
     CSS_SELECTOR_STYLE *list;
 } CSS_SELECTOR_STYLE_LIST;
 
@@ -728,6 +729,10 @@ typedef struct CONVERTER {
     STRING_WITH_LEN special_character[SC_non_breaking_space+1];
     STRING_WITH_LEN line_break_element;
     CSS_SELECTOR_STYLE_LIST css_element_class_styles;
+    STRING_LIST css_rule_lines;
+    STRING_LIST css_import_lines;
+    /* filled based on css_element_class_styles when needed */
+    STRING_LIST css_element_class_list;
     FORMATTING_REFERENCE
        formatting_references[FR_format_translate_message+1];
     FORMATTING_REFERENCE



reply via email to

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