Browse Source Download (without any required ccan dependencies)
version
helper functions for major.minor-style version numbers
Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer <peter.hutterer@who-t.net>
This code provides some helper functions to deal with version numbers in the form major.minor.
struct version a = version(1, 0);
struct version b = version(2, 2);
if (version_cmp(a, b) < 0)
printf("Feature supported in version 2.2 but we have %d.%d\n",
version_major(a), version_minor(a));
if (version_cmp(a, version(3, 4)) < 0)
printf("Feature only supported in version 3.4\n");
BSD-MIT