2 * Copyright (C) 1995-2005, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: tstodrstack.c,v 1.5 2006-10-04 16:59:34 mike Exp $
9 #include <yaz/pquery.h>
10 #include <yaz/proto.h>
13 /** \brief build a 100 level query */
16 ODR odr = odr_createmem(ODR_ENCODE);
17 YAZ_PQF_Parser parser = yaz_pqf_create();
18 Z_RPNQuery *rpn_query;
27 for (i = 0; i<100; i++)
28 strcat(qstr, "@and 1 ");
31 rpn_query = yaz_pqf_parse (parser, odr, qstr);
34 ret = z_RPNQuery(odr, &rpn_query, 0, 0);
37 yaz_pqf_destroy(parser);
41 /** \brief build a circular referenced query */
44 ODR odr = odr_createmem(ODR_ENCODE);
45 YAZ_PQF_Parser parser = yaz_pqf_create();
46 Z_RPNQuery *rpn_query;
51 rpn_query = yaz_pqf_parse (parser, odr, "@and @and a b c");
54 /* make the circular reference */
55 rpn_query->RPNStructure->u.complex->s1 = rpn_query->RPNStructure;
57 ret = z_RPNQuery(odr, &rpn_query, 0, 0); /* should fail */
60 yaz_pqf_destroy(parser);
64 int main(int argc, char **argv)
66 YAZ_CHECK_INIT(argc, argv);
74 * indent-tabs-mode: nil
76 * vim: shiftwidth=4 tabstop=8 expandtab