1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2012 Index Data
3 * See the file LICENSE for details.
10 #include <yaz/pquery.h>
11 #include <yaz/proto.h>
14 /** \brief build a 100 level query */
17 ODR odr = odr_createmem(ODR_ENCODE);
18 YAZ_PQF_Parser parser = yaz_pqf_create();
19 Z_RPNQuery *rpn_query;
28 for (i = 0; i<100; i++)
29 strcat(qstr, "@and 1 ");
32 rpn_query = yaz_pqf_parse (parser, odr, qstr);
35 ret = z_RPNQuery(odr, &rpn_query, 0, 0);
38 yaz_pqf_destroy(parser);
42 /** \brief build a circular referenced query */
45 ODR odr = odr_createmem(ODR_ENCODE);
46 YAZ_PQF_Parser parser = yaz_pqf_create();
47 Z_RPNQuery *rpn_query;
52 rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
55 /* make the circular reference */
56 rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;
58 ret = z_RPNQuery(odr, &rpn_query, 0, 0); /* should fail */
61 yaz_pqf_destroy(parser);
65 int main(int argc, char **argv)
67 YAZ_CHECK_INIT(argc, argv);
75 * c-file-style: "Stroustrup"
76 * indent-tabs-mode: nil
78 * vim: shiftwidth=4 tabstop=8 expandtab