From 57e3f92b22e4269c0d6a788cf5ad4d8021ba9bf2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Apr 2025 11:35:17 +0200 Subject: [PATCH 1/3] Define Yaz_cql2rpn::define_pattern --- include/yazpp/cql2rpn.h | 3 ++- src/test_query.cpp | 2 +- src/yaz-cql2rpn.cpp | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/yazpp/cql2rpn.h b/include/yazpp/cql2rpn.h index 6f4d820..5eb6fad 100644 --- a/include/yazpp/cql2rpn.h +++ b/include/yazpp/cql2rpn.h @@ -1,5 +1,5 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) Index Data + * Copyright (C) Index Data * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -35,6 +35,7 @@ class YAZ_EXPORT Yaz_cql2rpn { ~Yaz_cql2rpn(); void set_pqf_file(const char *fname); bool parse_spec_file(const char *fname, int *error); + int define_pattern(const char *pattern, const char *value); int query_transform(const char *cql, Z_RPNQuery **rpnquery, ODR o, char **addinfop); int rpn2cql_transform(Z_RPNQuery *q, WRBUF cql, ODR o, char **addinfop); diff --git a/src/test_query.cpp b/src/test_query.cpp index 0367b4b..24bd5b0 100644 --- a/src/test_query.cpp +++ b/src/test_query.cpp @@ -1,5 +1,5 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ diff --git a/src/yaz-cql2rpn.cpp b/src/yaz-cql2rpn.cpp index 54d0006..9d6f2d8 100644 --- a/src/yaz-cql2rpn.cpp +++ b/src/yaz-cql2rpn.cpp @@ -1,5 +1,5 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -41,6 +41,13 @@ bool Yaz_cql2rpn::parse_spec_file(const char *fname, int *error) return m_transform ? true : false; } +int Yaz_cql2rpn::define_pattern(const char *pattern, const char *value) +{ + if (!m_transform) + m_transform = cql_transform_create(); + return cql_transform_define_pattern(m_transform, pattern, value); +} + int Yaz_cql2rpn::rpn2cql_transform(Z_RPNQuery *q, WRBUF cql, ODR o, char **addinfop) { From 88a34495863ac91547d211d042a33cc052691f41 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Apr 2025 15:35:22 +0200 Subject: [PATCH 2/3] Use cql_transform_define_fname So that the cql transform handle is not "reset" in usage. --- src/yaz-cql2rpn.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/yaz-cql2rpn.cpp b/src/yaz-cql2rpn.cpp index 9d6f2d8..a946295 100644 --- a/src/yaz-cql2rpn.cpp +++ b/src/yaz-cql2rpn.cpp @@ -32,13 +32,12 @@ void Yaz_cql2rpn::set_pqf_file(const char *fname) m_transform = cql_transform_open_fname(fname); } - bool Yaz_cql2rpn::parse_spec_file(const char *fname, int *error) { - *error = 0; - cql_transform_close(m_transform); - m_transform = cql_transform_open_fname(fname); - return m_transform ? true : false; + if (!m_transform) + m_transform = cql_transform_create(); + *error = cql_transform_define_fname(m_transform, fname); + return *error == 0 ? true : false; } int Yaz_cql2rpn::define_pattern(const char *pattern, const char *value) From 71e4703676b6d0f5392a34eb4d2a5c4452370b3b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 10 Apr 2025 10:25:53 +0200 Subject: [PATCH 3/3] Depend on YAZ 5.35.0+; extend interface --- IDMETA | 2 +- configure.ac | 2 +- debian/control | 2 +- src/Makefile.am | 2 +- yazpp.spec | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/IDMETA b/IDMETA index bd2ec74..714b1d3 100644 --- a/IDMETA +++ b/IDMETA @@ -1,4 +1,4 @@ DEBIAN_DIST="bookworm bullseye" UBUNTU_DIST="noble jammy focal" CENTOS_DIST="centos7 centos8 centos9" -VERSION=1.8.1 +VERSION=1.9.0 diff --git a/configure.ac b/configure.ac index a8057a1..2abeb39 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ AC_PROG_EGREP LT_INIT -YAZ_INIT([],[5.1.0]) +YAZ_INIT([],[5.35.0]) if test -z "$YAZLIB"; then AC_MSG_ERROR([YAZ development libraries missing]) fi diff --git a/debian/control b/debian/control index 98126bf..4d8a67a 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Standards-Version: 3.6.2 Build-Depends: debhelper (>= 9.0.0), libxml2-dev, libxslt1-dev, pkg-config, - libyaz5-dev (>= 5.29.0) + libyaz5-dev (>= 5.35.0) Package: libyazpp7 Section: libs diff --git a/src/Makefile.am b/src/Makefile.am index fca2afc..e04526c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ TESTS = $(check_PROGRAMS) AM_CXXFLAGS = -I$(srcdir)/../include $(YAZINC) lib_LTLIBRARIES = libyazpp.la -libyazpp_la_LDFLAGS=-version-info 6:0:0 +libyazpp_la_LDFLAGS=-version-info 7:0:1 DISTCLEANFILES = yazpp-config diff --git a/yazpp.spec b/yazpp.spec index 19d06cf..56b72e0 100644 --- a/yazpp.spec +++ b/yazpp.spec @@ -9,7 +9,7 @@ Vendor: Index Data ApS Source: yazpp-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root Prefix: %{_prefix} -BuildRequires: pkgconfig, libyaz5-devel >= 5.29.0 +BuildRequires: pkgconfig, libyaz5-devel >= 5.35.0 Packager: Adam Dickmeiss URL: http://www.indexdata.com/yazplusplus