/[pcre]/code/trunk/pcre_refcount.c
ViewVC logotype

Diff of /code/trunk/pcre_refcount.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 835 by ph10, Wed Jul 9 16:20:19 2008 UTC revision 836 by ph10, Wed Dec 28 17:16:11 2011 UTC
# Line 6  Line 6 
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.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2008 University of Cambridge             Copyright (c) 1997-2012 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  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) c Line 68  Returns:        the (possibly updated) c
68                  a negative error number                  a negative error number
69  */  */
70    
71    #ifdef COMPILE_PCRE8
72  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION  PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
73  pcre_refcount(pcre *argument_re, int adjust)  pcre_refcount(pcre *argument_re, int adjust)
74    #else
75    PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
76    pcre_refcount(pcre *argument_re, int adjust)
77    #endif
78  {  {
79  real_pcre *re = (real_pcre *)argument_re;  real_pcre *re = (real_pcre *)argument_re;
80  if (re == NULL) return PCRE_ERROR_NULL;  if (re == NULL) return PCRE_ERROR_NULL;
81    if (re->magic_number != MAGIC_NUMBER) return PCRE_ERROR_BADMAGIC;
82    if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;
83  re->ref_count = (-adjust > re->ref_count)? 0 :  re->ref_count = (-adjust > re->ref_count)? 0 :
84                  (adjust + re->ref_count > 65535)? 65535 :                  (adjust + re->ref_count > 65535)? 65535 :
85                  re->ref_count + adjust;                  re->ref_count + adjust;

Legend:
Removed from v.835  
changed lines
  Added in v.836

  ViewVC Help
Powered by ViewVC 1.1.5