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

Diff of /code/trunk/pcre32_version.c

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

revision 87 by nigel, Sat Feb 24 21:41:21 2007 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-2006 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 43  auxiliary function that can be used to m Line 43  auxiliary function that can be used to m
43  pattern data block. This might be helpful in applications where the block is  pattern data block. This might be helpful in applications where the block is
44  shared by different users. */  shared by different users. */
45    
46    
47    #ifdef HAVE_CONFIG_H
48    #include "config.h"
49    #endif
50    
51  #include "pcre_internal.h"  #include "pcre_internal.h"
52    
53    
# Line 63  Returns:        the (possibly updated) c Line 68  Returns:        the (possibly updated) c
68                  a negative error number                  a negative error number
69  */  */
70    
71  PCRE_DATA_SCOPE int  #ifdef COMPILE_PCRE8
72    PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
73    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)  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.87  
changed lines
  Added in v.836

  ViewVC Help
Powered by ViewVC 1.1.5