[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources), tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug, fatal, isascii_* functions to a new file main/base_utils.c out of utils.c. |
Date: |
Sun, 17 Nov 2024 09:37:47 -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 9ae4553c3d * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources),
tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug, fatal,
isascii_* functions to a new file main/base_utils.c out of utils.c.
9ae4553c3d is described below
commit 9ae4553c3d872fe0fde9cac966f6a7be26aa63a7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 17 15:37:40 2024 +0100
* tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources),
tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug,
fatal, isascii_* functions to a new file main/base_utils.c out of
utils.c.
* tp/Texinfo/XS/Makefile.am (MiscXS_la_SOURCES, MiscXS_la_CPPFLAGS),
tp/Texinfo/XS/misc.c (xs_parse_command_name): use isascii_alnum in
xs_parse_command_name. Otherwise in some cases (perl 5.40 on macos)
bytes part of UTF-8 strings are incorrectly considered to be alnum.
Set -UHAVE_CONFIG_H in MiscXS_la_CPPFLAGS such as not to include
config.h in base_utils.c as there is no need for config.h inclusion
for MiscXS since Gnulib is not used at all for this XS object.
---
ChangeLog | 15 +++++
tp/Texinfo/XS/Makefile.am | 7 ++-
tp/Texinfo/XS/convert/build_html_perl_info.c | 4 +-
tp/Texinfo/XS/convert/convert_html.c | 4 +-
tp/Texinfo/XS/convert/converter.c | 3 +
tp/Texinfo/XS/convert/format_html.c | 2 +
tp/Texinfo/XS/convert/get_html_perl_info.c | 2 +
tp/Texinfo/XS/convert/html_conversion_state.c | 4 +-
tp/Texinfo/XS/convert/html_prepare_converter.c | 2 +
tp/Texinfo/XS/main/base_utils.c | 72 ++++++++++++++++++++++
tp/Texinfo/XS/main/base_utils.h | 29 +++++++++
tp/Texinfo/XS/main/build_perl_info.c | 4 +-
tp/Texinfo/XS/main/command_stack.c | 6 +-
tp/Texinfo/XS/main/document.c | 2 +
tp/Texinfo/XS/main/errors.c | 2 +
tp/Texinfo/XS/main/extra.c | 4 +-
tp/Texinfo/XS/main/get_perl_info.c | 3 +
tp/Texinfo/XS/main/manipulate_indices.c | 4 ++
tp/Texinfo/XS/main/manipulate_tree.c | 4 ++
tp/Texinfo/XS/main/node_name_normalization.c | 4 +-
tp/Texinfo/XS/main/output_unit.c | 5 +-
tp/Texinfo/XS/main/parser_conf.c | 4 +-
tp/Texinfo/XS/main/targets.c | 4 +-
tp/Texinfo/XS/main/translations.c | 3 +
tp/Texinfo/XS/main/tree.c | 2 +
tp/Texinfo/XS/main/unicode.c | 4 +-
tp/Texinfo/XS/main/unicode.h | 1 +
tp/Texinfo/XS/main/utils.c | 43 +------------
tp/Texinfo/XS/main/utils.h | 8 ---
tp/Texinfo/XS/misc.c | 7 ++-
tp/Texinfo/XS/parsetexi/close.c | 4 +-
tp/Texinfo/XS/parsetexi/commands.c | 3 +-
tp/Texinfo/XS/parsetexi/context_stack.c | 4 +-
tp/Texinfo/XS/parsetexi/counter.c | 3 +-
tp/Texinfo/XS/parsetexi/def.c | 5 +-
tp/Texinfo/XS/parsetexi/end_line.c | 7 ++-
tp/Texinfo/XS/parsetexi/handle_commands.c | 5 +-
tp/Texinfo/XS/parsetexi/indices.c | 3 +
tp/Texinfo/XS/parsetexi/input.c | 2 +
tp/Texinfo/XS/parsetexi/labels.c | 4 +-
tp/Texinfo/XS/parsetexi/macro.c | 5 +-
tp/Texinfo/XS/parsetexi/menus.c | 3 +
tp/Texinfo/XS/parsetexi/parser.c | 5 +-
tp/Texinfo/XS/parsetexi/separator.c | 5 +-
tp/Texinfo/XS/structuring_transfo/structuring.c | 3 +
.../XS/structuring_transfo/transformations.c | 4 ++
tp/Texinfo/XS/xspara.c | 1 +
47 files changed, 241 insertions(+), 83 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 62d9604ebf..6d28b0ea55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2024-11-17 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources),
+ tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug,
+ fatal, isascii_* functions to a new file main/base_utils.c out of
+ utils.c.
+
+ * tp/Texinfo/XS/Makefile.am (MiscXS_la_SOURCES, MiscXS_la_CPPFLAGS),
+ tp/Texinfo/XS/misc.c (xs_parse_command_name): use isascii_alnum in
+ xs_parse_command_name. Otherwise in some cases (perl 5.40 on macos)
+ bytes part of UTF-8 strings are incorrectly considered to be alnum.
+ Set -UHAVE_CONFIG_H in MiscXS_la_CPPFLAGS such as not to include
+ config.h in base_utils.c as there is no need for config.h inclusion
+ for MiscXS since Gnulib is not used at all for this XS object.
+
2024-11-17 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/utils.c (isascii_alnum, isascii_alpha)
diff --git a/tp/Texinfo/XS/Makefile.am b/tp/Texinfo/XS/Makefile.am
index 7ffc47f00f..cb6fa79c4b 100644
--- a/tp/Texinfo/XS/Makefile.am
+++ b/tp/Texinfo/XS/Makefile.am
@@ -85,8 +85,8 @@ install-data-hook:
xs_LTLIBRARIES += MiscXS.la
nodist_MiscXS_la_SOURCES = MiscXS.c
CLEANFILES += MiscXS.c
-MiscXS_la_SOURCES = misc.c miscxs.h ppport.h
-MiscXS_la_CPPFLAGS = $(AM_CPPFLAGS) $(XSLIBS_CPPFLAGS)
+MiscXS_la_SOURCES = misc.c miscxs.h main/base_utils.c main/base_utils.h
+MiscXS_la_CPPFLAGS = -I$(srcdir)/main $(AM_CPPFLAGS) $(XSLIBS_CPPFLAGS)
-UHAVE_CONFIG_H
MiscXS_la_CFLAGS = $(XSLIBS_CFLAGS)
MiscXS_la_LIBADD = $(platform_PERL_LIBADD)
MiscXS_la_LDFLAGS = $(XSLIBS_LDFLAGS)
@@ -105,7 +105,6 @@ xs_LTLIBRARIES += XSParagraph.la
nodist_XSParagraph_la_SOURCES = XSParagraph.c
CLEANFILES += XSParagraph.c
# FIXME not included?
-XSParagraph_la_SOURCES = ppport.h
XSParagraph_la_CFLAGS = $(XSLIBS_CFLAGS)
XSParagraph_la_CPPFLAGS = $(AM_CPPFLAGS) $(XSLIBS_CPPFLAGS)
XSParagraph_la_LIBADD = libparagraph.la $(platform_PERL_LIBADD)
@@ -146,6 +145,8 @@ C_libtexinfo_sources = \
main/tree.h \
main/text.c \
main/text.h \
+ main/base_utils.c \
+ main/base_utils.h \
main/element_types.c \
main/element_types.h \
main/command_ids.h \
diff --git a/tp/Texinfo/XS/convert/build_html_perl_info.c
b/tp/Texinfo/XS/convert/build_html_perl_info.c
index 9839f2bc94..9270ff5c77 100644
--- a/tp/Texinfo/XS/convert/build_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/build_html_perl_info.c
@@ -29,9 +29,11 @@
#include "html_conversion_data.h"
#include "tree_types.h"
#include "converter_types.h"
+/* bug */
+#include "base_utils.h"
/* for builtin_command_name */
#include "builtin_commands.h"
-/* for fatal HMSF_* */
+/* for HMSF_* */
#include "utils.h"
/* next two could be interesting for debugging */
/*
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 881bcbd2bc..2ce8ed6958 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -31,11 +31,13 @@
#include "option_types.h"
#include "types_data.h"
#include "html_converter_types.h"
+/* fatal isascii_alpha */
+#include "base_utils.h"
#include "tree.h"
#include "builtin_commands.h"
#include "command_stack.h"
#include "errors.h"
-/* xasprintf get_label_element output_conversions ENCODING_CONVERSION fatal
+/* xasprintf get_label_element output_conversions ENCODING_CONVERSION
encode_with_iconv output_unit_type_names get_cmd_global_uniq_command
*/
#include "utils.h"
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index ef90ed4a92..c9d15dc597 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -16,6 +16,7 @@
/* functions in this file correspond to Texinfo::Convert::Converter */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -41,6 +42,8 @@
#include "converter_types.h"
#include "options_defaults.h"
#include "converters_options.h"
+/* fatal isascii_alnum isascii_alpha */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
/* for COMMAND_OPTION_DEFAULT ACCENTS_STACK
diff --git a/tp/Texinfo/XS/convert/format_html.c
b/tp/Texinfo/XS/convert/format_html.c
index bd9e0ea8e5..e09dfcdd24 100644
--- a/tp/Texinfo/XS/convert/format_html.c
+++ b/tp/Texinfo/XS/convert/format_html.c
@@ -36,6 +36,8 @@
#include "option_types.h"
#include "types_data.h"
#include "html_converter_types.h"
+/* fatal isascii_alnum isascii_alpha isascii_digit isascii_lower */
+#include "base_utils.h"
#include "tree.h"
#include "builtin_commands.h"
#include "command_stack.h"
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index 6942872308..4d4a598f09 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -32,6 +32,8 @@
#include "types_data.h"
/* non_perl_* */
#include "xs_utils.h"
+/* fatal */
+#include "base_utils.h"
/* also for direction_string_type_names direction_string_context_names
html_conversion_context_type_names html_stage_handler_stage_type_names
*/
diff --git a/tp/Texinfo/XS/convert/html_conversion_state.c
b/tp/Texinfo/XS/convert/html_conversion_state.c
index d5605f13c5..ba251c45bb 100644
--- a/tp/Texinfo/XS/convert/html_conversion_state.c
+++ b/tp/Texinfo/XS/convert/html_conversion_state.c
@@ -25,9 +25,11 @@
#include "element_types.h"
#include "converter_types.h"
#include "html_converter_types.h"
+/* fatal */
+#include "base_utils.h"
#include "command_stack.h"
#include "builtin_commands.h"
-/* new_string_list add_string fatal */
+/* new_string_list add_string */
#include "utils.h"
#include "html_conversion_state.h"
diff --git a/tp/Texinfo/XS/convert/html_prepare_converter.c
b/tp/Texinfo/XS/convert/html_prepare_converter.c
index 0fd0bc28f4..480075a634 100644
--- a/tp/Texinfo/XS/convert/html_prepare_converter.c
+++ b/tp/Texinfo/XS/convert/html_prepare_converter.c
@@ -30,6 +30,8 @@
#include "tree_types.h"
#include "converter_types.h"
#include "html_conversion_data.h"
+/* bug fatal isascii_alnum isascii_alpha */
+#include "base_utils.h"
/* new_element */
#include "tree.h"
#include "errors.h"
diff --git a/tp/Texinfo/XS/main/base_utils.c b/tp/Texinfo/XS/main/base_utils.c
new file mode 100644
index 0000000000..bdb9bad8cd
--- /dev/null
+++ b/tp/Texinfo/XS/main/base_utils.c
@@ -0,0 +1,72 @@
+/* Copyright 2010-2024 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/>. */
+
+/* code also used in MiscXS C code, avoid requiring Gnulib */
+
+/* even when there are no Gnulib functions used, Gnulib replacement headers
+ will be used instead of libc headers if the Gnulib headers directory is
+ searched for header files. In that case, including config.h is required.
+ Set/unset HAVE_CONFIG_H to have config.h included or not.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+
+void bug (char *message)
+{
+ fprintf (stderr, "texi2any (XS): bug: %s\n", message);
+}
+
+void fatal (char *message)
+{
+ bug (message);
+ abort ();
+}
+
+int
+isascii_alnum (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && isalnum (c));
+}
+
+int
+isascii_alpha (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && isalpha (c));
+}
+
+int
+isascii_digit (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && isdigit (c));
+}
+
+int
+isascii_lower (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && islower (c));
+}
+
+int
+isascii_upper (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && isupper (c));
+}
+
diff --git a/tp/Texinfo/XS/main/base_utils.h b/tp/Texinfo/XS/main/base_utils.h
new file mode 100644
index 0000000000..0e5e9542ff
--- /dev/null
+++ b/tp/Texinfo/XS/main/base_utils.h
@@ -0,0 +1,29 @@
+/* base_utils.h - declarations for base_utils.c */
+#ifndef BASE_UTILS_H
+#define BASE_UTILS_H
+
+/* Copyright 2010-2024 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/>. */
+
+void fatal (char *);
+void bug (char *);
+
+int isascii_alnum (unsigned char c);
+int isascii_alpha (unsigned char c);
+int isascii_digit (unsigned char c);
+int isascii_lower (unsigned char c);
+int isascii_upper (unsigned char c);
+
+#endif
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index bb6f08853c..12477ac0fb 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -61,11 +61,13 @@
#include "converter_types.h"
/* non_perl_* */
#include "xs_utils.h"
+/* fatal */
+#include "base_utils.h"
/* for ai_key_names elt_info_names */
#include "tree.h"
/* for element_command_name */
#include "builtin_commands.h"
-/* for xasprintf get_encoding_conversion output_conversions fatal
+/* for xasprintf get_encoding_conversion output_conversions
direction_names expanded_formats_number output_unit_type_names
informative_command_value get_global_document_command */
#include "utils.h"
diff --git a/tp/Texinfo/XS/main/command_stack.c
b/tp/Texinfo/XS/main/command_stack.c
index 6e3b449230..f72337a371 100644
--- a/tp/Texinfo/XS/main/command_stack.c
+++ b/tp/Texinfo/XS/main/command_stack.c
@@ -19,10 +19,8 @@
#include "tree_types.h"
#include "command_ids.h"
-/*
-#include "commands.h"
- */
-#include "utils.h"
+/* fatal */
+#include "base_utils.h"
#include "command_stack.h"
/* Generic stack functions */
diff --git a/tp/Texinfo/XS/main/document.c b/tp/Texinfo/XS/main/document.c
index e418fd9c14..5da9009380 100644
--- a/tp/Texinfo/XS/main/document.c
+++ b/tp/Texinfo/XS/main/document.c
@@ -24,6 +24,8 @@
#include "tree_types.h"
#include "options_data.h"
#include "document_types.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "errors.h"
#include "debug.h"
diff --git a/tp/Texinfo/XS/main/errors.c b/tp/Texinfo/XS/main/errors.c
index 160642f127..aa488cde08 100644
--- a/tp/Texinfo/XS/main/errors.c
+++ b/tp/Texinfo/XS/main/errors.c
@@ -31,6 +31,8 @@
#include "tree_types.h"
#include "document_types.h"
/* for fatal */
+#include "base_utils.h"
+/* for ENCODING_CONVERSION output_conversions get_encoding_conversion */
#include "utils.h"
#include "errors.h"
diff --git a/tp/Texinfo/XS/main/extra.c b/tp/Texinfo/XS/main/extra.c
index 9161060113..e3a2e69625 100644
--- a/tp/Texinfo/XS/main/extra.c
+++ b/tp/Texinfo/XS/main/extra.c
@@ -21,7 +21,9 @@
#include "tree_types.h"
/* for new_list */
#include "tree.h"
-/* for fatal and directions_length */
+/* for fatal */
+#include "base_utils.h"
+/* for directions_length */
#include "utils.h"
#include "debug.h"
#include "extra.h"
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index bd2a7b4124..7f6b876269 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -33,9 +33,12 @@
#include "converter_types.h"
/* non_perl_* */
#include "xs_utils.h"
+/* fatal */
+#include "base_utils.h"
#include "extra.h"
#include "builtin_commands.h"
#include "debug.h"
+/* add_include_directory add_string html_free_button_specification_list ... */
#include "utils.h"
#include "customization_options.h"
#include "errors.h"
diff --git a/tp/Texinfo/XS/main/manipulate_indices.c
b/tp/Texinfo/XS/main/manipulate_indices.c
index 26f9882907..f012e5a1f0 100644
--- a/tp/Texinfo/XS/main/manipulate_indices.c
+++ b/tp/Texinfo/XS/main/manipulate_indices.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -28,9 +29,12 @@
#include "tree_types.h"
#include "document_types.h"
#include "converter_types.h"
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
+/* whitespace_chars ultimate_index indices_info_index_by_name
+ to_upper_or_lower_multibyte */
#include "utils.h"
#include "errors.h"
#include "debug.h"
diff --git a/tp/Texinfo/XS/main/manipulate_tree.c
b/tp/Texinfo/XS/main/manipulate_tree.c
index e7a3c3d072..b84316f742 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.c
+++ b/tp/Texinfo/XS/main/manipulate_tree.c
@@ -27,11 +27,15 @@
#include "command_ids.h"
#include "types_data.h"
#include "text.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
#include "debug.h"
#include "targets.h"
+/* for directions_length new_string_list copy_strings count_multibyte
+ whitespace_chars */
#include "utils.h"
#include "manipulate_tree.h"
#include "unicode.h"
diff --git a/tp/Texinfo/XS/main/node_name_normalization.c
b/tp/Texinfo/XS/main/node_name_normalization.c
index bd36e2a876..827b945b3e 100644
--- a/tp/Texinfo/XS/main/node_name_normalization.c
+++ b/tp/Texinfo/XS/main/node_name_normalization.c
@@ -28,10 +28,12 @@
#include "element_types.h"
#include "tree_types.h"
#include "types_data.h"
+/* isascii_alnum bug */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for xasprintf whitespace_chars, isascii_alnum and bug */
+/* for xasprintf whitespace_chars */
#include "utils.h"
#include "debug.h"
#include "call_perl_function.h"
diff --git a/tp/Texinfo/XS/main/output_unit.c b/tp/Texinfo/XS/main/output_unit.c
index 1dba163069..d68a6bf64d 100644
--- a/tp/Texinfo/XS/main/output_unit.c
+++ b/tp/Texinfo/XS/main/output_unit.c
@@ -17,6 +17,7 @@
used in converters */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -26,11 +27,13 @@
#include "element_types.h"
#include "tree_types.h"
#include "document_types.h"
+/* for fatal */
+#include "base_utils.h"
#include "tree.h"
#include "builtin_commands.h"
#include "extra.h"
#include "command_stack.h"
-/* for xasprintf fatal */
+/* for xasprintf */
#include "utils.h"
#include "debug.h"
#include "targets.h"
diff --git a/tp/Texinfo/XS/main/parser_conf.c b/tp/Texinfo/XS/main/parser_conf.c
index 0b03235a8c..365289e7fc 100644
--- a/tp/Texinfo/XS/main/parser_conf.c
+++ b/tp/Texinfo/XS/main/parser_conf.c
@@ -20,7 +20,9 @@
#include <stdlib.h>
#include <string.h>
-/* fatal clear_strings_list wipe_values ... */
+/* fatal */
+#include "base_utils.h"
+/* clear_strings_list wipe_values ... */
#include "utils.h"
#include "parser_conf.h"
diff --git a/tp/Texinfo/XS/main/targets.c b/tp/Texinfo/XS/main/targets.c
index 55dc826d6a..d9137d49e1 100644
--- a/tp/Texinfo/XS/main/targets.c
+++ b/tp/Texinfo/XS/main/targets.c
@@ -22,12 +22,14 @@
#include "tree_types.h"
#include "document_types.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "errors.h"
#include "debug.h"
#include "builtin_commands.h"
-/* for get_label_element and fatal */
#include "extra.h"
+/* for get_label_element */
#include "utils.h"
#include "convert_to_texinfo.h"
/* for retrieve_document */
diff --git a/tp/Texinfo/XS/main/translations.c
b/tp/Texinfo/XS/main/translations.c
index fb681059c7..7964358212 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -34,7 +34,10 @@
#include "tree_types.h"
#include "options_data.h"
#include "types_data.h"
+/* isascii_lower isascii_upper fatal */
+#include "base_utils.h"
#include "tree.h"
+/* read_flag_len */
#include "utils.h"
#include "api_to_perl.h"
#include "debug.h"
diff --git a/tp/Texinfo/XS/main/tree.c b/tp/Texinfo/XS/main/tree.c
index 5e43f34493..7ad3e2371c 100644
--- a/tp/Texinfo/XS/main/tree.c
+++ b/tp/Texinfo/XS/main/tree.c
@@ -22,6 +22,8 @@
#include "tree_types.h"
#include "types_data.h"
/* for fatal */
+#include "base_utils.h"
+/* for destroy_strings_list */
#include "utils.h"
/* for debug
#include "debug.h"
diff --git a/tp/Texinfo/XS/main/unicode.c b/tp/Texinfo/XS/main/unicode.c
index 59778b7c5c..2c0a9e9ea5 100644
--- a/tp/Texinfo/XS/main/unicode.c
+++ b/tp/Texinfo/XS/main/unicode.c
@@ -31,10 +31,12 @@
#include "command_ids.h"
#include "tree_types.h"
#include "converter_types.h"
+/* for fatal */
+#include "base_utils.h"
#include "errors.h"
/* for element_builtin_cmd */
#include "builtin_commands.h"
-/* for fatal xasprintf to_upper_or_lower_multibyte normalize_encoding_name */
+/* for xasprintf to_upper_or_lower_multibyte normalize_encoding_name */
#include "utils.h"
#include "unicode.h"
diff --git a/tp/Texinfo/XS/main/unicode.h b/tp/Texinfo/XS/main/unicode.h
index f59b593e5a..9d4204e01b 100644
--- a/tp/Texinfo/XS/main/unicode.h
+++ b/tp/Texinfo/XS/main/unicode.h
@@ -7,6 +7,7 @@
#include "command_ids.h"
#include "tree_types.h"
+#include "converter_types.h"
typedef struct ENCODING_CODEPOINTS {
const char *encoding;
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 8960aef7f4..6248e1b7f9 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -50,6 +50,8 @@
#include "document_types.h"
#include "converter_types.h"
#include "types_data.h"
+/* isascii_alnum isascii_alpha isascii_upper */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
@@ -197,47 +199,6 @@ xasprintf (char **ptr, const char *template, ...)
return ret;
}
-void bug (char *message)
-{
- fprintf (stderr, "texi2any (XS): bug: %s\n", message);
-}
-
-void fatal (char *message)
-{
- bug (message);
- abort ();
-}
-
-int
-isascii_alnum (unsigned char c)
-{
- return (((c & ~0x7f) == 0) && isalnum (c));
-}
-
-int
-isascii_alpha (unsigned char c)
-{
- return (((c & ~0x7f) == 0) && isalpha (c));
-}
-
-int
-isascii_digit (unsigned char c)
-{
- return (((c & ~0x7f) == 0) && isdigit (c));
-}
-
-int
-isascii_lower (unsigned char c)
-{
- return (((c & ~0x7f) == 0) && islower (c));
-}
-
-int
-isascii_upper (unsigned char c)
-{
- return (((c & ~0x7f) == 0) && isupper (c));
-}
-
/* Setup global information that is not specific of Texinfo.
diff --git a/tp/Texinfo/XS/main/utils.h b/tp/Texinfo/XS/main/utils.h
index a12134d418..be35e9fe2a 100644
--- a/tp/Texinfo/XS/main/utils.h
+++ b/tp/Texinfo/XS/main/utils.h
@@ -110,14 +110,6 @@ typedef struct ACCENTS_STACK {
int xasprintf (char **ptr, const char *template, ...);
-void fatal (char *);
-void bug (char *);
-
-int isascii_alnum (unsigned char c);
-int isascii_alpha (unsigned char c);
-int isascii_digit (unsigned char c);
-int isascii_lower (unsigned char c);
-int isascii_upper (unsigned char c);
size_t count_multibyte (const char *text);
char *to_upper_or_lower_multibyte (const char *text, int lower_or_upper);
int width_multibyte (const char *text);
diff --git a/tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c
index 13f030b287..f6bc46c7dc 100644
--- a/tp/Texinfo/XS/misc.c
+++ b/tp/Texinfo/XS/misc.c
@@ -16,8 +16,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
+/* isascii_alnum */
+#include "base_utils.h"
#include "miscxs.h"
const char *whitespace_chars = " \t\f\v\r\n";
@@ -259,14 +260,14 @@ void xs_parse_command_name (char *text,
*command = 0;
*is_single_letter = 0;
- if (isalnum ((unsigned char) text[0]))
+ if (isascii_alnum (text[0]))
{
char *p, *q;
static char *s;
p = text;
q = text + 1;
- while (isalnum ((unsigned char) *q) || *q == '-' || *q == '_')
+ while (isascii_alnum (*q) || *q == '-' || *q == '_')
q++;
s = realloc (s, q - p + 1);
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index e1407148e7..29daf24e4a 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -23,11 +23,11 @@
#include "tree_types.h"
#include "types_data.h"
#include "text.h"
+/* for fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for fatal */
-#include "utils.h"
#include "command_stack.h"
#include "counter.h"
#include "commands.h"
diff --git a/tp/Texinfo/XS/parsetexi/commands.c
b/tp/Texinfo/XS/parsetexi/commands.c
index 98df12ac64..5d4eba45da 100644
--- a/tp/Texinfo/XS/parsetexi/commands.c
+++ b/tp/Texinfo/XS/parsetexi/commands.c
@@ -20,7 +20,8 @@
#include "command_ids.h"
#include "builtin_commands.h"
-#include "utils.h"
+/* fatal */
+#include "base_utils.h"
/* for global_parser_conf */
#include "parser_conf.h"
/* for lookup_macro and unset_macro_record */
diff --git a/tp/Texinfo/XS/parsetexi/context_stack.c
b/tp/Texinfo/XS/parsetexi/context_stack.c
index e4460b6830..cdd06b23b8 100644
--- a/tp/Texinfo/XS/parsetexi/context_stack.c
+++ b/tp/Texinfo/XS/parsetexi/context_stack.c
@@ -14,11 +14,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include "command_ids.h"
#include "tree_types.h"
-#include "utils.h"
+/* for fatal */
+#include "base_utils.h"
#include "command_stack.h"
#include "commands.h"
#include "debug_parser.h"
diff --git a/tp/Texinfo/XS/parsetexi/counter.c
b/tp/Texinfo/XS/parsetexi/counter.c
index a0467eada0..66865c9a0e 100644
--- a/tp/Texinfo/XS/parsetexi/counter.c
+++ b/tp/Texinfo/XS/parsetexi/counter.c
@@ -14,13 +14,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "tree_types.h"
/* for fatal */
-#include "utils.h"
+#include "base_utils.h"
#include "debug.h"
#include "counter.h"
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index 669b4618fc..584af492f3 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
@@ -24,10 +25,12 @@
#include "tree_types.h"
#include "text.h"
#include "types_data.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "builtin_commands.h"
#include "extra.h"
-/* for whitespace_chars fatal def_aliases */
+/* for whitespace_chars def_aliases */
#include "utils.h"
/* for relocate_source_marks */
#include "manipulate_tree.h"
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c
b/tp/Texinfo/XS/parsetexi/end_line.c
index ea9c4fcf28..3b78fd9b76 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -26,11 +27,13 @@
#include "tree_types.h"
#include "text.h"
#include "types_data.h"
+/* for isascii_alnum fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for isascii_alnum whitespace_chars read_flag_len
- indices_info_index_by_name ultimate_index fatal */
+/* for whitespace_chars read_flag_len
+ indices_info_index_by_name ultimate_index */
#include "utils.h"
/* for parse_float_type add_to_float_record_list */
#include "floats.h"
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 8baba6286b..7ee27dd621 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -25,10 +26,12 @@
#include "tree_types.h"
#include "types_data.h"
#include "text.h"
+/* isascii_alnum fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for isascii_alnum whitespace_chars read_flag_len item_line_parent */
+/* for whitespace_chars read_flag_len item_line_parent */
#include "utils.h"
#include "command_stack.h"
/* for global_parser_conf */
diff --git a/tp/Texinfo/XS/parsetexi/indices.c
b/tp/Texinfo/XS/parsetexi/indices.c
index 4ec3cffd94..0fec342510 100644
--- a/tp/Texinfo/XS/parsetexi/indices.c
+++ b/tp/Texinfo/XS/parsetexi/indices.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -24,6 +25,8 @@
/* document used in complete_indices */
#include "document_types.h"
#include "types_data.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 8cd00d2b10..67ca957c33 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -22,6 +22,8 @@
#include <errno.h>
#include "text.h"
+/* for fatal */
+#include "base_utils.h"
/* for xasprintf and other */
#include "utils.h"
/* for global_parser_conf */
diff --git a/tp/Texinfo/XS/parsetexi/labels.c b/tp/Texinfo/XS/parsetexi/labels.c
index 6023e50026..b28459469d 100644
--- a/tp/Texinfo/XS/parsetexi/labels.c
+++ b/tp/Texinfo/XS/parsetexi/labels.c
@@ -19,11 +19,13 @@
#include <stdlib.h>
#include "tree_types.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
/* for element_command_name */
#include "builtin_commands.h"
-/* for whitespace_chars and count_multibyte */
+/* for whitespace_chars count_multibyte */
#include "utils.h"
/* for parse_node_manual */
#include "manipulate_tree.h"
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index 81a6d4e18d..3de00fdf0b 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -23,9 +24,11 @@
#include "tree_types.h"
/* for VALUE */
#include "document_types.h"
+/* bug fatal isascii_alnum */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
-/* for isascii_alnum whitespace_chars wipe_values */
+/* for whitespace_chars wipe_values */
#include "utils.h"
#include "convert_to_texinfo.h"
/* for global_parser_conf */
diff --git a/tp/Texinfo/XS/parsetexi/menus.c b/tp/Texinfo/XS/parsetexi/menus.c
index 22c1579a67..0192073d49 100644
--- a/tp/Texinfo/XS/parsetexi/menus.c
+++ b/tp/Texinfo/XS/parsetexi/menus.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
@@ -21,6 +22,8 @@
#include "tree_types.h"
#include "text.h"
#include "types_data.h"
+/* for bug */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
/* for whitespace_chars */
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index fd13721bf1..4db9c978f9 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -24,10 +25,12 @@
#include "tree_types.h"
#include "global_commands_types.h"
#include "types_data.h"
+/* isascii_alnum fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for isascii_alnum, whitespace_chars, read_flag_len, item_line_parent
+/* for whitespace_chars, read_flag_len, item_line_parent
delete_global_info, parse_line_directive, count_multibyte */
#include "utils.h"
#include "command_stack.h"
diff --git a/tp/Texinfo/XS/parsetexi/separator.c
b/tp/Texinfo/XS/parsetexi/separator.c
index 338ec9da07..290a14db52 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -23,11 +24,11 @@
#include "tree_types.h"
#include "text.h"
#include "types_data.h"
+/* for bug */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
-/* for fatal */
-#include "utils.h"
#include "command_stack.h"
/* for parse_node_manual */
#include "manipulate_tree.h"
diff --git a/tp/Texinfo/XS/structuring_transfo/structuring.c
b/tp/Texinfo/XS/structuring_transfo/structuring.c
index ad848e7753..38678f42a9 100644
--- a/tp/Texinfo/XS/structuring_transfo/structuring.c
+++ b/tp/Texinfo/XS/structuring_transfo/structuring.c
@@ -16,6 +16,7 @@
/* In sync with Texinfo::Structuring */
#include <config.h>
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -27,6 +28,8 @@
#include "global_commands_types.h"
#include "options_data.h"
#include "document_types.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
diff --git a/tp/Texinfo/XS/structuring_transfo/transformations.c
b/tp/Texinfo/XS/structuring_transfo/transformations.c
index 26318c415d..6b683dcdde 100644
--- a/tp/Texinfo/XS/structuring_transfo/transformations.c
+++ b/tp/Texinfo/XS/structuring_transfo/transformations.c
@@ -31,11 +31,15 @@
#include "tree_types.h"
#include "document_types.h"
#include "types_data.h"
+/* fatal */
+#include "base_utils.h"
#include "tree.h"
#include "extra.h"
#include "builtin_commands.h"
#include "errors.h"
#include "debug.h"
+/* indices_info_index_by_name section_level whitespace_chars
+ parse_line_directive ... */
#include "utils.h"
/* for copy_contents normalized_menu_entry_internal_node modify_tree
protect_colon_in_tree new_asis_command_with_text
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index e6428143cf..971260846d 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -16,6 +16,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources), tp/Texinfo/XS/main/base_utils.c, tp/Texinfo/XS/main/utils.c: move bug, fatal, isascii_* functions to a new file main/base_utils.c out of utils.c.,
Patrice Dumas <=