[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/MiscXS.xs (xs_unicode_text), tp/T
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/MiscXS.xs (xs_unicode_text), tp/Texinfo/XS/misc.c (xs_unicode_substitute_text): handle in_code in MiscXS.xs, remove in_code argument from xs_unicode_text in misc.c. Rename xs_unicode_text in misc.c to xs_unicode_substitute_text to make clear that it is not exactly the same as the Perl function, as it does the substitution but does not handle in_code. |
Date: |
Tue, 03 Dec 2024 16:15:56 -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 38cc6b28d1 * tp/Texinfo/XS/MiscXS.xs (xs_unicode_text),
tp/Texinfo/XS/misc.c (xs_unicode_substitute_text): handle in_code in MiscXS.xs,
remove in_code argument from xs_unicode_text in misc.c. Rename xs_unicode_text
in misc.c to xs_unicode_substitute_text to make clear that it is not exactly
the same as the Perl function, as it does the substitution but does not handle
in_code.
38cc6b28d1 is described below
commit 38cc6b28d165d99686dec710429e51302da5e593
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 3 22:15:50 2024 +0100
* tp/Texinfo/XS/MiscXS.xs (xs_unicode_text), tp/Texinfo/XS/misc.c
(xs_unicode_substitute_text): handle in_code in MiscXS.xs, remove
in_code argument from xs_unicode_text in misc.c. Rename
xs_unicode_text in misc.c to xs_unicode_substitute_text to make clear
that it is not exactly the same as the Perl function, as it does the
substitution but does not handle in_code.
* tp/Texinfo/XS/misc.c: remove unused whitespace_chars.
---
ChangeLog | 11 +++++++++++
tp/Texinfo/XS/MiscXS.xs | 5 ++++-
tp/Texinfo/XS/misc.c | 9 ++-------
tp/Texinfo/XS/miscxs.h | 2 +-
4 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8e391a64c9..db1844b309 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-12-03 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/MiscXS.xs (xs_unicode_text), tp/Texinfo/XS/misc.c
+ (xs_unicode_substitute_text): handle in_code in MiscXS.xs, remove
+ in_code argument from xs_unicode_text in misc.c. Rename
+ xs_unicode_text in misc.c to xs_unicode_substitute_text to make clear
+ that it is not exactly the same as the Perl function, as it does the
+ substitution but does not handle in_code.
+
+ * tp/Texinfo/XS/misc.c: remove unused whitespace_chars.
+
2024-12-03 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/misc.c: add const.
diff --git a/tp/Texinfo/XS/MiscXS.xs b/tp/Texinfo/XS/MiscXS.xs
index 43a05c1882..ce123a73a2 100644
--- a/tp/Texinfo/XS/MiscXS.xs
+++ b/tp/Texinfo/XS/MiscXS.xs
@@ -51,7 +51,10 @@ xs_unicode_text (text, ...)
if (SvOK(ST(1)))
in_code = (int) SvIV(ST(1));
}
- retval = xs_unicode_text (text, in_code);
+ if (in_code)
+ retval = text;
+ else
+ retval = xs_unicode_substitute_text (text);
RETVAL = newSVpv (retval, 0);
SvUTF8_on (RETVAL);
diff --git a/tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c
index 24f334fecb..8acf1ff43c 100644
--- a/tp/Texinfo/XS/misc.c
+++ b/tp/Texinfo/XS/misc.c
@@ -21,8 +21,6 @@
#include "base_utils.h"
#include "miscxs.h"
-const char *whitespace_chars = " \t\f\v\r\n";
-
char *
xs_process_text (const char *text)
{
@@ -78,15 +76,12 @@ xs_process_text (const char *text)
}
char *
-xs_unicode_text (char *text, int in_code)
+xs_unicode_substitute_text (const char *text)
{
const char *p, *q;
static char *new;
int new_space, new_len;
- if (in_code)
- return text;
-
p = text;
new_space = strlen (text);
new = realloc (new, new_space + 1);
@@ -290,7 +285,7 @@ void xs_parse_command_name (const char *text,
return;
}
-/* Return list ($at_command, $open_brace, ....) */
+/* determining the nature of leading text for parsing of Texinfo code */
void xs_parse_texi_regex (const char *text,
char **arobase,
char **open_brace,
diff --git a/tp/Texinfo/XS/miscxs.h b/tp/Texinfo/XS/miscxs.h
index 1d5b2b2460..fa92837493 100644
--- a/tp/Texinfo/XS/miscxs.h
+++ b/tp/Texinfo/XS/miscxs.h
@@ -1,4 +1,4 @@
-char *xs_unicode_text (char *, int);
+char *xs_unicode_substitute_text (const char *);
char *xs_entity_text (const char *);
char *xs_process_text (const char *text);
void xs_parse_command_name (const char *text,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/MiscXS.xs (xs_unicode_text), tp/Texinfo/XS/misc.c (xs_unicode_substitute_text): handle in_code in MiscXS.xs, remove in_code argument from xs_unicode_text in misc.c. Rename xs_unicode_text in misc.c to xs_unicode_substitute_text to make clear that it is not exactly the same as the Perl function, as it does the substitution but does not handle in_code.,
Patrice Dumas <=