version 1.2, 2011/10/07 13:22:33 |
version 1.4, 2011/10/08 12:20:09 |
Line 289 state_search(struct state *p, const struct opts *opts, |
|
Line 289 state_search(struct state *p, const struct opts *opts, |
|
recno_t rec; |
recno_t rec; |
uint32_t fl; |
uint32_t fl; |
DBT key, val; |
DBT key, val; |
struct res res[MAXRESULTS]; |
struct res *res; |
regex_t reg; |
regex_t reg; |
regex_t *regp; |
regex_t *regp; |
char filebuf[10]; |
char filebuf[10]; |
struct rec record; |
struct rec record; |
|
|
|
res = NULL; |
len = 0; |
len = 0; |
buf = NULL; |
buf = NULL; |
bufsz = 0; |
bufsz = 0; |
Line 341 state_search(struct state *p, const struct opts *opts, |
|
Line 342 state_search(struct state *p, const struct opts *opts, |
|
* Lastly, add it to the available records. |
* Lastly, add it to the available records. |
*/ |
*/ |
|
|
while (len < MAXRESULTS) { |
while (0 == (ch = (*p->db->seq)(p->db, &key, &val, dflag))) { |
if ((ch = (*p->db->seq)(p->db, &key, &val, dflag))) |
|
break; |
|
|
|
dflag = R_NEXT; |
dflag = R_NEXT; |
|
|
/* |
/* |
Line 411 state_search(struct state *p, const struct opts *opts, |
|
Line 409 state_search(struct state *p, const struct opts *opts, |
|
if (i < len) |
if (i < len) |
continue; |
continue; |
|
|
|
res = mandoc_realloc |
|
(res, (len + 1) * sizeof(struct res)); |
|
|
/* |
/* |
* Now we have our filename, keywords, types, and all |
* Now we have our filename, keywords, types, and all |
* other necessary information. |
* other necessary information. |
|
|
free(res[len].uri); |
free(res[len].uri); |
} |
} |
|
|
|
free(res); |
free(buf); |
free(buf); |
mchars_free(mc); |
mchars_free(mc); |
|
|
Line 489 buf_alloc(char **buf, size_t *bufsz, size_t sz) |
|
Line 491 buf_alloc(char **buf, size_t *bufsz, size_t sz) |
|
return; |
return; |
|
|
*bufsz = sz + 1024; |
*bufsz = sz + 1024; |
if (NULL == (*buf = realloc(*buf, *bufsz))) { |
*buf = mandoc_realloc(*buf, *bufsz); |
perror(NULL); |
|
exit(EXIT_FAILURE); |
|
} |
|
} |
} |
|
|
/* |
/* |