[Xapian-devel] Xapian::xapian_version_string(), etc

Olly Betts olly at survex.com
Tue May 8 00:55:40 BST 2007


I noticed this footnote in deprecation.rst:

    .. [#version] The version functions will probably be preserved for
    longer than the usual lifetime of deprecated features, because it is
    unhelpful to remove functions which people use to test the version
    of the library in use.  However, the replacements have been
    supported for long enough that new applications should use the
    replacement functions without worrying about old library versions
    which don't support them.

I don't think there's a reason to support these for longer than we might
otherwise actually.  These functions report the version of xapian-core
that we're running with (which may be different from the version that
we were built against if xapian-core is a shared library).  But you can
only use an API compatible shared library, otherwise you need to
rebuild, so you generally you'd use preprocessor checks for compile time
selection of things.

You can also use preprocessor checks to decide which function name to
call if you really need to check the library version actually in use.
These functions were added in 0.9.3, and deprecated in favour of names
with "xapian_" removed in 0.9.6, so this code will work for any Xapian
version from 0.9.3 onwards:

#if XAPIAN_MAJOR_VERSION == 0 && XAPIAN_MINOR_VERSION == 9 && XAPIAN_REVISION < 6
    string version_string = Xapian::xapian_version_string();
#else
    string version_string = Xapian::version_string();
#endif

So I don't think there's a reason to keep these around longer than we
would otherwise.  I think removing these in 1.1.0 would be fine, and we
should suggest otherwise in the documentation.  Am I missing something?

Cheers,
    Olly



More information about the Xapian-devel mailing list