w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

regex_internal.h
Go to the documentation of this file.
1 /* Extended regular expression matching and search library.
2  Copyright (C) 2017 Karl Berry <tex-live@tug.org>
3  Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4  This file is part of the GNU C Library.
5  Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
6 
7  The GNU C Library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  The GNU C Library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with the GNU C Library; if not, write to the Free
19  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  02111-1307 USA. */
21 
22 #ifndef _REGEX_INTERNAL_H
23 #define _REGEX_INTERNAL_H 1
24 
25 #include <assert.h>
26 #include <ctype.h>
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 
31 #if defined(__MINGW32_VERSION) || defined(_MSC_VER)
32 #define strcasecmp stricmp
33 #endif
34 
35 #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
36 # include <langinfo.h>
37 #endif
38 #if defined HAVE_LOCALE_H || defined _LIBC
39 # include <locale.h>
40 #endif
41 #if defined HAVE_WCHAR_H || defined _LIBC
42 # include <wchar.h>
43 #endif /* HAVE_WCHAR_H || _LIBC */
44 #if defined HAVE_WCTYPE_H || defined _LIBC
45 # include <wctype.h>
46 #endif /* HAVE_WCTYPE_H || _LIBC */
47 #if defined HAVE_STDBOOL_H || defined _LIBC
48 # include <stdbool.h>
49 #else
50 typedef enum { false, true } bool;
51 #endif /* HAVE_STDBOOL_H || _LIBC */
52 #if defined HAVE_STDINT_H || defined _LIBC
53 # include <stdint.h>
54 #endif /* HAVE_STDINT_H || _LIBC */
55 #if defined _LIBC
56 # include <bits/libc-lock.h>
57 #else
58 # define __libc_lock_define(CLASS,NAME)
59 # define __libc_lock_init(NAME) do { } while (0)
60 # define __libc_lock_lock(NAME) do { } while (0)
61 # define __libc_lock_unlock(NAME) do { } while (0)
62 #endif
63 
64 /* In case that the system doesn't have isblank(). */
65 #if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
66 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
67 #endif
68 
69 #ifdef _LIBC
70 # ifndef _RE_DEFINE_LOCALE_FUNCTIONS
71 # define _RE_DEFINE_LOCALE_FUNCTIONS 1
72 # include <locale/localeinfo.h>
73 # include <locale/elem-hash.h>
74 # include <locale/coll-lookup.h>
75 # endif
76 #endif
77 
78 /* This is for other GNU distributions with internationalized messages. */
79 #if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
80 # include <libintl.h>
81 # ifdef _LIBC
82 # undef gettext
83 # define gettext(msgid) \
84  INTUSE(__dcgettext) (_libc_intl_domainname, msgid, LC_MESSAGES)
85 # endif
86 #else
87 # define gettext(msgid) (msgid)
88 #endif
89 
90 #ifndef gettext_noop
91 /* This define is so xgettext can find the internationalizable
92  strings. */
93 # define gettext_noop(String) String
94 #endif
95 
96 /* For loser systems without the definition. */
97 #ifndef SIZE_MAX
98 # define SIZE_MAX ((size_t) -1)
99 #endif
100 
101 #if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC
102 # define RE_ENABLE_I18N
103 #endif
104 
105 #if __GNUC__ >= 3
106 # define BE(expr, val) __builtin_expect (expr, val)
107 #else
108 # define BE(expr, val) (expr)
109 # define inline
110 #endif
111 
112 /* Number of single byte character. */
113 #define SBC_MAX 256
114 
115 #define COLL_ELEM_LEN_MAX 8
116 
117 /* The character which represents newline. */
118 #define NEWLINE_CHAR '\n'
119 #define WIDE_NEWLINE_CHAR L'\n'
120 
121 /* Rename to standard API for using out of glibc. */
122 #ifndef _LIBC
123 # define __wctype wctype
124 # define __iswctype iswctype
125 # define __btowc btowc
126 # define __mempcpy mempcpy
127 # define __wcrtomb wcrtomb
128 # define __regfree regfree
129 # define attribute_hidden
130 #endif /* not _LIBC */
131 
132 #ifdef __GNUC__
133 # define __attribute(arg) __attribute__ (arg)
134 #else
135 # define __attribute(arg)
136 #endif
137 
138 extern const char __re_error_msgid[] attribute_hidden;
139 extern const size_t __re_error_msgid_idx[] attribute_hidden;
140 
141 /* An integer used to represent a set of bits. It must be unsigned,
142  and must be at least as wide as unsigned int. */
143 typedef unsigned long int bitset_word_t;
144 /* All bits set in a bitset_word_t. */
145 #define BITSET_WORD_MAX ULONG_MAX
146 /* Number of bits in a bitset_word_t. */
147 #define BITSET_WORD_BITS (sizeof (bitset_word_t) * CHAR_BIT)
148 /* Number of bitset_word_t in a bit_set. */
149 #define BITSET_WORDS (SBC_MAX / BITSET_WORD_BITS)
153 
154 #define bitset_set(set,i) \
155  (set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS)
156 #define bitset_clear(set,i) \
157  (set[i / BITSET_WORD_BITS] &= ~((bitset_word_t) 1 << i % BITSET_WORD_BITS))
158 #define bitset_contain(set,i) \
159  (set[i / BITSET_WORD_BITS] & ((bitset_word_t) 1 << i % BITSET_WORD_BITS))
160 #define bitset_empty(set) memset (set, '\0', sizeof (bitset_t))
161 #define bitset_set_all(set) memset (set, '\xff', sizeof (bitset_t))
162 #define bitset_copy(dest,src) memcpy (dest, src, sizeof (bitset_t))
163 
164 #define PREV_WORD_CONSTRAINT 0x0001
165 #define PREV_NOTWORD_CONSTRAINT 0x0002
166 #define NEXT_WORD_CONSTRAINT 0x0004
167 #define NEXT_NOTWORD_CONSTRAINT 0x0008
168 #define PREV_NEWLINE_CONSTRAINT 0x0010
169 #define NEXT_NEWLINE_CONSTRAINT 0x0020
170 #define PREV_BEGBUF_CONSTRAINT 0x0040
171 #define NEXT_ENDBUF_CONSTRAINT 0x0080
172 #define WORD_DELIM_CONSTRAINT 0x0100
173 #define NOT_WORD_DELIM_CONSTRAINT 0x0200
174 
175 typedef enum
176 {
188 
189 typedef struct
190 {
191  int alloc;
192  int nelem;
193  int *elems;
194 } re_node_set;
195 
196 typedef enum
197 {
198  NON_TYPE = 0,
199 
200  /* Node type, These are used by token, node, tree. */
206 #ifdef RE_ENABLE_I18N
207  COMPLEX_BRACKET = 6,
208  OP_UTF8_PERIOD = 7,
209 #endif /* RE_ENABLE_I18N */
210 
211  /* We define EPSILON_BIT as a macro so that OP_OPEN_SUBEXP is used
212  when the debugger shows values of this enum type. */
213 #define EPSILON_BIT 8
219 
220  /* Tree type, these are used only by tree. */
221  CONCAT = 16,
222  SUBEXP = 17,
223 
224  /* Token type, these are used only by token. */
243  BACK_SLASH
244 
246 
247 #ifdef RE_ENABLE_I18N
248 typedef struct
249 {
250  /* Multibyte characters. */
251  wchar_t *mbchars;
252 
253  /* Collating symbols. */
254 # ifdef _LIBC
255  int32_t *coll_syms;
256 # endif
257 
258  /* Equivalence classes. */
259 # ifdef _LIBC
260  int32_t *equiv_classes;
261 # endif
262 
263  /* Range expressions. */
264 # ifdef _LIBC
265  uint32_t *range_starts;
266  uint32_t *range_ends;
267 # else /* not _LIBC */
268  wchar_t *range_starts;
269  wchar_t *range_ends;
270 # endif /* not _LIBC */
271 
272  /* Character classes. */
273  wctype_t *char_classes;
274 
275  /* If this character set is the non-matching list. */
276  unsigned int non_match : 1;
277 
278  /* # of multibyte characters. */
279  int nmbchars;
280 
281  /* # of collating symbols. */
282  int ncoll_syms;
283 
284  /* # of equivalence classes. */
285  int nequiv_classes;
286 
287  /* # of range expressions. */
288  int nranges;
289 
290  /* # of character classes. */
291  int nchar_classes;
292 } re_charset_t;
293 #endif /* RE_ENABLE_I18N */
294 
295 typedef struct
296 {
297  union
298  {
299  unsigned char c; /* for CHARACTER */
300  re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
301 #ifdef RE_ENABLE_I18N
302  re_charset_t *mbcset; /* for COMPLEX_BRACKET */
303 #endif /* RE_ENABLE_I18N */
304  int idx; /* for BACK_REF */
305  re_context_type ctx_type; /* for ANCHOR */
306  } opr;
307 #if __GNUC__ >= 2
308  re_token_type_t type : 8;
309 #else
311 #endif
312  unsigned int constraint : 10; /* context constraint */
313  unsigned int duplicated : 1;
314  unsigned int opt_subexp : 1;
315 #ifdef RE_ENABLE_I18N
316  unsigned int accept_mb : 1;
317  /* These 2 bits can be moved into the union if needed (e.g. if running out
318  of bits; move opr.c to opr.c.c and move the flags to opr.c.flags). */
319  unsigned int mb_partial : 1;
320 #endif
321  unsigned int word_char : 1;
322 } re_token_t;
323 
324 #define IS_EPSILON_NODE(type) ((type) & EPSILON_BIT)
325 
327 {
328  /* Indicate the raw buffer which is the original string passed as an
329  argument of regexec(), re_search(), etc.. */
330  const unsigned char *raw_mbs;
331  /* Store the multibyte string. In case of "case insensitive mode" like
332  REG_ICASE, upper cases of the string are stored, otherwise MBS points
333  the same address that RAW_MBS points. */
334  unsigned char *mbs;
335 #ifdef RE_ENABLE_I18N
336  /* Store the wide character string which is corresponding to MBS. */
337  wint_t *wcs;
338  int *offsets;
340 #endif
341  /* Index in RAW_MBS. Each character mbs[i] corresponds to
342  raw_mbs[raw_mbs_idx + i]. */
344  /* The length of the valid characters in the buffers. */
346  /* The corresponding number of bytes in raw_mbs array. */
348  /* The length of the buffers MBS and WCS. */
349  int bufs_len;
350  /* The index in MBS, which is updated by re_string_fetch_byte. */
351  int cur_idx;
352  /* length of RAW_MBS array. */
353  int raw_len;
354  /* This is RAW_LEN - RAW_MBS_IDX + VALID_LEN - VALID_RAW_LEN. */
355  int len;
356  /* End of the buffer may be shorter than its length in the cases such
357  as re_match_2, re_search_2. Then, we use STOP for end of the buffer
358  instead of LEN. */
359  int raw_stop;
360  /* This is RAW_STOP - RAW_MBS_IDX adjusted through OFFSETS. */
361  int stop;
362 
363  /* The context of mbs[0]. We store the context independently, since
364  the context of mbs[0] may be different from raw_mbs[0], which is
365  the beginning of the input string. */
366  unsigned int tip_context;
367  /* The translation passed as a part of an argument of re_compile_pattern. */
369  /* Copy of re_dfa_t's word_char. */
371  /* 1 if REG_ICASE. */
372  unsigned char icase;
373  unsigned char is_utf8;
374  unsigned char map_notascii;
375  unsigned char mbs_allocated;
376  unsigned char offsets_needed;
377  unsigned char newline_anchor;
378  unsigned char word_ops_used;
380 };
381 typedef struct re_string_t re_string_t;
382 
383 
384 struct re_dfa_t;
385 typedef struct re_dfa_t re_dfa_t;
386 
387 #ifndef _LIBC
388 # ifdef __i386__
389 # define internal_function __attribute ((regparm (3), stdcall))
390 # else
391 # define internal_function
392 # endif
393 #endif
394 
396  int new_buf_len)
398 #ifdef RE_ENABLE_I18N
399 static void build_wcs_buffer (re_string_t *pstr) internal_function;
400 static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
401 #endif /* RE_ENABLE_I18N */
404 static unsigned int re_string_context_at (const re_string_t *input, int idx,
405  int eflags)
407 #define re_string_peek_byte(pstr, offset) \
408  ((pstr)->mbs[(pstr)->cur_idx + offset])
409 #define re_string_fetch_byte(pstr) \
410  ((pstr)->mbs[(pstr)->cur_idx++])
411 #define re_string_first_byte(pstr, idx) \
412  ((idx) == (pstr)->valid_len || (pstr)->wcs[idx] != WEOF)
413 #define re_string_is_single_byte_char(pstr, idx) \
414  ((pstr)->wcs[idx] != WEOF && ((pstr)->valid_len == (idx) + 1 \
415  || (pstr)->wcs[(idx) + 1] != WEOF))
416 #define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
417 #define re_string_cur_idx(pstr) ((pstr)->cur_idx)
418 #define re_string_get_buffer(pstr) ((pstr)->mbs)
419 #define re_string_length(pstr) ((pstr)->len)
420 #define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
421 #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
422 #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
423 
424 #ifndef alloca /* if alloca is already defined, fine */
425 #ifdef __GNUC__
426 # define alloca(size) __builtin_alloca (size)
427 # define HAVE_ALLOCA 1
428 #elif defined(_MSC_VER)
429 # include <malloc.h>
430 # define alloca _alloca
431 # define HAVE_ALLOCA 1
432 #else
433 # error No alloca()
434 #endif
435 #endif /* not alloca */
436 
437 #ifndef _LIBC
438 # if HAVE_ALLOCA
439 /* The OS usually guarantees only one guard page at the bottom of the stack,
440  and a page size can be as small as 4096 bytes. So we cannot safely
441  allocate anything larger than 4096 bytes. Also care for the possibility
442  of a few compiler-allocated temporary stack slots. */
443 # define __libc_use_alloca(n) ((n) < 4032)
444 # else
445 /* alloca is implemented with malloc, so just use malloc. */
446 # define __libc_use_alloca(n) 0
447 # endif
448 #endif
449 
450 #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
451 #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
452 #define re_free(p) free (p)
453 
455 {
457  struct bin_tree_t *left;
458  struct bin_tree_t *right;
459  struct bin_tree_t *first;
460  struct bin_tree_t *next;
461 
463 
464  /* `node_idx' is the index in dfa->nodes, if `type' == 0.
465  Otherwise `type' indicate the type of this node. */
466  int node_idx;
467 };
468 typedef struct bin_tree_t bin_tree_t;
469 
470 #define BIN_TREE_STORAGE_SIZE \
471  ((1024 - sizeof (void *)) / sizeof (bin_tree_t))
472 
474 {
477 };
479 
480 #define CONTEXT_WORD 1
481 #define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
482 #define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
483 #define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
484 
485 #define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
486 #define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
487 #define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
488 #define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
489 #define IS_ORDINARY_CONTEXT(c) ((c) == 0)
490 
491 #define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
492 #define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
493 #define IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_')
494 #define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
495 
496 #define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
497  ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
498  || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
499  || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
500  || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
501 
502 #define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
503  ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
504  || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
505  || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
506  || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
507 
509 {
510  unsigned int hash;
516  unsigned int context : 4;
517  unsigned int halt : 1;
518  /* If this state can accept `multi byte'.
519  Note that we refer to multibyte characters, and multi character
520  collating elements as `multi byte'. */
521  unsigned int accept_mb : 1;
522  /* If this state has backreference node(s). */
523  unsigned int has_backref : 1;
524  unsigned int has_constraint : 1;
525 };
526 typedef struct re_dfastate_t re_dfastate_t;
527 
529 {
530  int num;
531  int alloc;
533 };
534 
535 /* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
536 
537 typedef struct
538 {
539  int next_idx;
540  int alloc;
542 } state_array_t;
543 
544 /* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
545 
546 typedef struct
547 {
548  int node;
549  int str_idx; /* The position NODE match at. */
552 
553 /* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
554  And information about the node, whose type is OP_CLOSE_SUBEXP,
555  corresponding to NODE is stored in LASTS. */
556 
557 typedef struct
558 {
559  int str_idx;
560  int node;
562  int alasts; /* Allocation size of LASTS. */
563  int nlasts; /* The number of LASTS. */
566 
568 {
569  int node;
570  int str_idx;
573  char more;
574  char unused;
575  unsigned short int eps_reachable_subexps_map;
576 };
577 
578 typedef struct
579 {
580  /* The string object corresponding to the input string. */
582 #if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
583  const re_dfa_t *const dfa;
584 #else
585  const re_dfa_t *dfa;
586 #endif
587  /* EFLAGS of the argument of regexec. */
588  int eflags;
589  /* Where the matching ends. */
592  /* The state log used by the matcher. */
595  /* Back reference cache. */
604 
605 typedef struct
606 {
613 
615 {
616  int idx;
617  int node;
620 };
621 
623 {
624  int num;
625  int alloc;
627 };
628 
629 struct re_dfa_t
630 {
632  size_t nodes_alloc;
633  size_t nodes_len;
634  int *nexts;
648 
649  /* number of subexpressions `re_nsub' is in regex_t. */
650  unsigned int state_hash_mask;
652  int nbackref; /* The number of backreference in this dfa. */
653 
654  /* Bitmap expressing which backreference is used. */
657 
658  unsigned int has_plural_match : 1;
659  /* If this dfa has "multibyte node", which is a backreference or
660  a node which can accept multibyte character or multi character
661  collating element. */
662  unsigned int has_mb_node : 1;
663  unsigned int is_utf8 : 1;
664  unsigned int map_notascii : 1;
665  unsigned int word_ops_used : 1;
670 #ifdef DEBUG
671  char* re_str;
672 #endif
674 };
675 
676 #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
677 #define re_node_set_remove(set,id) \
678  (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
679 #define re_node_set_empty(p) ((p)->nelem = 0)
680 #define re_node_set_free(set) re_free ((set)->elems)
681 ␌
682 
683 typedef enum
684 {
689  CHAR_CLASS
691 
692 typedef struct
693 {
695  union
696  {
697  unsigned char ch;
698  unsigned char *name;
699  wchar_t wch;
700  } opr;
702 
703 
704 /* Inline functions for bitset operation. */
705 static inline void
707 {
708  int bitset_i;
709  for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
710  set[bitset_i] = ~set[bitset_i];
711 }
712 
713 static inline void
715 {
716  int bitset_i;
717  for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
718  dest[bitset_i] |= src[bitset_i];
719 }
720 
721 static inline void
723 {
724  int bitset_i;
725  for (bitset_i = 0; bitset_i < BITSET_WORDS; ++bitset_i)
726  dest[bitset_i] &= src[bitset_i];
727 }
728 
729 #ifdef RE_ENABLE_I18N
730 /* Inline functions for re_string. */
731 static inline int
733 re_string_char_size_at (const re_string_t *pstr, int idx)
734 {
735  int byte_idx;
736  if (pstr->mb_cur_max == 1)
737  return 1;
738  for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
739  if (pstr->wcs[idx + byte_idx] != WEOF)
740  break;
741  return byte_idx;
742 }
743 
744 static inline wint_t
746 re_string_wchar_at (const re_string_t *pstr, int idx)
747 {
748  if (pstr->mb_cur_max == 1)
749  return (wint_t) pstr->mbs[idx];
750  return (wint_t) pstr->wcs[idx];
751 }
752 
753 static int
755 re_string_elem_size_at (const re_string_t *pstr, int idx)
756 {
757 # ifdef _LIBC
758  const unsigned char *p, *extra;
759  const int32_t *table, *indirect;
760  int32_t tmp;
761 # include <locale/weight.h>
762  uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
763 
764  if (nrules != 0)
765  {
766  table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
767  extra = (const unsigned char *)
768  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
769  indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
770  _NL_COLLATE_INDIRECTMB);
771  p = pstr->mbs + idx;
772  tmp = findidx (&p);
773  return p - pstr->mbs - idx;
774  }
775  else
776 # endif /* _LIBC */
777  return 1;
778 }
779 #endif /* RE_ENABLE_I18N */
780 
781 #endif /* _REGEX_INTERNAL_H */
unsigned short wint_t
Definition: CPAL.d:4748
unsigned short wctype_t
Definition: CPAL.d:4749
struct @88 table[500]
#define type(a)
Definition: aptex-macros.h:171
small capitals from c petite p
Definition: afcover.h:72
FT_UInt idx
Definition: cffcmap.c:135
unsigned int uint32_t
Definition: stdint.h:80
uint32_t uint_fast32_t
Definition: stdint.h:110
signed int int32_t
Definition: stdint.h:77
static output_state cur_state
Definition: ctangleboot.c:316
reg_errcode_t
Definition: regex.h:304
unsigned long int reg_syntax_t
Definition: regex.h:44
#define RE_TRANSLATE_TYPE
Definition: regex.h:340
#define dest
bitset_word_t bitset_t[(256/(sizeof(bitset_word_t) *CHAR_BIT))]
#define PREV_WORD_CONSTRAINT
#define NEXT_WORD_CONSTRAINT
static reg_errcode_t re_string_realloc_buffers(re_string_t *pstr, int new_buf_len)
#define PREV_NOTWORD_CONSTRAINT
#define __attribute(arg)
const bitset_word_t * re_const_bitset_ptr_t
#define BIN_TREE_STORAGE_SIZE
#define NEXT_NOTWORD_CONSTRAINT
const size_t __re_error_msgid_idx[]
Definition: regcomp.c:183
re_context_type
@ LINE_LAST
@ BUF_LAST
@ INSIDE_WORD
@ WORD_LAST
@ WORD_FIRST
@ BUF_FIRST
@ NOT_WORD_DELIM
@ LINE_FIRST
@ INSIDE_NOTWORD
@ WORD_DELIM
static void build_upper_buffer(re_string_t *pstr)
#define BITSET_WORDS
static void bitset_not(bitset_t set)
const char __re_error_msgid[]
static unsigned int re_string_context_at(const re_string_t *input, int idx, int eflags)
#define WORD_DELIM_CONSTRAINT
#define NEXT_NEWLINE_CONSTRAINT
#define EPSILON_BIT
#define NOT_WORD_DELIM_CONSTRAINT
#define PREV_BEGBUF_CONSTRAINT
static void bitset_mask(bitset_t dest, const bitset_t src)
static void re_string_translate_buffer(re_string_t *pstr)
#define internal_function
bitset_word_t * re_bitset_ptr_t
static void bitset_merge(bitset_t dest, const bitset_t src)
#define __libc_lock_define(CLASS, NAME)
unsigned long int bitset_word_t
#define PREV_NEWLINE_CONSTRAINT
bool
re_token_type_t
@ OP_OPEN_BRACKET
@ OP_DUP_PLUS
@ OP_CLOSE_DUP_NUM
@ OP_DUP_QUESTION
@ BACK_SLASH
@ NON_TYPE
@ OP_NOTSPACE
@ OP_CLOSE_SUBEXP
@ OP_CHARSET_RANGE
@ SUBEXP
@ OP_CLOSE_CHAR_CLASS
@ OP_OPEN_EQUIV_CLASS
@ SIMPLE_BRACKET
@ CHARACTER
@ OP_WORD
@ OP_CLOSE_COLL_ELEM
@ OP_ALT
@ CONCAT
@ OP_OPEN_COLL_ELEM
@ OP_OPEN_SUBEXP
@ OP_CLOSE_EQUIV_CLASS
@ OP_OPEN_DUP_NUM
@ OP_NON_MATCH_LIST
@ OP_SPACE
@ ANCHOR
@ OP_DUP_ASTERISK
@ OP_CLOSE_BRACKET
@ OP_NOTWORD
@ OP_OPEN_CHAR_CLASS
@ OP_BACK_REF
@ END_OF_RE
@ OP_PERIOD
bracket_elem_type
@ COLL_SYM
@ MB_CHAR
@ CHAR_CLASS
@ SB_CHAR
@ EQUIV_CLASS
#define attribute_hidden
#define NEXT_ENDBUF_CONSTRAINT
static UMutex lock
Definition: serv.cpp:336
bin_tree_t data[((1024 - sizeof(void *))/sizeof(bin_tree_t))]
struct bin_tree_storage_t * next
re_token_t token
struct bin_tree_t * left
struct bin_tree_t * parent
struct bin_tree_t * right
struct bin_tree_t * first
struct bin_tree_t * next
unsigned char ch
unsigned char * name
bracket_elem_type type
Definition: execute.c:108
int node
int subexp_to
char unused
unsigned short int eps_reachable_subexps_map
int str_idx
int subexp_from
char more
size_t nodes_alloc
bitset_word_t used_bkref_map
unsigned int state_hash_mask
int * org_indices
size_t nodes_len
reg_syntax_t syntax
int * subexp_map
bitset_word_t completed_bkref_map
re_node_set * edests
re_node_set * inveclosures
re_bitset_ptr_t sb_char
re_dfastate_t * init_state_nl
re_dfastate_t * init_state_begbuf
bin_tree_t * str_tree
re_dfastate_t * init_state_word
struct re_state_table_entry * state_table
re_token_t * nodes
bin_tree_storage_t * str_tree_storage
unsigned int map_notascii
re_node_set * eclosures
re_dfastate_t * init_state
unsigned int is_utf8
int str_tree_storage_idx
unsigned int has_plural_match
unsigned int has_mb_node
bitset_t word_char
unsigned int word_ops_used
re_node_set * entrance_nodes
re_node_set nodes
struct re_dfastate_t ** trtable
unsigned int has_constraint
unsigned int context
unsigned int accept_mb
re_node_set inveclosure
unsigned int hash
struct re_dfastate_t ** word_trtable
unsigned int has_backref
re_node_set non_eps_nodes
unsigned int halt
re_node_set eps_via_nodes
struct re_fail_stack_ent_t * stack
re_sub_match_top_t ** sub_tops
struct re_backref_cache_entry * bkref_ents
const re_dfa_t * dfa
re_dfastate_t ** state_log
re_dfastate_t ** limited_states
re_node_set limits
re_dfastate_t ** sifted_states
re_dfastate_t ** array
int num
int alloc
re_const_bitset_ptr_t word_char
unsigned char map_notascii
unsigned char word_ops_used
RE_TRANSLATE_TYPE trans
const unsigned char * raw_mbs
unsigned char newline_anchor
unsigned char is_utf8
unsigned char offsets_needed
unsigned char * mbs
unsigned char icase
unsigned char mbs_allocated
unsigned int tip_context
state_array_t path
state_array_t * path
re_sub_match_last_t ** lasts
unsigned char c
re_bitset_ptr_t sbcset
unsigned int word_char
unsigned int constraint
unsigned int duplicated
re_context_type ctx_type
re_token_type_t type
unsigned int opt_subexp
re_dfastate_t ** array
Definition: table.h:30
static int nrules
Definition: zic.c:288