+ Z_Query *query;
+ *str = 0;
+ if (!m_buf)
+ return;
+ odr_setbuf(odr_decode, m_buf, m_len, 0);
+ if (!z_Query(odr_decode, &query, 0, 0))
+ return;
+ WRBUF wbuf = zquery2pquery(query);
+ if (wbuf)
+ {
+ if (wrbuf_len(wbuf) > len-1)
+ {
+ memcpy(str, wrbuf_buf(wbuf), len-1);
+ str[len-1] = '\0';
+ }
+ else
+ strcpy(str, wrbuf_buf(wbuf));
+ wrbuf_free(wbuf,1);
+ }
+ odr_reset(odr_decode);
+}
+
+int Yaz_Z_Query::match(Yaz_Z_Query *other)
+{
+ if (m_len != other->m_len)
+ return 0;
+ if (!m_buf || !other->m_buf)
+ return 0;
+ if (memcmp(m_buf, other->m_buf, m_len))
+ return 0;
+ return 1;
+}