API for function `gvPluginList`: When did it change?

I am trying to update an older application which worked fine in 2023 using GraphViz as a library.
The function gvPluginList, declared in gvc.h, used to take four arguments, but now the last one was dropped at some point (type const char *)..

I would like to wrap the call to gvPluginList in #if..#endif macros and check the version number when this no longer worked as before, but don’t know how to find this without looking at all of the source code between version 2.4x and currently 13.1.2.

Does anyone know offhand?

Duh… :man_facepalming: I finally thought to look at CHANGELOG.md, and there it is (version 9.0.0).

(EDIT: It would be nice if the version was exposed as a number – better yet: broken down into major, minor, and build elements – and not only as a string.)

(EDIT #2: Since there is apparently no way to get the C preprocessor to convert a string into a number, I found some other macros which had been removed in the upgrade to version 9.0.0. Now I am able to check for the definition of the macro DTTREEMATCH which was defined before, i.e.:

#ifndef DTTREEMATCH
#define GV_VERSION_9_0_0_TEST
#endif

Hoping that there won’t be too many other problems in this regard. :folded_hands:

(EDIT #3: There was a change of parameter type for the function gvRenderData (the last, which used to take an unsigned int* and as of version 13.0,0 takes a size_t*). Here is a switch you can use for that:

#ifndef agnew
#define GV_VERSION_13_0_0_TEST
#endif

According to the change log, there was a macro agnew which was removed in that version.

Git can often tell you some of these things:

$ # in Graphviz repo
$ git blame -- lib/gvc/gvc.h
…
7a112085e0 lib/gvc/gvc.h      (Matthew Fernandez 2023-07-11 19:25:28 +1000 122) GVC_API char **gvPluginList(GVC_t *gvc, const char *kind, int *sz);
…
$ git tag --contains 7a112085e0
9.0.0
…

I didn’t realise this wasn’t already exposed. We can certainly add that.

Hi Matthew,

Here is what I have in graphviz_version.h:

#pragma once
#define GVPLUGIN_CONFIG_FILE "config8"
#define GVPLUGIN_VERSION 8
#define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues"
#define PACKAGE_NAME "graphviz"
#define PACKAGE_STRING "graphviz 13.1.2"
#define PACKAGE_TARNAME "graphviz"
#define PACKAGE_URL ""
#define PACKAGE_VERSION "13.1.2"

Maybe I missed something?

No, you’re completely correct. I just hadn’t looked at that file for some time. I agree that there isn’t really a good way to do this conditional coding without the version information exposed as integers.