[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (fill_outp
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (fill_output_units_descriptor_av, build_output_units_list) (rebuild_output_units_list): add fill_output_units_descriptor_av with code common to build_output_units_list and rebuild_output_units_list. |
Date: |
Tue, 20 Feb 2024 07:15:28 -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 99d4e7c757 * tp/Texinfo/XS/main/build_perl_info.c
(fill_output_units_descriptor_av, build_output_units_list)
(rebuild_output_units_list): add fill_output_units_descriptor_av with code
common to build_output_units_list and rebuild_output_units_list.
99d4e7c757 is described below
commit 99d4e7c7570d99414a67c5a88cb0106ff12f4ed1
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 20 13:15:25 2024 +0100
* tp/Texinfo/XS/main/build_perl_info.c
(fill_output_units_descriptor_av, build_output_units_list)
(rebuild_output_units_list): add fill_output_units_descriptor_av with
code common to build_output_units_list and rebuild_output_units_list.
---
ChangeLog | 7 ++++++
tp/Texinfo/XS/main/build_perl_info.c | 49 +++++++++++++++++++++---------------
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fd5d88f30a..78f75c56e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-02-20 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/build_perl_info.c
+ (fill_output_units_descriptor_av, build_output_units_list)
+ (rebuild_output_units_list): add fill_output_units_descriptor_av with
+ code common to build_output_units_list and rebuild_output_units_list.
+
2024-02-20 Patrice Dumas <pertusus@free.fr>
Wrapper for u8_strconv_to_encoding
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index baabbe1e29..60b5ed7406 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1501,10 +1501,10 @@ fill_output_units (AV *av_output_units,
OUTPUT_UNIT_LIST *output_units)
}
}
-SV *
-build_output_units_list (size_t output_units_descriptor)
+static int
+fill_output_units_descriptor_av (AV *av_output_units,
+ size_t output_units_descriptor)
{
- AV *av_output_units;
OUTPUT_UNIT_LIST *output_units;
dTHX;
@@ -1512,9 +1512,7 @@ build_output_units_list (size_t output_units_descriptor)
output_units = retrieve_output_units (output_units_descriptor);
if (!output_units || !output_units->number)
- return newSV(0);
-
- av_output_units = newAV ();
+ return 0;
fill_output_units (av_output_units, output_units);
@@ -1522,8 +1520,26 @@ build_output_units_list (size_t output_units_descriptor)
hv_store (output_units->list[0]->hv, "output_units_descriptor",
strlen ("output_units_descriptor"),
newSViv (output_units_descriptor), 0);
+ return 1;
+}
- return newRV_noinc ((SV *) av_output_units);
+SV *
+build_output_units_list (size_t output_units_descriptor)
+{
+ AV *av_output_units;
+
+ dTHX;
+
+ av_output_units = newAV ();
+
+ if (!fill_output_units_descriptor_av (av_output_units,
+ output_units_descriptor))
+ {
+ av_undef (av_output_units);
+ return newSV(0);
+ }
+ else
+ return newRV_noinc ((SV *) av_output_units);
}
SV *
@@ -1603,14 +1619,13 @@ void
rebuild_output_units_list (SV *output_units_sv, size_t output_units_descriptor)
{
AV *av_output_units;
- OUTPUT_UNIT_LIST *output_units;
dTHX;
- output_units = retrieve_output_units (output_units_descriptor);
-
- if (! SvOK (output_units_sv))
+ if (!SvOK (output_units_sv))
{
+ OUTPUT_UNIT_LIST *output_units
+ = retrieve_output_units (output_units_descriptor);
if (output_units && output_units->number)
fprintf (stderr, "BUG: no input sv for %zu output units (%zu)",
output_units->number, output_units_descriptor);
@@ -1620,16 +1635,10 @@ rebuild_output_units_list (SV *output_units_sv, size_t
output_units_descriptor)
av_output_units = (AV *) SvRV (output_units_sv);
av_clear (av_output_units);
- /* TODO cannot associate output_units_descriptor. A problem? */
- if (!output_units || !output_units->number)
+ if (!fill_output_units_descriptor_av (av_output_units,
+ output_units_descriptor))
+ /* TODO cannot associate output_units_descriptor. A problem? */
return;
-
- fill_output_units (av_output_units, output_units);
-
- /* store in the first perl output unit of the list */
- hv_store (output_units->list[0]->hv, "output_units_descriptor",
- strlen ("output_units_descriptor"),
- newSViv (output_units_descriptor), 0);
}
AV *
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (fill_output_units_descriptor_av, build_output_units_list) (rebuild_output_units_list): add fill_output_units_descriptor_av with code common to build_output_units_list and rebuild_output_units_list.,
Patrice Dumas <=