#include "log.h"
#include "sysevents.h"
#include "filenet.h"
+#include "client.h"
#include "search.h"
#define TOK_STR 0
if(sexpr->d.s != NULL)
free(sexpr->d.s);
}
+ if(sexpr->op == SOP_HASHIS)
+ {
+ if(sexpr->d.hash != NULL)
+ freehash(sexpr->d.hash);
+ }
free(sexpr);
}
freetok(tok2);
putsexpr(sexpr);
done = 0;
+ } else if((st->type == TOK_STR) && !wcsncmp(st->d.str, L"H=", 2)) {
+ tok2 = poptok(&st);
+ pushtok(tok = newtok(), &st);
+ tok->type = TOK_SE;
+ sexpr = newsexpr();
+ sexpr->op = SOP_HASHIS;
+ if((sexpr->d.hash = parsehash(tok2->d.str + 2)) == NULL)
+ {
+ freetok(tok2);
+ putsexpr(sexpr);
+ goto out_err;
+ }
+ sexpr->cost = 2;
+ getsexpr(tok->d.se = sexpr);
+ freetok(tok2);
+ putsexpr(sexpr);
+ done = 0;
} else if((std >= 3) && (st->type == TOK_CP) && (st->next->type == TOK_SE) && (st->next->next->type == TOK_OP)) {
freetok(poptok(&st));
tok = poptok(&st);
freesl(&l1);
freesl(&l2);
break;
- case SOP_NOT:
- break;
case SOP_NAMERE:
case SOP_LINKRE:
list = regexfindstrings(sexpr->d.re.sre);
return(sr->size == sexpr->d.n);
case SOP_SIZEGT:
return(sr->size > sexpr->d.n);
+ case SOP_HASHIS:
+ if(sr->hash == NULL)
+ return(0);
+ return(hashcmp(sr->hash, sexpr->d.hash));
}
return(0);
}
sr->srch->results = sr->next;
sr->srch->numres--;
}
+ if(sr->hash != NULL)
+ freehash(sr->hash);
if(sr->filename != NULL)
free(sr->filename);
if(sr->peerid != NULL)
new->filename = swcsdup(sr->filename);
if(sr->fn != NULL)
getfnetnode(new->fn = sr->fn);
+ if(sr->hash != NULL)
+ new->hash = duphash(sr->hash);
return(new);
}