-/*
- * Copyright (C) 1995-2007, Index Data ApS
- * All rights reserved.
- *
- * $Id: querytowrbuf.c,v 1.10 2007-05-06 20:12:20 adam Exp $
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2009 Index Data
+ * See the file LICENSE for details.
*/
/** \file querytowrbuf.c
- \brief Query to WRBUF (to strings)
+ \brief Convert Z39.50 Z_Query to PQF (as WRBUF string)
*/
#include <stdio.h>
#include <yaz/querytowrbuf.h>
#include <yaz/oid_db.h>
-static void yaz_term_to_wrbuf(WRBUF b, const char *term, int len)
+void yaz_encode_pqf_term(WRBUF b, const char *term, int len)
{
int i;
for (i = 0; i < len; i++)
switch (zapt->term->which)
{
case Z_Term_general:
- yaz_term_to_wrbuf(b, (const char *)zapt->term->u.general->buf,
- zapt->term->u.general->len);
+ yaz_encode_pqf_term(b, (const char *)zapt->term->u.general->buf,
+ zapt->term->u.general->len);
break;
case Z_Term_characterString:
wrbuf_printf(b, "@term string ");
- yaz_term_to_wrbuf(b, zapt->term->u.characterString,
- strlen(zapt->term->u.characterString));
+ yaz_encode_pqf_term(b, zapt->term->u.characterString,
+ strlen(zapt->term->u.characterString));
break;
case Z_Term_numeric:
wrbuf_printf(b, "@term numeric %d ", *zapt->term->u.numeric);
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
wrbuf_printf(b, "@set ");
- yaz_term_to_wrbuf(b, zs->u.simple->u.resultSetId,
- strlen(zs->u.simple->u.resultSetId));
+ yaz_encode_pqf_term(b, zs->u.simple->u.resultSetId,
+ strlen(zs->u.simple->u.resultSetId));
}
else
wrbuf_printf (b, "(unknown simple structure)");
}
void yaz_scan_to_wrbuf(WRBUF b, const Z_AttributesPlusTerm *zapt,
- const int *attrbute_set)
+ const Odr_oid *attrbute_set)
{
/* should print attr set here */
wrbuf_printf(b, "RPN ");
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab