version 1.1, 2012/02/21 23:05:51
|
version 1.1.1.2, 2012/02/21 23:50:25
|
Line 6
|
Line 6
|
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
|
|
Written by Philip Hazel |
Written by Philip Hazel |
Copyright (c) 1997-2010 University of Cambridge | Copyright (c) 1997-2012 University of Cambridge |
|
|
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 157 static const int eint[] = {
|
Line 157 static const int eint[] = {
|
REG_BADPAT, /* internal error: unknown opcode in find_fixedlength() */ |
REG_BADPAT, /* internal error: unknown opcode in find_fixedlength() */ |
REG_BADPAT, /* \N is not supported in a class */ |
REG_BADPAT, /* \N is not supported in a class */ |
REG_BADPAT, /* too many forward references */ |
REG_BADPAT, /* too many forward references */ |
|
REG_BADPAT, /* disallowed UTF-8/16 code point (>= 0xd800 && <= 0xdfff) */ |
|
REG_BADPAT /* invalid UTF-16 string (should not occur) */ |
}; |
}; |
|
|
/* Table of texts corresponding to POSIX error codes */ |
/* Table of texts corresponding to POSIX error codes */ |
Line 227 return length + addlength;
|
Line 229 return length + addlength;
|
PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION |
PCREPOSIX_EXP_DEFN void PCRE_CALL_CONVENTION |
regfree(regex_t *preg) |
regfree(regex_t *preg) |
{ |
{ |
(pcre_free)(preg->re_pcre); | (PUBL(free))(preg->re_pcre); |
} |
} |
|
|
|
|
Line 272 should not happen, but we all make mistakes), return R
|
Line 274 should not happen, but we all make mistakes), return R
|
|
|
if (preg->re_pcre == NULL) |
if (preg->re_pcre == NULL) |
{ |
{ |
return (errorcode < sizeof(eint)/sizeof(const int))? | return (errorcode < (int)(sizeof(eint)/sizeof(const int)))? |
eint[errorcode] : REG_BADPAT; |
eint[errorcode] : REG_BADPAT; |
} |
} |
|
|
preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); | (void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, |
| &(preg->re_nsub)); |
return 0; |
return 0; |
} |
} |
|
|
Line 402 switch(rc)
|
Line 405 switch(rc)
|
case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE; |
case PCRE_ERROR_MATCHLIMIT: return REG_ESPACE; |
case PCRE_ERROR_BADUTF8: return REG_INVARG; |
case PCRE_ERROR_BADUTF8: return REG_INVARG; |
case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG; |
case PCRE_ERROR_BADUTF8_OFFSET: return REG_INVARG; |
|
case PCRE_ERROR_BADMODE: return REG_INVARG; |
default: return REG_ASSERT; |
default: return REG_ASSERT; |
} |
} |
} |
} |