[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/main/base_utils.c (isascii_space)
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/main/base_utils.c (isascii_space): add. |
Date: |
Sun, 17 Nov 2024 09:47: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 4e68943b6a * tp/Texinfo/XS/main/base_utils.c (isascii_space): add.
4e68943b6a is described below
commit 4e68943b6a324f123cf40e3ccf5190d896bc698d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 17 15:47:13 2024 +0100
* tp/Texinfo/XS/main/base_utils.c (isascii_space): add.
* tp/Texinfo/XS/Makefile.am (libparagraph_la_SOURCES),
tp/Texinfo/XS/xspara.c (xspara__print_escaped_spaces)
(xspara_add_text): use isascii_space.
* tp/Texinfo/XS/Makefile.am (libparagraph_la_CPPFLAGS),
tp/Texinfo/XS/xspara.c: do not include main/text.h, include text.h and
add -I.
---
ChangeLog | 12 ++++++++++++
tp/Texinfo/XS/Makefile.am | 3 ++-
tp/Texinfo/XS/main/base_utils.c | 6 ++++++
tp/Texinfo/XS/main/base_utils.h | 1 +
tp/Texinfo/XS/xspara.c | 7 ++++---
5 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6d28b0ea55..c9c5449e97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-11-17 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/base_utils.c (isascii_space): add.
+
+ * tp/Texinfo/XS/Makefile.am (libparagraph_la_SOURCES),
+ tp/Texinfo/XS/xspara.c (xspara__print_escaped_spaces)
+ (xspara_add_text): use isascii_space.
+
+ * tp/Texinfo/XS/Makefile.am (libparagraph_la_CPPFLAGS),
+ tp/Texinfo/XS/xspara.c: do not include main/text.h, include text.h and
+ add -I.
+
2024-11-17 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/Makefile.am (C_libtexinfo_sources),
diff --git a/tp/Texinfo/XS/Makefile.am b/tp/Texinfo/XS/Makefile.am
index cb6fa79c4b..fa05bd1dbb 100644
--- a/tp/Texinfo/XS/Makefile.am
+++ b/tp/Texinfo/XS/Makefile.am
@@ -96,8 +96,9 @@ MiscXS_la_LDFLAGS = $(XSLIBS_LDFLAGS)
# flags than the Perl part, requiring Gnulib but not Perl.
noinst_LTLIBRARIES += libparagraph.la
libparagraph_la_SOURCES = xspara.c xspara.h \
+ main/base_utils.c main/base_utils.h \
main/text.c main/text.h
-libparagraph_la_CPPFLAGS = $(AM_CPPFLAGS) $(GNULIB_CPPFLAGS)
+libparagraph_la_CPPFLAGS = -I$(srcdir)/main $(AM_CPPFLAGS) $(GNULIB_CPPFLAGS)
libparagraph_la_LIBADD = $(builddir)/gnulib/lib/libgnu.la
libparagraph_la_LDFLAGS = $(LTLIBINTL) $(LTLIBICONV) $(LTLIBUNISTRING)
$(LTLIBC32CONV)
diff --git a/tp/Texinfo/XS/main/base_utils.c b/tp/Texinfo/XS/main/base_utils.c
index bdb9bad8cd..d72885e7a0 100644
--- a/tp/Texinfo/XS/main/base_utils.c
+++ b/tp/Texinfo/XS/main/base_utils.c
@@ -64,6 +64,12 @@ isascii_lower (unsigned char c)
return (((c & ~0x7f) == 0) && islower (c));
}
+int
+isascii_space (unsigned char c)
+{
+ return (((c & ~0x7f) == 0) && isspace (c));
+}
+
int
isascii_upper (unsigned char c)
{
diff --git a/tp/Texinfo/XS/main/base_utils.h b/tp/Texinfo/XS/main/base_utils.h
index 0e5e9542ff..4115e089a6 100644
--- a/tp/Texinfo/XS/main/base_utils.h
+++ b/tp/Texinfo/XS/main/base_utils.h
@@ -24,6 +24,7 @@ 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_space (unsigned char c);
int isascii_upper (unsigned char c);
#endif
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index 971260846d..a4c1013b26 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -28,7 +28,8 @@
#include <unistr.h>
#include <uchar.h>
-#include "main/text.h"
+#include "text.h"
+#include "base_utils.h"
#include "xspara.h"
static int debug = 0;
@@ -122,7 +123,7 @@ xspara__print_escaped_spaces (char *string, size_t len)
text_append_n (&t, "\\n", 2);
else if (*p == '\f')
text_append_n (&t, "\\f", 2);
- else if (isspace ((unsigned char) *p))
+ else if (isascii_space (*p))
{
char protected_string[7];
sprintf (protected_string, "\\x%04x", *p);
@@ -637,7 +638,7 @@ xspara_add_text (char *text, int len)
{
next_type = type_finished;
}
- else if (isspace ((unsigned char) *q))
+ else if (isascii_space (*q))
{
next_type = type_spaces;
next_len = 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/main/base_utils.c (isascii_space): add.,
Patrice Dumas <=