| 71 |
int rc; |
int rc; |
| 72 |
int entrysize; |
int entrysize; |
| 73 |
int top, bot; |
int top, bot; |
| 74 |
uschar *nametable; |
pcre_uchar *nametable; |
| 75 |
|
|
| 76 |
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) |
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) |
| 77 |
return rc; |
return rc; |
| 86 |
while (top > bot) |
while (top > bot) |
| 87 |
{ |
{ |
| 88 |
int mid = (top + bot) / 2; |
int mid = (top + bot) / 2; |
| 89 |
uschar *entry = nametable + entrysize*mid; |
pcre_uchar *entry = nametable + entrysize*mid; |
| 90 |
int c = strcmp(stringname, (char *)(entry + 2)); |
int c = strcmp(stringname, (char *)(entry + 2)); |
| 91 |
if (c == 0) return (entry[0] << 8) + entry[1]; |
if (c == 0) return (entry[0] << 8) + entry[1]; |
| 92 |
if (c > 0) bot = mid + 1; else top = mid; |
if (c > 0) bot = mid + 1; else top = mid; |
| 121 |
int rc; |
int rc; |
| 122 |
int entrysize; |
int entrysize; |
| 123 |
int top, bot; |
int top, bot; |
| 124 |
uschar *nametable, *lastentry; |
pcre_uchar *nametable, *lastentry; |
| 125 |
|
|
| 126 |
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) |
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0) |
| 127 |
return rc; |
return rc; |
| 137 |
while (top > bot) |
while (top > bot) |
| 138 |
{ |
{ |
| 139 |
int mid = (top + bot) / 2; |
int mid = (top + bot) / 2; |
| 140 |
uschar *entry = nametable + entrysize*mid; |
pcre_uchar *entry = nametable + entrysize*mid; |
| 141 |
int c = strcmp(stringname, (char *)(entry + 2)); |
int c = strcmp(stringname, (char *)(entry + 2)); |
| 142 |
if (c == 0) |
if (c == 0) |
| 143 |
{ |
{ |
| 144 |
uschar *first = entry; |
pcre_uchar *first = entry; |
| 145 |
uschar *last = entry; |
pcre_uchar *last = entry; |
| 146 |
while (first > nametable) |
while (first > nametable) |
| 147 |
{ |
{ |
| 148 |
if (strcmp(stringname, (char *)(first - entrysize + 2)) != 0) break; |
if (strcmp(stringname, (char *)(first - entrysize + 2)) != 0) break; |
| 188 |
const real_pcre *re = (const real_pcre *)code; |
const real_pcre *re = (const real_pcre *)code; |
| 189 |
int entrysize; |
int entrysize; |
| 190 |
char *first, *last; |
char *first, *last; |
| 191 |
uschar *entry; |
pcre_uchar *entry; |
| 192 |
if ((re->options & PCRE_DUPNAMES) == 0 && (re->flags & PCRE_JCHANGED) == 0) |
if ((re->options & PCRE_DUPNAMES) == 0 && (re->flags & PCRE_JCHANGED) == 0) |
| 193 |
return pcre_get_stringnumber(code, stringname); |
return pcre_get_stringnumber(code, stringname); |
| 194 |
entrysize = pcre_get_stringtable_entries(code, stringname, &first, &last); |
entrysize = pcre_get_stringtable_entries(code, stringname, &first, &last); |
| 195 |
if (entrysize <= 0) return entrysize; |
if (entrysize <= 0) return entrysize; |
| 196 |
for (entry = (uschar *)first; entry <= (uschar *)last; entry += entrysize) |
for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize) |
| 197 |
{ |
{ |
| 198 |
int n = (entry[0] << 8) + entry[1]; |
int n = (entry[0] << 8) + entry[1]; |
| 199 |
if (ovector[n*2] >= 0) return n; |
if (ovector[n*2] >= 0) return n; |