texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Move OUTPUT_UNIT definition


From: Gavin D. Smith
Subject: branch master updated: Move OUTPUT_UNIT definition
Date: Tue, 22 Oct 2024 10:40:30 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new ad45f4c4dc Move OUTPUT_UNIT definition
ad45f4c4dc is described below

commit ad45f4c4dc0b174c5664a87bad61ef3a8dc99452
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 22 15:40:22 2024 +0100

    Move OUTPUT_UNIT definition
    
    * tp/Texinfo/XS/main/tree_types.h,
    * tp/Texinfo/XS/main/document_types.h (enum output_unit_type)
    (OUTPUT_UNIT, OUTPUT_UNIT_LIST): Move to document_types.h as
    all source codes needing the fields of OUTPUT_UNIT also include
    this header.  Replace with forward declaration.
---
 ChangeLog                           | 10 ++++++++
 tp/Texinfo/XS/main/document_types.h | 40 +++++++++++++++++++++++++++++++
 tp/Texinfo/XS/main/tree_types.h     | 47 +++----------------------------------
 3 files changed, 53 insertions(+), 44 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 721991eec2..d102074f5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-10-22  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Move OUTPUT_UNIT definition
+
+       * tp/Texinfo/XS/main/tree_types.h,
+       * tp/Texinfo/XS/main/document_types.h (enum output_unit_type)
+       (OUTPUT_UNIT, OUTPUT_UNIT_LIST): Move to document_types.h as
+       all source codes needing the fields of OUTPUT_UNIT also include
+       this header.  Replace with forward declaration.
+
 2024-10-21  Gavin Smith <gavinsmith0123@gmail.com>
 
        Hardcode "info" string in hash creation
diff --git a/tp/Texinfo/XS/main/document_types.h 
b/tp/Texinfo/XS/main/document_types.h
index 9022bc6a5e..66d432efe3 100644
--- a/tp/Texinfo/XS/main/document_types.h
+++ b/tp/Texinfo/XS/main/document_types.h
@@ -189,6 +189,46 @@ typedef struct COLLATIONS_INDICES_SORTED_BY_LETTER {
     COLLATION_INDICES_SORTED_BY_LETTER *collation_sorted_indices;
 } COLLATIONS_INDICES_SORTED_BY_LETTER;
 
+enum output_unit_type {
+   OU_unit,
+   OU_external_node_unit,
+   OU_special_unit,
+};
+
+/* structure used after splitting output units. */
+typedef struct OUTPUT_UNIT {
+    /* Used when building Perl tree only. This should be HV *hv,
+       but we don't want to include the Perl headers everywhere; */
+    void *hv;
+
+    enum output_unit_type unit_type;
+    size_t index;
+    union {
+      const struct ELEMENT *unit_command;
+      /* for special units, not in the tree */
+      struct ELEMENT *special_unit_command;
+    } uc;
+    char *unit_filename;
+    ELEMENT_LIST unit_contents;
+    struct OUTPUT_UNIT *tree_unit_directions[2];
+
+    struct OUTPUT_UNIT *first_in_page;
+    const struct OUTPUT_UNIT *directions[RUD_type_FirstInFileNodeBack+1];
+
+    /* for special output units only */
+    /* could be an enum as for now new special types cannot be customized
+       but lets keep it an option */
+    char *special_unit_variety;
+    /* for special units associated to a document output unit */
+    const struct OUTPUT_UNIT *associated_document_unit;
+} OUTPUT_UNIT;
+
+typedef struct OUTPUT_UNIT_LIST {
+    struct OUTPUT_UNIT **list;
+    size_t number;
+    size_t space;
+} OUTPUT_UNIT_LIST;
+
 typedef struct OUTPUT_UNIT_LISTS {
     OUTPUT_UNIT_LIST *output_units_lists;
     size_t number;
diff --git a/tp/Texinfo/XS/main/tree_types.h b/tp/Texinfo/XS/main/tree_types.h
index 3f669706a3..c9eb2f27e7 100644
--- a/tp/Texinfo/XS/main/tree_types.h
+++ b/tp/Texinfo/XS/main/tree_types.h
@@ -71,12 +71,6 @@ enum directions {
    D_up,
 };
 
-enum output_unit_type {
-   OU_unit,
-   OU_external_node_unit,
-   OU_special_unit,
-};
-
 /* here because it is used both in option_types.h and ConvertXS.xs */
 enum html_text_type {
    HTT_text,
@@ -268,43 +262,8 @@ typedef struct SOURCE_MARK_LIST {
     size_t space;
 } SOURCE_MARK_LIST;
 
-/* structure used after splitting output units.  Could have been defined
-   in another file as it is not related to element trees.  However, it
-   is used in ELEMENT, so it is defined here */
-typedef struct OUTPUT_UNIT {
-    /* Used when building Perl tree only. This should be HV *hv,
-       but we don't want to include the Perl headers everywhere; */
-    void *hv;
-
-    enum output_unit_type unit_type;
-    size_t index;
-    union {
-      const struct ELEMENT *unit_command;
-      /* for special units, not in the tree */
-      struct ELEMENT *special_unit_command;
-    } uc;
-    char *unit_filename;
-    ELEMENT_LIST unit_contents;
-    struct OUTPUT_UNIT *tree_unit_directions[2];
-
-    struct OUTPUT_UNIT *first_in_page;
-    const struct OUTPUT_UNIT *directions[RUD_type_FirstInFileNodeBack+1];
-
-    /* for special output units only */
-    /* could be an enum as for now new special types cannot be customized
-       but lets keep it an option */
-    char *special_unit_variety;
-    /* for special units associated to a document output unit */
-    const struct OUTPUT_UNIT *associated_document_unit;
-} OUTPUT_UNIT;
-
-/* Could be elsewhere, but it is practical to have it here as it is used
-   in build_perl_info.c, for example */
-typedef struct OUTPUT_UNIT_LIST {
-    struct OUTPUT_UNIT **list;
-    size_t number;
-    size_t space;
-} OUTPUT_UNIT_LIST;
+/* Defined fully in main/document_types.h */
+struct OUTPUT_UNIT;
 
 typedef struct CONTAINER {
     ELEMENT_LIST args;
@@ -312,7 +271,7 @@ typedef struct CONTAINER {
     SOURCE_INFO source_info;
 
     ASSOCIATED_INFO extra_info;
-    OUTPUT_UNIT *associated_unit;
+    struct OUTPUT_UNIT *associated_unit;
     /* depends on the element */
     char **string_info;
     enum command_id cmd;



reply via email to

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