1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
6 #include <yaz/pquery.h>
10 /** \brief build a 100 level query */
13 ODR odr = odr_createmem(ODR_ENCODE);
14 YAZ_PQF_Parser parser = yaz_pqf_create();
15 Z_RPNQuery *rpn_query;
24 for (i = 0; i<100; i++)
25 strcat(qstr, "@and 1 ");
28 rpn_query = yaz_pqf_parse (parser, odr, qstr);
31 ret = z_RPNQuery(odr, &rpn_query, 0, 0);
34 yaz_pqf_destroy(parser);
38 /** \brief build a circular referenced query */
41 ODR odr = odr_createmem(ODR_ENCODE);
42 YAZ_PQF_Parser parser = yaz_pqf_create();
43 Z_RPNQuery *rpn_query;
48 rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
51 /* make the circular reference */
52 rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;
54 ret = z_RPNQuery(odr, &rpn_query, 0, 0); /* should fail */
57 yaz_pqf_destroy(parser);
61 int main(int argc, char **argv)
63 YAZ_CHECK_INIT(argc, argv);
71 * indent-tabs-mode: nil
73 * vim: shiftwidth=4 tabstop=8 expandtab