diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-06-21 21:42:12 +0200 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-06-21 22:05:37 +0200 |
| commit | 13f5fd77bbc528862f295f9e7196f3ff709d185a (patch) | |
| tree | 9f9ce051bc8adf61e5ae2b4e94ccb1331bfdbfa5 /regcustom.h | |
| parent | 10b47c9226b6267e5a4be4e79fe79314bf969025 (diff) | |
| download | terex-13f5fd77bbc528862f295f9e7196f3ff709d185a.tar.gz | |
Unicode builds now expect UTF-8 strings
* They are built with `-DREGEX_UTF8` instead of `-DREGEX_WCHAR`.
Functions are called reg_ucomp() and reg_uexec() instead for consistency.
The library is now called libhsurex.so instead of libhswrex.so.
* The `chr` type is now always `unsigned char`.
As a result many other uses of the `chr` type had to be changed to pchr
(which is always large enough to hold a byte or wide character).
Generally we try to keep code changes as small as possible since
we may have to backport changes from the Tcl codebase or contribute
patches to the Tcl project.
Diffstat (limited to 'regcustom.h')
| -rw-r--r-- | regcustom.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/regcustom.h b/regcustom.h index c341c23..1b25fed 100644 --- a/regcustom.h +++ b/regcustom.h @@ -99,9 +99,9 @@ #ifndef REGEX_STANDALONE typedef Tcl_UniChar chr; /* The type itself. */ #endif -typedef int pchr; /* What it promotes to. */ +typedef uint32_t pchr; /* What it promotes to (holds 8-bit or Unicode char). */ typedef unsigned uchr; /* Unsigned type that will hold a chr. */ -typedef int celt; /* Type to hold chr, or NOCELT */ +typedef int32_t celt; /* Type to hold chr, or NOCELT */ #define NOCELT (-1) /* Celt value which is not valid chr */ #define CHR(c) (UCHAR(c)) /* Turn char literal into chr literal */ #define DIGITVAL(c) ((c)-'0') /* Turn chr digit into its value */ @@ -109,7 +109,7 @@ typedef int celt; /* Type to hold chr, or NOCELT */ #define CHRBITS 32 /* Bits in a chr; must not use sizeof */ #define CHR_MIN 0x00000000 /* Smallest and largest chr; the value */ #define CHR_MAX 0xffffffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#elif defined(REGEX_STANDALONE) && ! defined(REGEX_WCHAR) +#elif defined(REGEX_STANDALONE) && ! defined(REGEX_UTF8) # define CHRBITS 8 # define CHR_MIN 0x00 # define CHR_MAX 0xff @@ -133,9 +133,9 @@ typedef int celt; /* Type to hold chr, or NOCELT */ */ #ifdef REGEX_STANDALONE -# ifdef REGEX_WCHAR -# define compile re_wcomp -# define exec re_wexec +# ifdef REGEX_UTF8 +# define compile re_ucomp +# define exec re_uexec # define __REG_NOCHAR # else # define compile re_comp |
