about summary refs log tree commit diff
path: root/posix/regex_internal.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-13 04:00:16 +0000
committerRoland McGrath <roland@gnu.org>2002-11-13 04:00:16 +0000
commit1843975c42e23cbd686efef3dae6856b53842798 (patch)
tree3a67d4e546db406200be8b6dcffc8928a5d021f7 /posix/regex_internal.h
parent43317e8e787ba945c0dfe4097b1924375584e2fb (diff)
downloadglibc-1843975c42e23cbd686efef3dae6856b53842798.tar.gz
glibc-1843975c42e23cbd686efef3dae6856b53842798.tar.xz
glibc-1843975c42e23cbd686efef3dae6856b53842798.zip
* posix/regex_internal.c (re_string_skip_chars): Also return the last
	wide character.
	(re_string_reconstruct): Calculate the context by itself when the
	offset points out of the valid range.
	(re_string_context_at): Use wide character when MB_CUR_MAX > 1.
	* posix/regex_internal.h (WIDE_NEWLINE_CHAR): New macro.
	(IS_WIDE_WORD_CHAR): New macro.
	(IS_WIDE_NEWLINE): New macro.
Diffstat (limited to 'posix/regex_internal.h')
-rw-r--r--posix/regex_internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 7d5fffac4d..a49f4d9f2f 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -30,6 +30,7 @@
 
 /* The character which represents newline.  */
 #define NEWLINE_CHAR '\n'
+#define WIDE_NEWLINE_CHAR L'\n'
 
 /* Rename to standard API for using out of glibc.  */
 #ifndef _LIBC
@@ -349,6 +350,8 @@ typedef struct bin_tree_t bin_tree_t;
 
 #define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
 #define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
+#define IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_')
+#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
 
 #define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
  ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \