+/*
+ * Analogous in every way to ZOOM_query_cql2rpn(), except that there
+ * is no analogous ZOOM_query_ccl() that just sends uninterpreted CCL
+ * to the server, as the YAZ GFS doesn't know how to handle this.
+ */
+ZOOM_API(int)
+ ZOOM_query_ccl2rpn(ZOOM_query s, const char *str, const char *config,
+ int *ccl_error, const char **error_string,
+ int *error_pos)
+{
+ int ret;
+ struct ccl_rpn_node *rpn;
+ CCL_bibset bibset = ccl_qual_mk();
+
+ if (config)
+ ccl_qual_buf(bibset, config);
+
+ rpn = ccl_find_str(bibset, str, ccl_error, error_pos);
+ if (!rpn)
+ {
+ *error_string = ccl_err_msg(*ccl_error);
+ ret = -1;
+ }
+ else
+ {
+ WRBUF wr = wrbuf_alloc();
+ ccl_pquery(wr, rpn);
+ ccl_rpn_delete(rpn);
+ ret = ZOOM_query_prefix(s, wrbuf_buf(wr));
+ wrbuf_free(wr, 1);
+ }
+ ccl_qual_rm(&bibset);
+ return ret;
+}
+