- # check() throws the exception we want; but we only want it on failure!
- Net::Z3950::ZOOM::query_ccl2rpn($q, $string, $conn->_conn()) == 0
- or $conn->_check();
+
+ my $config = $conn->option("cclqual");
+ if (!defined $config) {
+ my $cclfile = $conn->option("cclfile")
+ or ZOOM::_oops(ZOOM::Error::CCL_CONFIG,
+ "no 'cclqual' or 'cclfile' specified");
+ my $fh = new IO::File("<$cclfile")
+ or ZOOM::_oops(ZOOM::Error::CCL_CONFIG,
+ "can't open cclfile '$cclfile': $!");
+ $config = join("", <$fh>);
+ $fh->close();
+ }
+
+ my($ccl_errcode, $ccl_errstr, $ccl_errpos) = (0, "", 0);
+ if (Net::Z3950::ZOOM::query_ccl2rpn($q, $string, $config,
+ $ccl_errcode, $ccl_errstr,
+ $ccl_errpos) < 0) {
+ # We have no use for $ccl_errcode or $ccl_errpos
+ ZOOM::_oops(ZOOM::Error::CCL_PARSE, $ccl_errstr);
+ }