/*
- * Copyright (c) 1996-2002, Index Data.
+ * Copyright (c) 1996-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-ccl.c,v 1.16 2002-12-28 12:13:03 adam Exp $
+ * $Id: yaz-ccl.c,v 1.21 2003-06-23 12:38:39 adam Exp $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <yaz/yaz-ccl.h>
#include <yaz/pquery.h>
ccl_pquery(wr, p);
- printf ("pqf=%s\n", wrbuf_buf(wr));
q = yaz_pqf_parse(parser, o, wrbuf_buf(wr));
wrbuf_free(wr, 1);
wrbuf_puts (w, att->set);
wrbuf_puts (w, " ");
}
- sprintf(tmpattr, "%d=%d ", att->type, att->value);
- wrbuf_puts (w, tmpattr);
+ switch(att->kind)
+ {
+ case CCL_RPN_ATTR_NUMERIC:
+ sprintf(tmpattr, "%d=%d ", att->type, att->value.numeric);
+ wrbuf_puts (w, tmpattr);
+ break;
+ case CCL_RPN_ATTR_STRING:
+ sprintf(tmpattr, "%d=", att->type);
+ wrbuf_puts (w, tmpattr);
+ wrbuf_puts(w, att->value.str);
+ break;
+ }
}
for (cp = p->u.t.term; *cp; cp++)
{