#include "refer.h"
/*
* write the tag values referenced by the List items;
* limit output to at most taglim values
*/
void result(List *drops, int taglim, FILE *fc)
{
int i, nf;
char *s;
char res[200];
if ((nf = drops->n) > taglim)
nf = taglim;
for (i = 0; i < nf; i++) {
xseek(fc, drops->el[i], 0);
fgets(res, sizeof(res), fc);
if ((s = strchr(res, ';')) != 0) {
*s++ = '\n';
*s = '\0';
}
if (tagout != 0) {
if (res[0] == '/' || usedir[0] == 0)
sprintf(tagout, "%s", res);
else
sprintf(tagout, "%s/%s", usedir, res);
tagout += strlen(tagout);
} else {
if (res[0] != '/' || usedir[0] == 0)
printf("%s/", usedir);
printf("%s\n", res);
}
}
}
|