aboutsummaryrefslogtreecommitdiff
path: root/regex.h
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-26 23:14:44 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-26 23:14:44 +0200
commiteb1fcdf5d1058f4fbdf3a2661573dd7e4d3976f3 (patch)
treecdb7caf92fd29cb3d2ab3d28f2cd5c9604c0d1c4 /regex.h
parent16cf84d794bfe9fdb245d38760256286384d8380 (diff)
downloadterex-eb1fcdf5d1058f4fbdf3a2661573dd7e4d3976f3.tar.gz
allow raw (ASCII) matching via REG_RAW flag, so we no longer need a compile-time flag
You no longer need to build two libraries just for supporting raw/ASCII and UTF-8 patterns. This makes using the library a lot easier and reduces the total binary size. Since strings are always `unsigned char *` now internally and the raw vs. UTF-8 decision is important only in a few select places, it would make no sense to use meta-programming techniques. The test suite has been extended and is now fixed for cases with embedded non-printable characters.
Diffstat (limited to 'regex.h')
-rw-r--r--regex.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/regex.h b/regex.h
index 1e32b18..c15d005 100644
--- a/regex.h
+++ b/regex.h
@@ -119,16 +119,9 @@ extern "C" {
# undef regerror
# define regfree re_free
# define regerror re_error
-// FIXME
# undef __REG_WIDE_T
# define __REG_WIDE_T unsigned char
-# undef __REG_WIDE_COMPILE
-# define __REG_WIDE_COMPILE re_ucomp
-# undef __REG_WIDE_EXEC
-# define __REG_WIDE_EXEC re_uexec
-# ifndef REGEX_UTF8
-# undef __REG_NOCHAR
-# endif
+# undef __REG_NOCHAR
#endif
/*
@@ -237,6 +230,7 @@ typedef struct {
#define REG_DUMP 004000 /* none of your business :-) */
#define REG_FAKE 010000 /* none of your business :-) */
#define REG_PROGRESS 020000 /* none of your business :-) */
+#define REG_RAW 040000 /* pattern and subject are raw ASCII (also an execution flag) */
/*
* execution