|
version 1.1.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-2008 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 68 Returns: the (possibly updated) count value (a
|
Line 68 Returns: the (possibly updated) count value (a
|
| a negative error number |
a negative error number |
| */ |
*/ |
| |
|
| |
#ifdef COMPILE_PCRE8 |
| PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| pcre_refcount(pcre *argument_re, int adjust) |
pcre_refcount(pcre *argument_re, int adjust) |
| |
#else |
| |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| |
pcre16_refcount(pcre16 *argument_re, int adjust) |
| |
#endif |
| { |
{ |
| real_pcre *re = (real_pcre *)argument_re; | REAL_PCRE *re = (REAL_PCRE *)argument_re; |
| if (re == NULL) return PCRE_ERROR_NULL; |
if (re == NULL) return PCRE_ERROR_NULL; |
| |
if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC; |
| |
if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; |
| re->ref_count = (-adjust > re->ref_count)? 0 : |
re->ref_count = (-adjust > re->ref_count)? 0 : |
| (adjust + re->ref_count > 65535)? 65535 : |
(adjust + re->ref_count > 65535)? 65535 : |
| re->ref_count + adjust; |
re->ref_count + adjust; |