 */
# define RE_DUP_MAX (0x7fff)
#endif


/* POSIX 'cflags' bits (i.e., information for 'regcomp').  */

/* If this bit is set, then use extended regular expression syntax.
   If not set, then use basic regular expression syntax.  */
#define REG_EXTENDED 1

/* If this bit is set, then ignore case when matching.
   If not set, then case is significant.  */
#define REG_ICASE (1 << 1)

/* If this bit is set, then anchors do not match at newline
     characters in the string.
   If not set, then anchors do match at newlines.  */
#define REG_NEWLINE (1 << 2)

/* If this bit is set, then report only success or fail in regexec.
   If not set, then returns differ between not matching and errors.  */
#define REG_NOSUB (1 << 3)


/* POSIX 'eflags' bits (i.e., information for regexec).  */

/* If this bit is set, then the beginning-of-line operator doesn't match
     the beginning of the string (presumably because it's not the
     beginning of a line).
   If not set, then the beginning-of-line operator does match the
     beginning of the string.  */
#define REG_NOTBOL 1

/* Like REG_NOTBOL, except for the end-of-line.  */
#define REG_NOTEOL (1 << 1)

/* Use PMATCH[0] to delimit the start and end of the search in the
   buffer.  */
#define REG_STARTEND (1 << 2)


/* If any error codes are removed, changed, or added, update the
   '__re_error_msgid' table in regcomp.c.  */

typedef enum
{
  _REG_ENOSYS = -1,	/* This will never happen for this implementation.  */
  _REG_NOERROR = 0,	/* Success.  */
  _REG_NOMATCH,		/* Didn't find a match (for regexec).  */

  /* POSIX regcomp return error codes.  (In the order listed in the
     standard.)  */
  _REG_BADPAT,		/* Invalid pattern.  */
  _REG_ECOLLATE,	/* Invalid collating element.  */
  _REG_ECTYPE,		/* Invalid character class name.  */
  _REG_EESCAPE,		/* Trailing backslash.  */
  _REG_ESUBREG,		/* Invalid back reference.  */
  _REG_EBRACK,		/* Unmatched left bracket.  */
  _REG_EPAREN,		/* Parenthesis imbalance.  */
  _REG_EBRACE,		/* Unmatched \{.  */
  _REG_BADBR,		/* Invalid contents of \{\}.  */
  _REG_ERANGE,		/* Invalid range end.  */
  _REG_ESPACE,		/* Ran out of memory.  */
  _REG_BADRPT,		/* No preceding re for repetition op.  */

  /* Error codes we've added.  */
  _REG_EEND,		/* Premature end.  */
  _REG_ESIZE,		/* Too large (e.g., repeat count too large).  */
  _REG_ERPAREN		/* Unmatched ) or \); not returned from regcomp.  */
} reg_errcode_t;

#if defined _XOPEN_SOURCE || defined __USE_XOPEN2K
# define REG_ENOSYS	_REG_ENOSYS
#endif
#define REG_NOERROR	_REG_NOERROR
#define REG_NOMATCH	_REG_NOMATCH
#define REG_BADPAT	_REG_BADPAT
#define REG_ECOLLATE	_REG_ECOLLATE
#define REG_ECTYPE	_REG_ECTYPE
#define REG_EESCAPE	_REG_EESCAPE
#define REG_ESUBREG	_REG_ESUBREG
#define REG_EBRACK	_REG_EBRACK
#define REG_EPAREN	_REG_EPAREN
#define REG_EBRACE	_REG_EBRACE
#define REG_BADBR	_REG_BADBR
#define REG_ERANGE	_REG_ERANGE
#define REG_ESPACE	_REG_ESPACE
#define REG_BADRPT	_REG_BADRPT
#define REG_EEND	_REG_EEND
#define REG_ESIZE	_REG_ESIZE
#define REG_ERPAREN	_REG_ERPAREN
