| 141 |
*************************************************/ |
*************************************************/ |
| 142 |
|
|
| 143 |
/* Make this function work for a regex with integers either byte order. |
/* Make this function work for a regex with integers either byte order. |
| 144 |
However, we assume that what we are passed is a compiled regex. */ |
However, we assume that what we are passed is a compiled regex. The |
| 145 |
|
print_lengths flag controls whether offsets and lengths of items are printed. |
| 146 |
|
They can be turned off from pcretest so that automatic tests on bytecode can be |
| 147 |
|
written that do not depend on the value of LINK_SIZE. */ |
| 148 |
|
|
| 149 |
static void |
static void |
| 150 |
pcre_printint(pcre *external_re, FILE *f) |
pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths) |
| 151 |
{ |
{ |
| 152 |
real_pcre *re = (real_pcre *)external_re; |
real_pcre *re = (real_pcre *)external_re; |
| 153 |
uschar *codestart, *code; |
uschar *codestart, *code; |
| 178 |
int c; |
int c; |
| 179 |
int extra = 0; |
int extra = 0; |
| 180 |
|
|
| 181 |
fprintf(f, "%3d ", (int)(code - codestart)); |
if (print_lengths) |
| 182 |
|
fprintf(f, "%3d ", (int)(code - codestart)); |
| 183 |
|
else |
| 184 |
|
fprintf(f, " "); |
| 185 |
|
|
| 186 |
switch(*code) |
switch(*code) |
| 187 |
{ |
{ |
| 218 |
|
|
| 219 |
case OP_CBRA: |
case OP_CBRA: |
| 220 |
case OP_SCBRA: |
case OP_SCBRA: |
| 221 |
fprintf(f, "%3d %s %d", GET(code, 1), OP_names[*code], |
if (print_lengths) fprintf(f, "%3d ", GET(code, 1)); |
| 222 |
GET2(code, 1+LINK_SIZE)); |
else fprintf(f, " "); |
| 223 |
|
fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE)); |
| 224 |
break; |
break; |
| 225 |
|
|
| 226 |
case OP_BRA: |
case OP_BRA: |
| 237 |
case OP_COND: |
case OP_COND: |
| 238 |
case OP_SCOND: |
case OP_SCOND: |
| 239 |
case OP_REVERSE: |
case OP_REVERSE: |
| 240 |
fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); |
if (print_lengths) fprintf(f, "%3d ", GET(code, 1)); |
| 241 |
|
else fprintf(f, " "); |
| 242 |
|
fprintf(f, "%s", OP_names[*code]); |
| 243 |
break; |
break; |
| 244 |
|
|
| 245 |
case OP_CREF: |
case OP_CREF: |
| 355 |
break; |
break; |
| 356 |
|
|
| 357 |
case OP_RECURSE: |
case OP_RECURSE: |
| 358 |
fprintf(f, "%3d %s", GET(code, 1), OP_names[*code]); |
if (print_lengths) fprintf(f, "%3d ", GET(code, 1)); |
| 359 |
|
else fprintf(f, " "); |
| 360 |
|
fprintf(f, "%s", OP_names[*code]); |
| 361 |
break; |
break; |
| 362 |
|
|
| 363 |
case OP_REF: |
case OP_REF: |