1 /* $Id: util.cpp,v 1.1 2005-10-26 18:53:49 adam Exp $
2 Copyright (c) 2005, Index Data.
9 #include <yaz/pquery.h>
12 bool yp2::util::pqf(ODR odr, Z_APDU *apdu, const std::string &q) {
13 YAZ_PQF_Parser pqf_parser = yaz_pqf_create();
15 Z_RPNQuery *rpn = yaz_pqf_parse(pqf_parser, odr, q.c_str());
18 yaz_pqf_destroy(pqf_parser);
21 yaz_pqf_destroy(pqf_parser);
22 Z_Query *query = (Z_Query *) odr_malloc(odr, sizeof(Z_Query));
23 query->which = Z_Query_type_1;
24 query->u.type_1 = rpn;
26 apdu->u.searchRequest->query = query;
32 * indent-tabs-mode: nil
33 * c-file-style: "stroustrup"
35 * vim: shiftwidth=4 tabstop=8 expandtab