[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 11 Nov 2023 18:18:39 -0500 (EST) |
branch: master
commit 00325db36c299fa184030aab79af65b01b3c48f6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 12 00:14:06 2023 +0100
* tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state),
tp/Texinfo/XS/convert/converter.c (free_output_unit_files_file)
(clear_output_unit_files, free_output_unit_files)
(free_generic_converter): clear/free output_unit_files information.
---
ChangeLog | 7 +++++++
tp/TODO | 4 ++--
tp/Texinfo/XS/convert/convert_html.c | 1 +
tp/Texinfo/XS/convert/converter.c | 30 ++++++++++++++++++++++++++++++
tp/Texinfo/XS/convert/converter.h | 2 ++
5 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 70f9ac2b42..aa7290fb2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,13 @@
Advice to use uc_width instead of c32width from Bruno Haible.
c32width does not work for non-ASCII characters in the C locale.
+2023-11-11 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state),
+ tp/Texinfo/XS/convert/converter.c (free_output_unit_files_file)
+ (clear_output_unit_files, free_output_unit_files)
+ (free_generic_converter): clear/free output_unit_files information.
+
2023-11-11 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c (html_finalize_output_state),
diff --git a/tp/TODO b/tp/TODO
index c3c2412724..e7b3453928 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -51,7 +51,7 @@ html_special_targets html_finalize_output_state
index_entries html_finalize_output_state/destroy_merged_indices
index_entries_by_letter (letter string, letter entries...)
html_finalize_output_state/destroy_indices_sorted_by_letter
title_titlepage html_finalize_output_state
-output_unit_files
+output_unit_files html_finalize_output_state
output_files_information html_finalize_output_state
converter free
@@ -74,7 +74,7 @@ html_command_conversion html_destroy
no_arg_formatted_cmd_translated html_destroy
reset_target_commands html_destroy
file_changed_counter html_destroy
-output_unit_files
+output_unit_files free_generic_converter
output_files_information free_generic_converter
error_messages: with a check that it is empty?
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index f57d3a9b07..4b200cd9e1 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -2566,6 +2566,7 @@ html_finalize_output_state (CONVERTER *self)
}
clear_output_files_information (&self->output_files_information);
+ clear_output_unit_files (&self->output_unit_files);
html_pop_document_context (self);
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 59dceac6d3..edee23c94f 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -510,6 +510,35 @@ set_file_path (CONVERTER *self, char *filename, char
*filepath,
free (filepath_str);
}
+static void
+free_output_unit_files_file (FILE_NAME_PATH_COUNTER_LIST *output_unit_files)
+{
+ int i;
+ for (i = 0; i < output_unit_files->number; i++)
+ {
+ FILE_NAME_PATH_COUNTER *output_unit_file = &output_unit_files->list[i];
+ free (output_unit_file->filename);
+ free (output_unit_file->normalized_filename);
+ free (output_unit_file->filepath);
+ if (output_unit_file->body.space)
+ free (output_unit_file->body.text);
+ }
+}
+
+void
+clear_output_unit_files (FILE_NAME_PATH_COUNTER_LIST *output_unit_files)
+{
+ free_output_unit_files_file (output_unit_files);
+ output_unit_files->number = 0;
+}
+
+void
+free_output_unit_files (FILE_NAME_PATH_COUNTER_LIST *output_unit_files)
+{
+ free_output_unit_files_file (output_unit_files);
+ free (output_unit_files->list);
+}
+
void
free_generic_converter (CONVERTER *self)
{
@@ -529,4 +558,5 @@ free_generic_converter (CONVERTER *self)
free (self->conf);
free_output_files_information (&self->output_files_information);
+ free_output_unit_files (&self->output_unit_files);
}
diff --git a/tp/Texinfo/XS/convert/converter.h
b/tp/Texinfo/XS/convert/converter.h
index 22062f562d..1f46a4e3be 100644
--- a/tp/Texinfo/XS/convert/converter.h
+++ b/tp/Texinfo/XS/convert/converter.h
@@ -35,6 +35,8 @@ size_t set_output_unit_file (CONVERTER *self, OUTPUT_UNIT
*output_unit,
char *filename, int set_counter);
void set_file_path (CONVERTER *self, char *filename, char *filepath,
char *destination_directory);
+void clear_output_unit_files (FILE_NAME_PATH_COUNTER_LIST *output_unit_files);
+void free_output_unit_files (FILE_NAME_PATH_COUNTER_LIST *output_unit_files);
void free_generic_converter (CONVERTER *self);
#endif