[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCE
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCES), tp/Texinfo/XS/main/option_types.h (enum direction_unit_direction) (FIRSTINFILE_*, NODE_DIRECTIONS_OFFSET, NON_SPECIAL_DIRECTIONS_NR) (enum button_specification_type, enum button_information_type) (enum button_function_type, BUTTON_SPECIFICATION_LIST) (BUTTON_SPECIFICATION_INFO, BUTTON_SPECIFICATION, BUTTON_FUNCTION) (FORMATTED_BUTTON_INFO, DIRECTION_ICON_LIST, OPTION), tp/maintain/regenerate_C_options_info.pl: move definitions related to [...] |
Date: |
Sat, 13 Jan 2024 18:29:42 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new a64467a1cb * tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCES),
tp/Texinfo/XS/main/option_types.h (enum direction_unit_direction)
(FIRSTINFILE_*, NODE_DIRECTIONS_OFFSET, NON_SPECIAL_DIRECTIONS_NR) (enum
button_specification_type, enum button_information_type) (enum
button_function_type, BUTTON_SPECIFICATION_LIST) (BUTTON_SPECIFICATION_INFO,
BUTTON_SPECIFICATION, BUTTON_FUNCTION) (FORMATTED_BUTTON_INFO,
DIRECTION_ICON_LIST, OPTION), tp/maintain/regenerate_C_options_info.pl: move d
[...]
a64467a1cb is described below
commit a64467a1cbaa99d9d9574d72989286d4ea760c2e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 14 00:29:45 2024 +0100
* tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCES),
tp/Texinfo/XS/main/option_types.h (enum direction_unit_direction)
(FIRSTINFILE_*, NODE_DIRECTIONS_OFFSET, NON_SPECIAL_DIRECTIONS_NR)
(enum button_specification_type, enum button_information_type)
(enum button_function_type, BUTTON_SPECIFICATION_LIST)
(BUTTON_SPECIFICATION_INFO, BUTTON_SPECIFICATION, BUTTON_FUNCTION)
(FORMATTED_BUTTON_INFO, DIRECTION_ICON_LIST, OPTION),
tp/maintain/regenerate_C_options_info.pl: move definitions related to
an option to a separate header file, option_types.h. Update users.
---
ChangeLog | 12 ++
tp/Texinfo/XS/Makefile.am | 1 +
tp/Texinfo/XS/convert/call_html_perl_function.c | 1 +
tp/Texinfo/XS/convert/call_html_perl_function.h | 1 +
tp/Texinfo/XS/convert/convert_html.c | 1 +
tp/Texinfo/XS/convert/converter.c | 2 +
tp/Texinfo/XS/main/api_to_perl.c | 1 +
tp/Texinfo/XS/main/converter_types.h | 148 +---------------------
tp/Texinfo/XS/main/get_perl_info.h | 3 +-
tp/Texinfo/XS/main/option_types.h | 158 ++++++++++++++++++++++++
tp/Texinfo/XS/main/utils.c | 4 +-
tp/Texinfo/XS/main/utils.h | 6 +-
tp/maintain/regenerate_C_options_info.pl | 5 +-
13 files changed, 191 insertions(+), 152 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3e8ad598df..6f4749ec61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-01-13 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCES),
+ tp/Texinfo/XS/main/option_types.h (enum direction_unit_direction)
+ (FIRSTINFILE_*, NODE_DIRECTIONS_OFFSET, NON_SPECIAL_DIRECTIONS_NR)
+ (enum button_specification_type, enum button_information_type)
+ (enum button_function_type, BUTTON_SPECIFICATION_LIST)
+ (BUTTON_SPECIFICATION_INFO, BUTTON_SPECIFICATION, BUTTON_FUNCTION)
+ (FORMATTED_BUTTON_INFO, DIRECTION_ICON_LIST, OPTION),
+ tp/maintain/regenerate_C_options_info.pl: move definitions related to
+ an option to a separate header file, option_types.h. Update users.
+
2024-01-13 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/call_perl_function.c
diff --git a/tp/Texinfo/XS/Makefile.am b/tp/Texinfo/XS/Makefile.am
index ebe57d70fb..367d2e6c0d 100644
--- a/tp/Texinfo/XS/Makefile.am
+++ b/tp/Texinfo/XS/Makefile.am
@@ -145,6 +145,7 @@ libtexinfo_la_SOURCES= \
main/targets.c \
main/targets.h \
main/options_init_free.c \
+ main/option_types.h \
main/options_types.h \
main/global_commands_types.h \
main/utils.c \
diff --git a/tp/Texinfo/XS/convert/call_html_perl_function.c
b/tp/Texinfo/XS/convert/call_html_perl_function.c
index 7e1c760751..f50b08e176 100644
--- a/tp/Texinfo/XS/convert/call_html_perl_function.c
+++ b/tp/Texinfo/XS/convert/call_html_perl_function.c
@@ -31,6 +31,7 @@
#undef context
#include "text.h"
+#include "option_types.h"
#include "converter_types.h"
#include "utils.h"
/* for add_associated_info_integer */
diff --git a/tp/Texinfo/XS/convert/call_html_perl_function.h
b/tp/Texinfo/XS/convert/call_html_perl_function.h
index 098943acd7..eead166301 100644
--- a/tp/Texinfo/XS/convert/call_html_perl_function.h
+++ b/tp/Texinfo/XS/convert/call_html_perl_function.h
@@ -3,6 +3,7 @@
#define CALL_HTML_PERL_FUNCTION_H
#include "tree_types.h"
+#include "option_types.h"
#include "converter_types.h"
/* for TARGET_FILENAME */
#include "utils.h"
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 5dbe41f50f..0f5d68dc61 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -30,6 +30,7 @@
#include "tree_types.h"
#include "element_types.h"
#include "converter_types.h"
+#include "option_types.h"
#include "tree.h"
#include "builtin_commands.h"
#include "command_stack.h"
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 7d3ce3cfa6..2660df5fa3 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -27,6 +27,8 @@
#include "command_ids.h"
#include "tree_types.h"
+#include "option_types.h"
+#include "options_types.h"
#include "tree.h"
#include "extra.h"
#include "utils.h"
diff --git a/tp/Texinfo/XS/main/api_to_perl.c b/tp/Texinfo/XS/main/api_to_perl.c
index 0dabf7f9c2..7ff115c691 100644
--- a/tp/Texinfo/XS/main/api_to_perl.c
+++ b/tp/Texinfo/XS/main/api_to_perl.c
@@ -31,6 +31,7 @@
#undef context
#include "tree_types.h"
+#include "option_types.h"
#include "converter_types.h"
/* to be called when a tree element is destroyed, to remove the reference
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index 7903997e3c..1242838f47 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -23,12 +23,7 @@
#include "element_types.h"
#include "tree_types.h"
#include "document_types.h"
-/*
#include "options_types.h"
- */
-
-/* for interdependency with options_types.h */
-struct OPTIONS;
/* for interdependency with convert_to_text.h */
struct TEXT_OPTIONS;
@@ -171,7 +166,6 @@ enum html_argument_formatting_type {
#undef html_aft_type
};
-/* TODO move to convert_html.c? */
enum html_special_character {
SC_paragraph_symbol,
SC_left_quote,
@@ -201,18 +195,6 @@ enum htmlxref_split_type {
htmlxref_split_type_chapter,
};
-enum global_option_type {
- GO_NONE,
- GO_integer,
- GO_char,
- GO_bytes,
- GO_icons,
- GO_buttons,
- GO_bytes_string_list,
- GO_file_string_list,
- GO_char_string_list,
-};
-
typedef struct {
enum command_id *stack;
size_t top; /* One above last pushed command. */
@@ -698,8 +680,8 @@ typedef struct CONVERTER {
but we don't want to include the Perl headers everywhere; */
void *hv;
- struct OPTIONS *conf;
- struct OPTIONS *init_conf;
+ OPTIONS *conf;
+ OPTIONS *init_conf;
char *output_format;
EXPANDED_FORMAT *expanded_formats;
TRANSLATED_COMMAND *translated_commands;
@@ -776,7 +758,6 @@ typedef struct CONVERTER {
SORTED_INDEX_NAMES sorted_index_names;
STRING_LIST seen_ids;
/* potentially one target list per command (only for some actually) */
- /* TODO list with commands possibly associated to targets only? */
HTML_TARGET_LIST html_targets[BUILTIN_CMD_NUMBER];
HTML_TARGET_LIST html_special_targets[ST_footnote_location+1];
COMMAND_STACK html_target_cmds; /* list of cmd with targets */
@@ -837,128 +818,5 @@ typedef struct TRANSLATED_SUI_ASSOCIATION {
enum special_unit_info_type string_type;
} TRANSLATED_SUI_ASSOCIATION;
-/* FIXME move somewhere else? */
-
-/* button directions are not often used as enum, but it can be useful
- sometime to have an enum name for a direction */
-/* special units are put after these fixed types, they are dynamically
- determined from perl input */
-enum direction_unit_direction {
- #define hgdt_name(name) D_direction_ ## name,
- HTML_GLOBAL_DIRECTIONS_LIST
- #undef hgdt_name
- D_direction_Space,
- #define rud_type(name) D_direction_ ## name,
- RUD_DIRECTIONS_TYPES_LIST
- RUD_FILE_DIRECTIONS_TYPES
- #undef rud_type
- #define rud_type(name) D_direction_FirstInFile## name,
- RUD_DIRECTIONS_TYPES_LIST
- #undef rud_type
-};
-
-#define FIRSTINFILE_MIN_IDX D_direction_FirstInFileThis
-#define FIRSTINFILE_MAX_IDX D_direction_FirstInFileNodeBack
-#define FIRSTINFILE_OFFSET (D_direction_This - D_direction_FirstInFileThis)
-#define FIRSTINFILE_NR (FIRSTINFILE_MAX_IDX - FIRSTINFILE_MIN_IDX +1)
-#define NODE_DIRECTIONS_OFFSET (D_direction_NodeNext - D_direction_Next)
-
-#define NON_SPECIAL_DIRECTIONS_NR (FIRSTINFILE_MAX_IDX +1)
-
-enum button_specification_type {
- BST_direction,
- BST_function,
- BST_string,
- BST_direction_info,
-};
-
-enum button_information_type {
- BIT_string,
- BIT_function,
- BIT_selected_direction_information_type,
- BIT_href_direction_information_type,
-};
-
-/* enum value corresponding to a default button formatting function
- used later on to select a C function to replace the default function */
-/* longest strings first to avoid ambiguity */
-enum button_function_type {
- BFT_type_none,
- /* _default_panel_button_dynamic_direction_section_footer */
- BFT_type_panel_section_footer,
- /* _default_panel_button_dynamic_direction_node_footer */
- BFT_type_panel_node_footer,
- /* _default_panel_button_dynamic_direction */
- BFT_type_panel_directions,
-};
-
-typedef struct BUTTON_FUNCTION {
- /* perl references. This should be SV *sv_*,
- but we don't want to include the Perl headers everywhere; */
- void *sv_reference;
- enum button_function_type type;
-} BUTTON_FUNCTION;
-
-typedef struct BUTTON_SPECIFICATION_INFO {
- /* both global and relative directions index */
- int direction;
- enum button_information_type type;
- union {
- BUTTON_FUNCTION button_function; /* BIT_function */
- /* perl references. This should be SV *sv_*,
- but we don't want to include the Perl headers everywhere; */
- void *sv_string; /* BIT_string */
- /* both global and relative directions index */
- int direction_information_type; /* BIT_direction_information_type
- text string in perl, element direction information type */
- };
-} BUTTON_SPECIFICATION_INFO;
-
-typedef struct BUTTON_SPECIFICATION {
- void *sv; /* reference to perl data that can be used instead of
- the C data */
-
- enum button_specification_type type;
- union {
- /* both global and relative directions index */
- int direction; /* BST_direction, string with an element direction */
- /* perl references. This should be SV *sv_*,
- but we don't want to include the Perl headers everywhere; */
- void *sv_reference; /* BST_function */
- void *sv_string; /* BST_string scalar reference */
- BUTTON_SPECIFICATION_INFO *button_info; /* BST_direction_info
- array reference of length 2 */
- };
-} BUTTON_SPECIFICATION;
-
-typedef struct BUTTON_SPECIFICATION_LIST {
- void *av; /* reference to perl data that can be used instead of
- the list */
- size_t number;
- BUTTON_SPECIFICATION *list;
-} BUTTON_SPECIFICATION_LIST;
-
-typedef struct FORMATTED_BUTTON_INFO {
- char *active;
- char *passive;
- int need_delimiter;
-} FORMATTED_BUTTON_INFO;
-
-typedef struct DIRECTION_ICON_LIST {
- size_t number;
- char **list;
-} DIRECTION_ICON_LIST;
-
-typedef struct OPTION {
- enum global_option_type type;
- int configured;
- union {
- int integer;
- char *string;
- STRING_LIST *strlist;
- BUTTON_SPECIFICATION_LIST *buttons;
- DIRECTION_ICON_LIST *icons;
- };
-} OPTION;
-
#endif
+
diff --git a/tp/Texinfo/XS/main/get_perl_info.h
b/tp/Texinfo/XS/main/get_perl_info.h
index 5e61413dd8..3bbfa5f117 100644
--- a/tp/Texinfo/XS/main/get_perl_info.h
+++ b/tp/Texinfo/XS/main/get_perl_info.h
@@ -5,9 +5,10 @@
#include "EXTERN.h"
#include "perl.h"
-#include "options_types.h"
#include "tree_types.h"
#include "document_types.h"
+#include "option_types.h"
+#include "options_types.h"
#include "converter_types.h"
#include "convert_to_text.h"
diff --git a/tp/Texinfo/XS/main/option_types.h
b/tp/Texinfo/XS/main/option_types.h
new file mode 100644
index 0000000000..fe7f4d6be7
--- /dev/null
+++ b/tp/Texinfo/XS/main/option_types.h
@@ -0,0 +1,158 @@
+/* option_types.h - declarations of option type */
+#ifndef OPTIONS_TYPE_H
+#define OPTIONS_TYPE_H
+
+/* Copyright 2010-2023 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License 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 <stddef.h>
+
+#include "tree_types.h"
+
+enum global_option_type {
+ GO_NONE,
+ GO_integer,
+ GO_char,
+ GO_bytes,
+ GO_icons,
+ GO_buttons,
+ GO_bytes_string_list,
+ GO_file_string_list,
+ GO_char_string_list,
+};
+
+/* button directions are not often used as enum, but it can be useful
+ sometime to have an enum name for a direction */
+/* special units are put after these fixed types, they are dynamically
+ determined from perl input */
+enum direction_unit_direction {
+ #define hgdt_name(name) D_direction_ ## name,
+ HTML_GLOBAL_DIRECTIONS_LIST
+ #undef hgdt_name
+ D_direction_Space,
+ #define rud_type(name) D_direction_ ## name,
+ RUD_DIRECTIONS_TYPES_LIST
+ RUD_FILE_DIRECTIONS_TYPES
+ #undef rud_type
+ #define rud_type(name) D_direction_FirstInFile## name,
+ RUD_DIRECTIONS_TYPES_LIST
+ #undef rud_type
+};
+
+#define FIRSTINFILE_MIN_IDX D_direction_FirstInFileThis
+#define FIRSTINFILE_MAX_IDX D_direction_FirstInFileNodeBack
+#define FIRSTINFILE_OFFSET (D_direction_This - D_direction_FirstInFileThis)
+#define FIRSTINFILE_NR (FIRSTINFILE_MAX_IDX - FIRSTINFILE_MIN_IDX +1)
+#define NODE_DIRECTIONS_OFFSET (D_direction_NodeNext - D_direction_Next)
+
+#define NON_SPECIAL_DIRECTIONS_NR (FIRSTINFILE_MAX_IDX +1)
+
+enum button_specification_type {
+ BST_direction,
+ BST_function,
+ BST_string,
+ BST_direction_info,
+};
+
+enum button_information_type {
+ BIT_string,
+ BIT_function,
+ BIT_selected_direction_information_type,
+ BIT_href_direction_information_type,
+};
+
+/* enum value corresponding to a default button formatting function
+ used later on to select a C function to replace the default function */
+/* longest strings first to avoid ambiguity */
+enum button_function_type {
+ BFT_type_none,
+ /* _default_panel_button_dynamic_direction_section_footer */
+ BFT_type_panel_section_footer,
+ /* _default_panel_button_dynamic_direction_node_footer */
+ BFT_type_panel_node_footer,
+ /* _default_panel_button_dynamic_direction */
+ BFT_type_panel_directions,
+};
+
+typedef struct BUTTON_FUNCTION {
+ /* perl references. This should be SV *sv_*,
+ but we don't want to include the Perl headers everywhere; */
+ void *sv_reference;
+ enum button_function_type type;
+} BUTTON_FUNCTION;
+
+typedef struct BUTTON_SPECIFICATION_INFO {
+ /* both global and relative directions index */
+ int direction;
+ enum button_information_type type;
+ union {
+ BUTTON_FUNCTION button_function; /* BIT_function */
+ /* perl references. This should be SV *sv_*,
+ but we don't want to include the Perl headers everywhere; */
+ void *sv_string; /* BIT_string */
+ /* both global and relative directions index */
+ int direction_information_type; /* BIT_direction_information_type
+ text string in perl, element direction information type */
+ };
+} BUTTON_SPECIFICATION_INFO;
+
+typedef struct BUTTON_SPECIFICATION {
+ void *sv; /* reference to perl data that can be used instead of
+ the C data */
+
+ enum button_specification_type type;
+ union {
+ /* both global and relative directions index */
+ int direction; /* BST_direction, string with an element direction */
+ /* perl references. This should be SV *sv_*,
+ but we don't want to include the Perl headers everywhere; */
+ void *sv_reference; /* BST_function */
+ void *sv_string; /* BST_string scalar reference */
+ BUTTON_SPECIFICATION_INFO *button_info; /* BST_direction_info
+ array reference of length 2 */
+ };
+} BUTTON_SPECIFICATION;
+
+typedef struct BUTTON_SPECIFICATION_LIST {
+ void *av; /* reference to perl data that can be used instead of
+ the list */
+ size_t number;
+ BUTTON_SPECIFICATION *list;
+} BUTTON_SPECIFICATION_LIST;
+
+typedef struct FORMATTED_BUTTON_INFO {
+ char *active;
+ char *passive;
+ int need_delimiter;
+} FORMATTED_BUTTON_INFO;
+
+typedef struct DIRECTION_ICON_LIST {
+ size_t number;
+ char **list;
+} DIRECTION_ICON_LIST;
+
+typedef struct OPTION {
+ enum global_option_type type;
+ int configured;
+ union {
+ int integer;
+ char *string;
+ STRING_LIST *strlist;
+ BUTTON_SPECIFICATION_LIST *buttons;
+ DIRECTION_ICON_LIST *icons;
+ };
+} OPTION;
+
+#endif
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index aed55a74c5..61ff9067eb 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -31,8 +31,10 @@
#include <unictype.h>
#include "global_commands_types.h"
-#include "options_types.h"
#include "tree_types.h"
+#include "option_types.h"
+#include "options_types.h"
+#include "converter_types.h"
#include "command_ids.h"
#include "text.h"
/* also for xvasprintf */
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index cd52ebba70..38a6400f6c 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -20,11 +20,13 @@
#include <stddef.h>
#include <iconv.h>
-#include "options_types.h"
#include "global_commands_types.h"
-#include "tree_types.h"
#include "command_ids.h"
+#include "tree_types.h"
+#include "option_types.h"
+#include "options_types.h"
#include "document_types.h"
+#include "converter_types.h"
#include "builtin_commands.h"
extern const char *whitespace_chars;
diff --git a/tp/maintain/regenerate_C_options_info.pl
b/tp/maintain/regenerate_C_options_info.pl
index eecae4ad02..f1eac6bea2 100755
--- a/tp/maintain/regenerate_C_options_info.pl
+++ b/tp/maintain/regenerate_C_options_info.pl
@@ -99,10 +99,9 @@ open (HEADER, '>', $header_file)
or die "Open $header_file: $!\n";
print HEADER "/* Automatically generated from $0 */\n\n";
-print HEADER "#ifndef OPTIONS_TYPE_H\n#define OPTIONS_TYPE_H\n\n";
+print HEADER "#ifndef OPTIONS_TYPES_H\n#define OPTIONS_TYPES_H\n\n";
-print HEADER "#include \"tree_types.h\"\n";
-print HEADER "#include \"converter_types.h\"\n\n";
+print HEADER "#include \"main/option_types.h\"\n\n";
print HEADER "typedef struct OPTIONS {\n";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/Makefile.am (libtexinfo_la_SOURCES), tp/Texinfo/XS/main/option_types.h (enum direction_unit_direction) (FIRSTINFILE_*, NODE_DIRECTIONS_OFFSET, NON_SPECIAL_DIRECTIONS_NR) (enum button_specification_type, enum button_information_type) (enum button_function_type, BUTTON_SPECIFICATION_LIST) (BUTTON_SPECIFICATION_INFO, BUTTON_SPECIFICATION, BUTTON_FUNCTION) (FORMATTED_BUTTON_INFO, DIRECTION_ICON_LIST, OPTION), tp/maintain/regenerate_C_options_info.pl: move definitions related to [...],
Patrice Dumas <=