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

Diff of /code/trunk/pcretest.c

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

revision 1312 by ph10, Fri Apr 5 15:35:59 2013 UTC revision 1313 by ph10, Wed Apr 24 12:07:09 2013 UTC
# Line 2395  else Line 2395  else
2395    rc = PCRE_ERROR_BADMODE;    rc = PCRE_ERROR_BADMODE;
2396  #endif  #endif
2397    
2398  if (rc < 0)  if (rc < 0 && rc != PCRE_ERROR_UNSET)
2399    {    {
2400    fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,    fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,
2401      pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "", option);      pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "", option);
# Line 2471  BOOL utf16_char = FALSE; Line 2471  BOOL utf16_char = FALSE;
2471  re->magic_number = REVERSED_MAGIC_NUMBER;  re->magic_number = REVERSED_MAGIC_NUMBER;
2472  re->size = swap_uint32(re->size);  re->size = swap_uint32(re->size);
2473  re->options = swap_uint32(re->options);  re->options = swap_uint32(re->options);
2474  re->flags = swap_uint16(re->flags);  re->flags = swap_uint32(re->flags);
2475  re->top_bracket = swap_uint16(re->top_bracket);  re->limit_match = swap_uint32(re->limit_match);
2476  re->top_backref = swap_uint16(re->top_backref);  re->limit_recursion = swap_uint32(re->limit_recursion);
2477  re->first_char = swap_uint16(re->first_char);  re->first_char = swap_uint16(re->first_char);
2478  re->req_char = swap_uint16(re->req_char);  re->req_char = swap_uint16(re->req_char);
2479    re->max_lookbehind = swap_uint16(re->max_lookbehind);
2480    re->top_bracket = swap_uint16(re->top_bracket);
2481    re->top_backref = swap_uint16(re->top_backref);
2482  re->name_table_offset = swap_uint16(re->name_table_offset);  re->name_table_offset = swap_uint16(re->name_table_offset);
2483  re->name_entry_size = swap_uint16(re->name_entry_size);  re->name_entry_size = swap_uint16(re->name_entry_size);
2484  re->name_count = swap_uint16(re->name_count);  re->name_count = swap_uint16(re->name_count);
2485    re->ref_count = swap_uint16(re->ref_count);
2486    
2487  if (extra != NULL)  if (extra != NULL)
2488    {    {
# Line 2648  int length = re->name_count * re->name_e Line 2652  int length = re->name_count * re->name_e
2652  re->magic_number = REVERSED_MAGIC_NUMBER;  re->magic_number = REVERSED_MAGIC_NUMBER;
2653  re->size = swap_uint32(re->size);  re->size = swap_uint32(re->size);
2654  re->options = swap_uint32(re->options);  re->options = swap_uint32(re->options);
2655  re->flags = swap_uint16(re->flags);  re->flags = swap_uint32(re->flags);
2656  re->top_bracket = swap_uint16(re->top_bracket);  re->limit_match = swap_uint32(re->limit_match);
2657  re->top_backref = swap_uint16(re->top_backref);  re->limit_recursion = swap_uint32(re->limit_recursion);
2658  re->first_char = swap_uint32(re->first_char);  re->first_char = swap_uint32(re->first_char);
2659  re->req_char = swap_uint32(re->req_char);  re->req_char = swap_uint32(re->req_char);
2660    re->max_lookbehind = swap_uint16(re->max_lookbehind);
2661    re->top_bracket = swap_uint16(re->top_bracket);
2662    re->top_backref = swap_uint16(re->top_backref);
2663  re->name_table_offset = swap_uint16(re->name_table_offset);  re->name_table_offset = swap_uint16(re->name_table_offset);
2664  re->name_entry_size = swap_uint16(re->name_entry_size);  re->name_entry_size = swap_uint16(re->name_entry_size);
2665  re->name_count = swap_uint16(re->name_count);  re->name_count = swap_uint16(re->name_count);
2666    re->ref_count = swap_uint16(re->ref_count);
2667    
2668  if (extra != NULL)  if (extra != NULL)
2669    {    {
# Line 3525  while (!done) Line 3533  while (!done)
3533        PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, NULL);        PCRE_PATTERN_TO_HOST_BYTE_ORDER(rc, re, extra, NULL);
3534        if (rc == PCRE_ERROR_BADMODE)        if (rc == PCRE_ERROR_BADMODE)
3535          {          {
3536          pcre_uint16 flags_in_host_byte_order;          pcre_uint32 flags_in_host_byte_order;
3537          if (REAL_PCRE_MAGIC(re) == MAGIC_NUMBER)          if (REAL_PCRE_MAGIC(re) == MAGIC_NUMBER)
3538            flags_in_host_byte_order = REAL_PCRE_FLAGS(re);            flags_in_host_byte_order = REAL_PCRE_FLAGS(re);
3539          else          else
3540            flags_in_host_byte_order = swap_uint16(REAL_PCRE_FLAGS(re));            flags_in_host_byte_order = swap_uint32(REAL_PCRE_FLAGS(re));
3541          /* Simulate the result of the function call below. */          /* Simulate the result of the function call below. */
3542          fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,          fprintf(outfile, "Error %d from pcre%s_fullinfo(%d)\n", rc,
3543            pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "",            pcre_mode == PCRE32_MODE ? "32" : pcre_mode == PCRE16_MODE ? "16" : "",
# Line 4010  while (!done) Line 4018  while (!done)
4018        {        {
4019        unsigned long int all_options;        unsigned long int all_options;
4020        pcre_uint32 first_char, need_char;        pcre_uint32 first_char, need_char;
4021          pcre_uint32 match_limit, recursion_limit;
4022        int count, backrefmax, first_char_set, need_char_set, okpartial, jchanged,        int count, backrefmax, first_char_set, need_char_set, okpartial, jchanged,
4023          hascrorlf, maxlookbehind;          hascrorlf, maxlookbehind;
4024        int nameentrysize, namecount;        int nameentrysize, namecount;
# Line 4037  while (!done) Line 4046  while (!done)
4046          (int)size, (int)regex_gotten_store);          (int)size, (int)regex_gotten_store);
4047    
4048        fprintf(outfile, "Capturing subpattern count = %d\n", count);        fprintf(outfile, "Capturing subpattern count = %d\n", count);
4049    
4050        if (backrefmax > 0)        if (backrefmax > 0)
4051          fprintf(outfile, "Max back reference = %d\n", backrefmax);          fprintf(outfile, "Max back reference = %d\n", backrefmax);
4052    
4053          if (maxlookbehind > 0)
4054            fprintf(outfile, "Max lookbehind = %d\n", maxlookbehind);
4055    
4056          if (new_info(re, NULL, PCRE_INFO_MATCHLIMIT, &match_limit) == 0)
4057            fprintf(outfile, "Match limit = %u\n", match_limit);
4058    
4059          if (new_info(re, NULL, PCRE_INFO_RECURSIONLIMIT, &recursion_limit) == 0)
4060            fprintf(outfile, "Recursion limit = %u\n", recursion_limit);
4061    
4062        if (namecount > 0)        if (namecount > 0)
4063          {          {
4064          fprintf(outfile, "Named capturing subpatterns:\n");          fprintf(outfile, "Named capturing subpatterns:\n");
# Line 4073  while (!done) Line 4092  while (!done)
4092        if (do_flip) all_options = swap_uint32(all_options);        if (do_flip) all_options = swap_uint32(all_options);
4093    
4094        if (get_options == 0) fprintf(outfile, "No options\n");        if (get_options == 0) fprintf(outfile, "No options\n");
4095          else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",          else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
4096            ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "",            ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "",
4097            ((get_options & PCRE_CASELESS) != 0)? " caseless" : "",            ((get_options & PCRE_CASELESS) != 0)? " caseless" : "",
4098            ((get_options & PCRE_EXTENDED) != 0)? " extended" : "",            ((get_options & PCRE_EXTENDED) != 0)? " extended" : "",
# Line 4090  while (!done) Line 4109  while (!done)
4109            ((get_options & PCRE_UCP) != 0)? " ucp" : "",            ((get_options & PCRE_UCP) != 0)? " ucp" : "",
4110            ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf_check" : "",            ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf_check" : "",
4111            ((get_options & PCRE_NO_START_OPTIMIZE) != 0)? " no_start_optimize" : "",            ((get_options & PCRE_NO_START_OPTIMIZE) != 0)? " no_start_optimize" : "",
4112            ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "");            ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "",
4113              ((get_options & PCRE_NEVER_UTF) != 0)? " never_utf" : "");
4114    
4115        if (jchanged) fprintf(outfile, "Duplicate name status changes\n");        if (jchanged) fprintf(outfile, "Duplicate name status changes\n");
4116    
# Line 4164  while (!done) Line 4184  while (!done)
4184            }            }
4185          }          }
4186    
       if (maxlookbehind > 0)  
         fprintf(outfile, "Max lookbehind = %d\n", maxlookbehind);  
   
4187        /* Don't output study size; at present it is in any case a fixed        /* Don't output study size; at present it is in any case a fixed
4188        value, but it varies, depending on the computer architecture, and        value, but it varies, depending on the computer architecture, and
4189        so messes up the test suite. (And with the /F option, it might be        so messes up the test suite. (And with the /F option, it might be

Legend:
Removed from v.1312  
changed lines
  Added in v.1313

  ViewVC Help
Powered by ViewVC 1.1.5