/[pcre]/code/branches/pcre16/pcre_get.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_get.c

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

revision 803 by zherczeg, Sat Dec 10 02:20:06 2011 UTC revision 804 by zherczeg, Wed Dec 14 11:18:01 2011 UTC
# Line 376  pcre_uchar *p; Line 376  pcre_uchar *p;
376  for (i = 0; i < double_count; i += 2)  for (i = 0; i < double_count; i += 2)
377    size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1);    size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1);
378    
379  stringlist = (pcre_uchar **)(pcre_malloc)(size);  stringlist = (pcre_uchar **)(PUBL(malloc))(size);
380  if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;  if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
381    
382  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
# Line 406  return 0; Line 406  return 0;
406  *************************************************/  *************************************************/
407    
408  /* This function exists for the benefit of people calling PCRE from non-C  /* This function exists for the benefit of people calling PCRE from non-C
409  programs that can call its functions, but not free() or (pcre_free)() directly.  programs that can call its functions, but not free() or (PUBL(free))()
410    directly.
411    
412  Argument:   the result of a previous pcre_get_substring_list()  Argument:   the result of a previous pcre_get_substring_list()
413  Returns:    nothing  Returns:    nothing
# Line 420  PCRE_EXP_DEFN void PCRE_CALL_CONVENTION Line 421  PCRE_EXP_DEFN void PCRE_CALL_CONVENTION
421  pcre16_free_substring_list(PCRE_SPTR16 *pointer)  pcre16_free_substring_list(PCRE_SPTR16 *pointer)
422  #endif  #endif
423  {  {
424  (pcre_free)((void *)pointer);  (PUBL(free))((void *)pointer);
425  }  }
426    
427    
# Line 466  if (stringnumber < 0 || stringnumber >= Line 467  if (stringnumber < 0 || stringnumber >=
467    return PCRE_ERROR_NOSUBSTRING;    return PCRE_ERROR_NOSUBSTRING;
468  stringnumber *= 2;  stringnumber *= 2;
469  yield = ovector[stringnumber+1] - ovector[stringnumber];  yield = ovector[stringnumber+1] - ovector[stringnumber];
470  substring = (pcre_uchar *)(pcre_malloc)(IN_UCHARS(yield + 1));  substring = (pcre_uchar *)(PUBL(malloc))(IN_UCHARS(yield + 1));
471  if (substring == NULL) return PCRE_ERROR_NOMEMORY;  if (substring == NULL) return PCRE_ERROR_NOMEMORY;
472  memcpy(substring, subject + ovector[stringnumber], IN_UCHARS(yield));  memcpy(substring, subject + ovector[stringnumber], IN_UCHARS(yield));
473  substring[yield] = 0;  substring[yield] = 0;
# Line 534  return pcre16_get_substring(subject, ove Line 535  return pcre16_get_substring(subject, ove
535  *************************************************/  *************************************************/
536    
537  /* This function exists for the benefit of people calling PCRE from non-C  /* This function exists for the benefit of people calling PCRE from non-C
538  programs that can call its functions, but not free() or (pcre_free)() directly.  programs that can call its functions, but not free() or (PUBL(free))()
539    directly.
540    
541  Argument:   the result of a previous pcre_get_substring()  Argument:   the result of a previous pcre_get_substring()
542  Returns:    nothing  Returns:    nothing
# Line 548  PCRE_EXP_DEFN void PCRE_CALL_CONVENTION Line 550  PCRE_EXP_DEFN void PCRE_CALL_CONVENTION
550  pcre16_free_substring(PCRE_SPTR16 pointer)  pcre16_free_substring(PCRE_SPTR16 pointer)
551  #endif  #endif
552  {  {
553  (pcre_free)((void *)pointer);  (PUBL(free))((void *)pointer);
554  }  }
555    
556  /* End of pcre_get.c */  /* End of pcre_get.c */

Legend:
Removed from v.803  
changed lines
  Added in v.804

  ViewVC Help
Powered by ViewVC 1.1.5