/[pcre]/code/tags/pcre-7.7/pcredemo.c
ViewVC logotype

Diff of /code/tags/pcre-7.7/pcredemo.c

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

revision 75 by nigel, Sat Feb 24 21:40:37 2007 UTC revision 199 by ph10, Tue Jul 31 14:39:09 2007 UTC
# Line 11  Compile thuswise: Line 11  Compile thuswise:
11      -R/usr/local/lib -lpcre      -R/usr/local/lib -lpcre
12    
13  Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and  Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and
14  library files for PCRE are installed on your system. Only some operating  library files for PCRE are installed on your system. You don't need -I and -L
15    if PCRE is installed in the standard system libraries. Only some operating
16  systems (e.g. Solaris) use the -R option.  systems (e.g. Solaris) use the -R option.
17  */  */
18    
# Line 117  if (rc < 0) Line 118  if (rc < 0)
118      */      */
119      default: printf("Matching error %d\n", rc); break;      default: printf("Matching error %d\n", rc); break;
120      }      }
121    free(re);     /* Release memory used for the compiled pattern */    pcre_free(re);     /* Release memory used for the compiled pattern */
122    return 1;    return 1;
123    }    }
124    
# Line 223  if (namecount <= 0) printf("No named sub Line 224  if (namecount <= 0) printf("No named sub
224    
225  if (!find_all)  if (!find_all)
226    {    {
227    free(re);   /* Release the memory used for the compiled pattern */    pcre_free(re);   /* Release the memory used for the compiled pattern */
228    return 0;   /* Finish unless -g was given */    return 0;        /* Finish unless -g was given */
229    }    }
230    
231  /* Loop for second and subsequent matches */  /* Loop for second and subsequent matches */
# Line 276  for (;;) Line 277  for (;;)
277    if (rc < 0)    if (rc < 0)
278      {      {
279      printf("Matching error %d\n", rc);      printf("Matching error %d\n", rc);
280      free(re);    /* Release memory used for the compiled pattern */      pcre_free(re);    /* Release memory used for the compiled pattern */
281      return 1;      return 1;
282      }      }
283    
# Line 317  for (;;) Line 318  for (;;)
318    }      /* End of loop to find second and subsequent matches */    }      /* End of loop to find second and subsequent matches */
319    
320  printf("\n");  printf("\n");
321  free(re);       /* Release memory used for the compiled pattern */  pcre_free(re);       /* Release memory used for the compiled pattern */
322  return 0;  return 0;
323  }  }
324    

Legend:
Removed from v.75  
changed lines
  Added in v.199

  ViewVC Help
Powered by ViewVC 1.1.5