| 42 |
static const char *estring[] = { |
static const char *estring[] = { |
| 43 |
ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, ERR10, |
ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, ERR10, |
| 44 |
ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20, |
ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, ERR20, |
| 45 |
ERR21, ERR22, ERR23 }; |
ERR21, ERR22, ERR23, ERR24, ERR25 }; |
| 46 |
|
|
| 47 |
static int eint[] = { |
static int eint[] = { |
| 48 |
REG_EESCAPE, /* "\\ at end of pattern" */ |
REG_EESCAPE, /* "\\ at end of pattern" */ |
| 67 |
REG_ESIZE, /* "regular expression too large" */ |
REG_ESIZE, /* "regular expression too large" */ |
| 68 |
REG_ESPACE, /* "failed to get memory" */ |
REG_ESPACE, /* "failed to get memory" */ |
| 69 |
REG_EPAREN, /* "unmatched brackets" */ |
REG_EPAREN, /* "unmatched brackets" */ |
| 70 |
REG_ASSERT /* "internal error: code overflow" */ |
REG_ASSERT, /* "internal error: code overflow" */ |
| 71 |
|
REG_BADPAT, /* "unrecognized character after (?<" */ |
| 72 |
|
REG_BADPAT, /* "lookbehind assertion is not fixed length" */ |
| 73 |
|
REG_BADPAT, /* "malformed number after (?(" */ |
| 74 |
|
REG_BADPAT, /* "conditional group containe more than two branches" */ |
| 75 |
|
REG_BADPAT /* "assertion expected after (?(" */ |
| 76 |
}; |
}; |
| 77 |
|
|
| 78 |
/* Table of texts corresponding to POSIX error codes */ |
/* Table of texts corresponding to POSIX error codes */ |
| 140 |
if (errbuf_size > 0) |
if (errbuf_size > 0) |
| 141 |
{ |
{ |
| 142 |
if (addlength > 0 && errbuf_size >= length + addlength) |
if (addlength > 0 && errbuf_size >= length + addlength) |
| 143 |
sprintf(errbuf, "%s%s%-6d", message, addmessage, preg->re_erroffset); |
sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset); |
| 144 |
else |
else |
| 145 |
{ |
{ |
| 146 |
strncpy(errbuf, message, errbuf_size - 1); |
strncpy(errbuf, message, errbuf_size - 1); |
| 234 |
else switch(rc) |
else switch(rc) |
| 235 |
{ |
{ |
| 236 |
case PCRE_ERROR_NOMATCH: return REG_NOMATCH; |
case PCRE_ERROR_NOMATCH: return REG_NOMATCH; |
|
case PCRE_ERROR_BADREF: return REG_ESUBREG; |
|
| 237 |
case PCRE_ERROR_NULL: return REG_INVARG; |
case PCRE_ERROR_NULL: return REG_INVARG; |
| 238 |
case PCRE_ERROR_BADOPTION: return REG_INVARG; |
case PCRE_ERROR_BADOPTION: return REG_INVARG; |
| 239 |
case PCRE_ERROR_BADMAGIC: return REG_INVARG; |
case PCRE_ERROR_BADMAGIC: return REG_INVARG; |